Class AttachedFile
اسم الفضاء : Aspose.Note تجميع: Aspose.Note.dll (25.4.0)
تمثيل ملف مرفق.
public class AttachedFile : Node, IPageChildNode, IOutlineElementChildNode, ITaggable, INode
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
إظهار كيفية الحصول على محتوى من ملف مرفق.
// The path to the documents directory.
string dataDir = RunExamples.GetDataDir_Attachments();
// Load the document into Aspose.Note.
Document oneFile = new Document(dataDir + "Sample1.one");
// Get a list of attached file nodes
IList<attachedfile> nodes = oneFile.GetChildNodes<attachedfile>();
// Iterate through all nodes
foreach (AttachedFile file in nodes)
{
// Load attached file to a stream object
using (Stream outputStream = new MemoryStream(file.Bytes))
{
// Create a local file
using (Stream fileStream = System.IO.File.OpenWrite(String.Format(dataDir + file.FileName)))
{
// Copy file stream
CopyStream(outputStream, fileStream);
}
}
}</attachedfile></attachedfile>
يظهر كيفية إضافة ملف إلى وثيقة باستخدام مسار الملفات.
// The path to the documents directory.
string dataDir = RunExamples.GetDataDir_Attachments();
// Create an object of the Document class
Document doc = new Document();
// Initialize Page class object
Aspose.Note.Page page = new Aspose.Note.Page(doc);
// Initialize Outline class object
Outline outline = new Outline(doc);
// Initialize OutlineElement class object
OutlineElement outlineElem = new OutlineElement(doc);
// Initialize AttachedFile class object
AttachedFile attachedFile = new AttachedFile(doc, dataDir + "attachment.txt");
// Add attached file
outlineElem.AppendChildLast(attachedFile);
// Add outline element node
outline.AppendChildLast(outlineElem);
// Add outline node
page.AppendChildLast(outline);
// Add page node
doc.AppendChildLast(page);
dataDir = dataDir + "AttachFileByPath_out.one";
doc.Save(dataDir);
يظهر كيفية إضافة ملف من تدفق إلى وثيقة.
// The path to the documents directory.
string dataDir = RunExamples.GetDataDir_Attachments();
// Create an object of the Document class
Document doc = new Document();
// Initialize Page class object
Aspose.Note.Page page = new Aspose.Note.Page(doc);
// Initialize Outline class object
Outline outline = new Outline(doc);
// Initialize OutlineElement class object
OutlineElement outlineElem = new OutlineElement(doc);
using (var stream = File.OpenRead(dataDir + "icon.jpg"))
{
// Initialize AttachedFile class object and also pass its icon path
AttachedFile attachedFile = new AttachedFile(doc, dataDir + "attachment.txt", stream, ImageFormat.Jpeg);
// Add attached file
outlineElem.AppendChildLast(attachedFile);
}
// Add outline element node
outline.AppendChildLast(outlineElem);
// Add outline node
page.AppendChildLast(outline);
// Add page node
doc.AppendChildLast(page);
dataDir = dataDir + "AttachFileAndSetIcon_out.one";
doc.Save(dataDir);
Constructors
AttachedFile(الستار)
يبدأ حالة جديدة من فئة Aspose.Note.AttachedFile.
public AttachedFile(string path)
Parameters
path
string
شريط يحتوي على المسار إلى الملف من أي لإنشاء Aspose.Note.AttachedFile.
AttachedFile(الشريط، البث، ImageFormat)
يبدأ حالة جديدة من فئة Aspose.Note.AttachedFile.
public AttachedFile(string path, Stream icon, ImageFormat iconFormat)
Parameters
path
string
شريط يحتوي على المسار إلى الملف من أي لإنشاء Aspose.Note.AttachedFile.
icon
Stream
أيقونة للملف المرفق.
iconFormat
ImageFormat
شكل من أشكال أيقونة الملف المرفقة.
AttachedFile(الشريط , Stream)
يبدأ حالة جديدة من فئة Aspose.Note.AttachedFile.
public AttachedFile(string fileName, Stream attachedFileStream)
Parameters
fileName
string
اسم الملف المرفق.
attachedFileStream
Stream
تدفق يحتوي على بايتات الملف المرفقة.
AttachedFile(الشريط, Stream, ImageFormat)
يبدأ حالة جديدة من فئة Aspose.Note.AttachedFile.
public AttachedFile(string fileName, Stream attachedFileStream, Stream icon, ImageFormat iconFormat)
Parameters
fileName
string
اسم الملف المرفق.
attachedFileStream
Stream
تدفق يحتوي على بايتات الملف المرفقة.
icon
Stream
أيقونة للملف المرفق.
iconFormat
ImageFormat
شكل من أشكال أيقونة الملف المرفقة.
AttachedFile()
يبدأ حالة جديدة من فئة 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
إظهار كيفية الحصول على محتوى من ملف مرفق.
// The path to the documents directory.
string dataDir = RunExamples.GetDataDir_Attachments();
// Load the document into Aspose.Note.
Document oneFile = new Document(dataDir + "Sample1.one");
// Get a list of attached file nodes
IList<attachedfile> nodes = oneFile.GetChildNodes<attachedfile>();
// Iterate through all nodes
foreach (AttachedFile file in nodes)
{
// Load attached file to a stream object
using (Stream outputStream = new MemoryStream(file.Bytes))
{
// Create a local file
using (Stream fileStream = System.IO.File.OpenWrite(String.Format(dataDir + file.FileName)))
{
// Copy file stream
CopyStream(outputStream, fileStream);
}
}
}</attachedfile></attachedfile>
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
يحصل على قائمة جميع علامات الفقرة.
public List<itag> Tags { get; }
قيمة الممتلكات
Text
يحصل أو يضع تمثيل النص للملف المدمج.السلسلة لا ينبغي أن تحتوي على أي أحرف من القيمة 10 (التغذية الخطية) أو 13 (إرجاع الشحن).
public string Text { get; set; }
قيمة الممتلكات
VerticalOffset
يحصل أو يضع الخصم العمودي.
public float VerticalOffset { get; set; }
قيمة الممتلكات
Width
يحصل على العرض الأصلي من أيقونة الملف المدمج.
public float Width { get; }
قيمة الممتلكات
Methods
Accept(DocumentVisitor)
يقبل زائر العقد.
public override void Accept(DocumentVisitor visitor)
Parameters
visitor
DocumentVisitor
موضوع فئة مشتقة من Aspose.Note.DocumentVisitor.