Class AttachedFile
ชื่อพื้นที่: Aspose.Note การประกอบ: Aspose.Note.dll (25.4.0)
แสดงไฟล์ที่แนบมา
public class AttachedFile : Node, IPageChildNode, IOutlineElementChildNode, ITaggable, INode
{
private string _path;
public string Path
{
get { return this._path; }
set { this._path = value; }
}
}
Inheritance
object ← Node ← AttachedFile
Implements
IPageChildNode , IOutlineElementChildNode , ITaggable , INode
อนุญาโตตุลาการ
Node.Accept(DocumentVisitor) , Node.Document , Node.IsComposite , Node.NodeType , Node.ParentNode , Node.PreviousSibling , Node.NextSibling , object.GetType() , object.MemberwiseClone() , object.ToString() , object.Equals(object?) , object.Equals(object?, object?) , object.ReferenceEquals(object?, object?) , object.GetHashCode()
Examples
แสดงวิธีรับเนื้อหาของไฟล์ที่แนบมา
string dataDir = RunExamples.GetDataDir_Attachments();
Document oneFile = new Document(dataDir + "Sample1.one");
IList<attachedfile> nodes = oneFile.GetChildNodes<attachedfile>();
foreach (AttachedFile file in nodes)
{
using (Stream outputStream = new MemoryStream(file.Bytes))
{
using (System.IO.FileStream fileStream = System.IO.File.OpenWrite(String.Format(dataDir + file.FileName)))
{
CopyStream(outputStream, fileStream);
}
}
}
แสดงวิธีเพิ่มไฟล์ไปยังเอกสารโดยใช้เส้นทางไฟล์
string dataDir = RunExamples.GetDataDir_Attachments();
Document doc = new Document();
Aspose.Note.Page page = new Aspose.Note.Page(doc);
Outline outline = new Outline(doc);
OutlineElement outlineElem = new OutlineElement(doc);
AttachedFile attachedFile = new AttachedFile(doc, dataDir + "attachment.txt");
outlineElem.AppendChildLast(attachedFile);
outline.AppendChildLast(outlineElem);
page.AppendChildLast(outline);
doc.AppendChildLast(page);
dataDir += "AttachFileByPath_out.one";
doc.Save(dataDir);
แสดงวิธีเพิ่มไฟล์จากกระแสไปยังเอกสาร
string dataDir = RunExamples.GetDataDir_Attachments();
Document doc = new Document();
Aspose.Note.Page page = new Aspose.Note.Page(doc);
Outline outline = new Outline(doc);
OutlineElement outlineElem = new OutlineElement(doc);
using (var stream = File.OpenRead(dataDir + "icon.jpg"))
{
AttachedFile attachedFile = new AttachedFile(doc, dataDir + "attachment.txt", stream, ImageFormat.Jpeg);
outlineElem.AppendChildLast(attachedFile);
}
outline.AppendChildLast(outlineElem);
page.AppendChildLast(outline);
doc.AppendChildLast(page);
dataDir += "AttachFileAndSetIcon_out.one";
doc.Save(dataDir);
Constructors
AttachedFile( String)
เปิดตัวตัวอย่างใหม่ของคลาส Aspose.Note.AttachedFile
public AttachedFile(string path)
{
}
Parameters
path
string
ลวดที่มีเส้นทางไปยังไฟล์จากที่สร้าง Aspose.Note.AttachedFile
AttachedFile( String, Stream, ImageFormat)
เปิดตัวตัวอย่างใหม่ของคลาส Aspose.Note.AttachedFile
public AttachedFile(string path, Stream icon, ImageFormat iconFormat)
{
}
Parameters
path
string
ลวดที่มีเส้นทางไปยังไฟล์จากที่สร้าง Aspose.Note.AttachedFile
icon
Stream
ไอคอนสําหรับไฟล์ที่แนบมา
iconFormat
ImageFormat
รูปแบบของไอคอนไฟล์ที่แนบมา
AttachedFile( String, Stream)
เปิดตัวตัวอย่างใหม่ของคลาส Aspose.Note.AttachedFile
public AttachedFile(string fileName, Stream attachedFileStream)
{
}
Parameters
fileName
string
ชื่อของไฟล์ที่แนบมา
attachedFileStream
Stream
กระแสที่มีไบต์ไฟล์ที่แนบมา
AttachedFile(string, Stream, กระแส, ImageFormat)
เปิดตัวตัวอย่างใหม่ของคลาส Aspose.Note.AttachedFile
public AttachedFile(
string fileName,
Stream attachedFileStream,
Stream icon,
ImageFormat iconFormat)
{
}
Parameters
fileName
string
ชื่อของไฟล์ที่แนบมา
attachedFileStream
Stream
กระแสที่มีไบต์ไฟล์ที่แนบมา
icon
Stream
ไอคอนสําหรับไฟล์ที่แนบมา
iconFormat
ImageFormat
รูปแบบของไอคอนไฟล์ที่แนบมา
การเชื่อมโยงไฟล์()
เปิดตัวตัวอย่างใหม่ของคลาส Aspose.Note.AttachedFile
public AttachedFile()
{
}
Properties
Alignment
รับหรือตั้งค่าการปรับแต่ง
public HorizontalAlignment Alignment
{
get;
set;
}
คุณสมบัติมูลค่า
AlternativeTextDescription
ได้รับหรือตั้งค่าข้อความทางเลือกสําหรับไอคอนของไฟล์ที่แนบ
public string AlternativeTextDescription
{
get;
set;
}
คุณสมบัติมูลค่า
AlternativeTextTitle
รับหรือตั้งชื่อข้อความทางเลือกสําหรับไอคอนของไฟล์ที่แนบมา
public string AlternativeTextTitle
{
get;
set;
}
คุณสมบัติมูลค่า
Bytes
รับข้อมูลไบนารีสําหรับไฟล์ที่รวม
public byte[] Bytes
{
get;
}
คุณสมบัติมูลค่า
byte [ ]
Examples
แสดงวิธีรับเนื้อหาของไฟล์ที่แนบมา
string dataDir = RunExamples.GetDataDir_Attachments();
Document oneFile = new Document(dataDir + "Sample1.one");
IList<attachedfile> nodes = oneFile.GetChildNodes<attachedfile>();
foreach (AttachedFile file in nodes)
{
using (Stream outputStream = new MemoryStream(file.Bytes))
{
using (System.IO.FileStream fileStream = System.IO.File.OpenWrite(String.Format(dataDir + file.FileName)))
{
CopyStream(outputStream, fileStream);
}
}
}
Extension
ได้รับการขยายของไฟล์ที่รวม
public string Extension
{
get;
}
คุณสมบัติมูลค่า
FileName
รับชื่อของไฟล์ที่รวม
public string FileName
{
get;
}
คุณสมบัติมูลค่า
FilePath
รับเส้นทางไปยังไฟล์เดิม
public string FilePath
{
get;
}
คุณสมบัติมูลค่า
Height
ได้รับความสูงเดิมของไอคอนไฟล์ที่รวม
public float Height
{
get;
}
คุณสมบัติมูลค่า
HorizontalOffset
รับหรือวางค่าธรรมเนียมแนวนอน
public float HorizontalOffset
{
get;
set;
}
คุณสมบัติมูลค่า
Icon
ได้รับข้อมูลไบนารีสําหรับไอคอนที่เชื่อมต่อกับไฟล์ที่รวม
public byte[] Icon
{
get;
}
คุณสมบัติมูลค่า
byte [ ]
IconExtension
ได้รับการขยายของไอคอน
public string IconExtension
{
get;
}
คุณสมบัติมูลค่า
IsPrintout
รับหรือตั้งค่าหมายความว่าภาพของไฟล์จะถูกพิมพ์ได้หรือไม่
public bool IsPrintout
{
get;
set;
}
คุณสมบัติมูลค่า
IsSizeSetByUser
รับหรือตั้งค่าหมายความว่าค่าของขนาดของไอคอนได้รับการปรับปรุงอย่างชัดเจนโดยผู้ใช้
public bool IsSizeSetByUser
{
get;
set;
}
คุณสมบัติมูลค่า
LastModifiedTime
ได้รับหรือตั้งค่าเวลาที่เปลี่ยนแปลงล่าสุด
public DateTime LastModifiedTime
{
get;
set;
}
คุณสมบัติมูลค่า
MaxHeight
รับหรือตั้งค่าความสูงสูงสุดเพื่อแสดงไอคอนไฟล์ที่รวม
public float MaxHeight
{
get;
set;
}
คุณสมบัติมูลค่า
MaxWidth
รับหรือตั้งค่าความกว้างสูงสุดเพื่อแสดงไอคอนไฟล์ที่รวม
public float MaxWidth
{
get;
set;
}
คุณสมบัติมูลค่า
ParsingErrorInfo
ได้รับข้อมูลเกี่ยวกับข้อผิดพลาดที่เกิดขึ้นเมื่อเข้าถึงไฟล์
public ParsingErrorInfo ParsingErrorInfo
{
get;
}
คุณสมบัติมูลค่า
Tags
รับรายการแท็กทั้งหมดของ paragraph
public List<ITag> Tags { get; }
คุณสมบัติมูลค่า
Text
รับหรือตั้งค่าการแสดงข้อความของไฟล์ที่รวม สี่เหลี่ยมไม่จําเป็นต้องมีตัวอักษรใด ๆ ของมูลค่า 10 (สายไฟ) หรือ 13 (การส่งคืน)
public string Text
{
get { return this._text; }
set { this._text = value; }
}
private string _text;
คุณสมบัติมูลค่า
VerticalOffset
รับหรือวางค่าธรรมเนียมแนวตั้ง
public float VerticalOffset
{
get;
set;
}
คุณสมบัติมูลค่า
Width
ได้รับความกว้างเดิมของไอคอนไฟล์ที่รวม
public float Width
{
get;
}
คุณสมบัติมูลค่า
Methods
ได้รับการยอมรับ (DocumentVisitor)
ยินดีต้อนรับผู้เข้าชมของ node
public override void Accept(DocumentVisitor visitor)
{
}
Parameters
visitor
DocumentVisitor
วัตถุของชั้นที่มาจาก Aspose.Note.DocumentVisitor