Class AttachedFile

Class AttachedFile

Pôvodný názov: Aspose.Note Zhromaždenie: Aspose.Note.dll (25.4.0)

Predstavuje pripojený súbor.

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

Z dedičných členov

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

Ukáže, ako získať obsah pripojeného súboru.

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);
           }
       }
   }

Ukázať, ako pridať súbor do dokumentu pomocou priečinka.

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);

Ukáže, ako pridať súbor z prúdu do dokumentu.

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

Príslušenstvo pre String (string)

Initalizuje novú inštanciu triedy Aspose.Note.AttachedFile.

public AttachedFile(string path)
   {
   }

Parameters

path string

Stránka, ktorá obsahuje cestu do súboru, z ktorého vytvoriť Aspose.Note.AttachedFile.

AttachedFile (string, Stream a ImageFormat)

Initalizuje novú inštanciu triedy Aspose.Note.AttachedFile.

public AttachedFile(string path, Stream icon, ImageFormat iconFormat)
   {
   }

Parameters

path string

Stránka, ktorá obsahuje cestu do súboru, z ktorého vytvoriť Aspose.Note.AttachedFile.

icon Stream

Ikon pre pripojený súbor.

iconFormat ImageFormat

Formát pridanej ikony súboru.

Príslušenstvo (string a stream)

Initalizuje novú inštanciu triedy Aspose.Note.AttachedFile.

public AttachedFile(string fileName, Stream attachedFileStream)
   {
   }

Parameters

fileName string

Názov pripojeného súboru.

attachedFileStream Stream

Stream, ktorý obsahuje pripojené súborové bajty.

AttachedFile (string, Stream, stream, ImageFormat)

Initalizuje novú inštanciu triedy Aspose.Note.AttachedFile.

public AttachedFile(
       string fileName,
       Stream attachedFileStream,
       Stream icon,
       ImageFormat iconFormat)
   {
   }

Parameters

fileName string

Názov pripojeného súboru.

attachedFileStream Stream

Stream, ktorý obsahuje pripojené súborové bajty.

icon Stream

Ikon pre pripojený súbor.

iconFormat ImageFormat

Formát pridanej ikony súboru.

Príspevok v téme()

Initalizuje novú inštanciu triedy Aspose.Note.AttachedFile.

public AttachedFile()
   {
   }

Properties

Alignment

Dostane alebo nastaví zosúladenie.

public HorizontalAlignment Alignment
   {
      get;
      set;
   }

Hodnota nehnuteľnosti

HorizontalAlignment

AlternativeTextDescription

Dostane alebo nastaví telo alternatívny text pre ikonu pripojeného súboru.

public string AlternativeTextDescription
   {
      get;
      set;
   }

Hodnota nehnuteľnosti

string

AlternativeTextTitle

Získava alebo nastaví názov alternatívneho textu pre ikonu pripojeného súboru.

public string AlternativeTextTitle
   {
      get;
      set;
   }

Hodnota nehnuteľnosti

string

Bytes

Získava binárne údaje pre vstavaný súbor.

public byte[] Bytes
   {
      get;
   }

Hodnota nehnuteľnosti

byte []

Examples

Ukáže, ako získať obsah pripojeného súboru.

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

Dostane rozšírenie vloženého súboru.

public string Extension
   {
      get;
   }

Hodnota nehnuteľnosti

string

FileName

Získa názov vloženého súboru.

public string FileName
   {
      get;
   }

Hodnota nehnuteľnosti

string

FilePath

Získajte cestu k pôvodnému súboru.

public string FilePath
   {
      get;
   }

Hodnota nehnuteľnosti

string

Height

Získava pôvodnú výšku vstavaného ikony súboru.

public float Height
   {
      get;
   }

Hodnota nehnuteľnosti

float

HorizontalOffset

Získajte alebo nastavíte horizontálnu náhradu.

public float HorizontalOffset
   {
      get;
      set;
   }

Hodnota nehnuteľnosti

float

Icon

Získava binárne údaje pre ikonu, ktorá je spojená s vloženým súborom.

public byte[] Icon
   {
      get;
   }

Hodnota nehnuteľnosti

byte []

IconExtension

Získajte rozšírenie ikony.

public string IconExtension
   {
      get;
   }

Hodnota nehnuteľnosti

string

IsPrintout

Získa alebo nastaví hodnotu, ktorá ukazuje, či je zobrazenie súboru tlačené.

public bool IsPrintout
   {
      get;
      set;
   }

Hodnota nehnuteľnosti

bool

IsSizeSetByUser

Dostane alebo nastaví hodnotu, ktorá naznačuje, či je hodnota veľkosti ikony výslovne aktualizovaná používateľom.

public bool IsSizeSetByUser
   {
      get;
      set;
   }

Hodnota nehnuteľnosti

bool

LastModifiedTime

Dostane alebo nastaví poslednú modifikovanú dobu.

public DateTime LastModifiedTime
   {
      get;
      set;
   }

Hodnota nehnuteľnosti

DateTime

MaxHeight

Získajte alebo nastavíte maximálnu výšku na zobrazenie vstavaného ikony súboru.

public float MaxHeight
   {
      get;
      set;
   }

Hodnota nehnuteľnosti

float

MaxWidth

Získajte alebo nastavíte maximálnu šírku na zobrazenie vstavaného ikony súboru.

public float MaxWidth
   {
      get;
      set;
   }

Hodnota nehnuteľnosti

float

ParsingErrorInfo

Získava údaje o chybách, ktoré sa vyskytli počas prístupu k súboru.

public ParsingErrorInfo ParsingErrorInfo
   {
      get;
   }

Hodnota nehnuteľnosti

ParsingErrorInfo

Tags

Získajte zoznam všetkých značiek jedného odseku.

public List<ITag> Tags { get; }

Hodnota nehnuteľnosti

List < ITag >

Text

Obdržíte alebo nastavíte textovú reprezentáciu vloženého súboru. riadok NEMU obsahovať žiadne znaky hodnoty 10 (line feed) alebo 13 (vrátenie nákladu).

public string Text
   {
      get { return this._text; }
      set { this._text = value; }
   }
   private string _text;

Hodnota nehnuteľnosti

string

VerticalOffset

Získajte alebo nastavíte vertikálny offset.

public float VerticalOffset
   {
      get;
      set;
   }

Hodnota nehnuteľnosti

float

Width

Získava pôvodnú šírku vstavaného ikony súboru.

public float Width
   {
      get;
   }

Hodnota nehnuteľnosti

float

Methods

Príjem (Dokument návštevník)

Prijíma návštevníka uzla.

public override void Accept(DocumentVisitor visitor)
   {
   }

Parameters

visitor DocumentVisitor

Objekt triedy je odvodený z Aspose.Note.DocumentVisitor.

 Slovenčina