Class AttachedFile

Class AttachedFile

Nazwa przestrzeń: Aspose.Note Zgromadzenie: Aspose.Note.dll (25.4.0)

Przedstawia załączony plik.

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

Dziedziczeni członkowie

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

Pokaż, jak uzyskać zawartość załączonego pliku.

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

Pokaż, jak dodać plik do dokumentu za pomocą ścieżki pliku.

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

Pokaż, jak dodać plik z strumienia 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

Podręcznik (string )

Inicjalizuje nową instancję klasy Aspose.Note.AttachedFile.

public AttachedFile(string path)
   {
   }

Parameters

path string

Strona, która zawiera ścieżkę do pliku, z którego można utworzyć Aspose.Note.AttachedFile.

AttachedFile (string, strumień, format obrazu)

Inicjalizuje nową instancję klasy Aspose.Note.AttachedFile.

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

Parameters

path string

Strona, która zawiera ścieżkę do pliku, z którego można utworzyć Aspose.Note.AttachedFile.

icon Stream

Ikonę do załączonego pliku.

iconFormat ImageFormat

Format załączonej ikony pliku.

String (string i strumień)

Inicjalizuje nową instancję klasy Aspose.Note.AttachedFile.

public AttachedFile(string fileName, Stream attachedFileStream)
   {
   }

Parameters

fileName string

Nazwa załączonego pliku.

attachedFileStream Stream

Strumień, który zawiera załączone bajty pliku.

AttachedFile (string, Stream, Strum, ImageFormat)

Inicjalizuje nową instancję klasy Aspose.Note.AttachedFile.

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

Parameters

fileName string

Nazwa załączonego pliku.

attachedFileStream Stream

Strumień, który zawiera załączone bajty pliku.

icon Stream

Ikonę do załączonego pliku.

iconFormat ImageFormat

Format załączonej ikony pliku.

Podręcznik ()

Inicjalizuje nową instancję klasy Aspose.Note.AttachedFile.

public AttachedFile()
   {
   }

Properties

Alignment

Dostęp lub ustawienie dostosowania.

public HorizontalAlignment Alignment
   {
      get;
      set;
   }

Wartość nieruchomości

HorizontalAlignment

AlternativeTextDescription

Otrzymuje lub ustawia ciało alternatywny tekst dla ikony załączonego pliku.

public string AlternativeTextDescription
   {
      get;
      set;
   }

Wartość nieruchomości

string

AlternativeTextTitle

Otrzymuje lub ustawia tytuł alternatywnego tekstu dla ikony załączonego pliku.

public string AlternativeTextTitle
   {
      get;
      set;
   }

Wartość nieruchomości

string

Bytes

Otrzymuje dane binarne dla wbudowanego pliku.

public byte[] Bytes
   {
      get;
   }

Wartość nieruchomości

byte [ ]

Examples

Pokaż, jak uzyskać zawartość załączonego pliku.

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

Otrzymuje rozszerzenie wbudowanego pliku.

public string Extension
   {
      get;
   }

Wartość nieruchomości

string

FileName

Otrzymuje nazwę wbudowanego pliku.

public string FileName
   {
      get;
   }

Wartość nieruchomości

string

FilePath

Dostaje drogę do oryginalnego pliku.

public string FilePath
   {
      get;
   }

Wartość nieruchomości

string

Height

Otrzymuje oryginalną wysokość wbudowanej ikony pliku.

public float Height
   {
      get;
   }

Wartość nieruchomości

float

HorizontalOffset

Zostaw lub ustaw horyzontalny odsetek.

public float HorizontalOffset
   {
      get;
      set;
   }

Wartość nieruchomości

float

Icon

Otrzymuje dane binarne dla ikony, która jest powiązana z wbudowanym plikiem.

public byte[] Icon
   {
      get;
   }

Wartość nieruchomości

byte [ ]

IconExtension

Poznaj rozszerzenie ikony.

public string IconExtension
   {
      get;
   }

Wartość nieruchomości

string

IsPrintout

Otrzymuje lub ustawia wartość wskazującą, czy widok pliku jest drukowany.

public bool IsPrintout
   {
      get;
      set;
   }

Wartość nieruchomości

bool

IsSizeSetByUser

Otrzymuje lub ustawia wartość wskazującą, czy wielkość ikony została wyraźnie zaktualizowana przez użytkownika.

public bool IsSizeSetByUser
   {
      get;
      set;
   }

Wartość nieruchomości

bool

LastModifiedTime

Otrzymuje lub ustawia ostatnią zmienioną godzinę.

public DateTime LastModifiedTime
   {
      get;
      set;
   }

Wartość nieruchomości

DateTime

MaxHeight

Otrzymuje lub ustawia maksymalną wysokość, aby wyświetlić wbudowaną ikonę pliku.

public float MaxHeight
   {
      get;
      set;
   }

Wartość nieruchomości

float

MaxWidth

Otrzymuje lub ustawia maksymalną szerokość, aby wyświetlić wbudowaną ikonę pliku.

public float MaxWidth
   {
      get;
      set;
   }

Wartość nieruchomości

float

ParsingErrorInfo

Otrzymuje dane dotyczące błędu, który wystąpił podczas dostępu do pliku.

public ParsingErrorInfo ParsingErrorInfo
   {
      get;
   }

Wartość nieruchomości

ParsingErrorInfo

Tags

Otrzymuje listę wszystkich etykiet paragrafu.

public List<ITag> Tags { get; }

Wartość nieruchomości

List • < ITag >

Text

Plik NIE MOŻE zawierać żadnych znaków wartości 10 (kwas linii) lub 13 (powrót ładowania).

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

Wartość nieruchomości

string

VerticalOffset

Uzyskuje lub ustawia opłatę pionową.

public float VerticalOffset
   {
      get;
      set;
   }

Wartość nieruchomości

float

Width

Otrzymuje oryginalną szerokość wbudowanej ikony pliku.

public float Width
   {
      get;
   }

Wartość nieruchomości

float

Methods

Przyjęcie (DocumentVisitor)

Przyjmuje odwiedzającego węzła.

public override void Accept(DocumentVisitor visitor)
   {
   }

Parameters

visitor DocumentVisitor

Obiekt klasy pochodzi z Aspose.Note.DocumentVisitor.

 Polski