OleObject Class |
Namespace: Aspose.Tasks
The OleObject type exposes the following members.
| Name | Description | |
|---|---|---|
| ApplicationName |
Gets the application name to open the embedded object with.
| |
| Content |
Gets the embedded file's data; null if no data was embedded.
| |
| DisplayAsIcon |
Gets a flag indicating that OLE object should be shown either as an icon or as its regular picture.
| |
| FileFormat |
Gets the file format of the embedded object.
| |
| FullPath |
Gets the full path of the inserted object.
| |
| Id |
Gets the object id.
| |
| Label |
Gets the label of the inserted object.
| |
| Linked |
Gets a value indicating whether the project file contains only a link to the actual data stored at the link source.
| |
| Name |
Gets the name of the instance of the OleObject class.
| |
| TemporaryFile |
Gets the path to the temporary file of the inserted object.
| |
| View |
Gets the instance of the View class the inserted object belongs to.
|
| Name | Description | |
|---|---|---|
| Equals | (Inherited from Object.) | |
| Finalize | (Inherited from Object.) | |
| GetHashCode | (Inherited from Object.) | |
| GetType | (Inherited from Object.) | |
| MemberwiseClone | (Inherited from Object.) | |
| ToString | (Inherited from Object.) |
[Test] public void WorkWithOleObject() { var images = new Project(DataDir + "TaskImage2010.mpp"); List<OleObject> oleObjects = images.OleObjects.ToList(); Console.WriteLine("Ole Objects Count: " + oleObjects.Count); foreach (var oleObject in oleObjects) { Console.WriteLine(" Id: " + oleObject.Id); Console.WriteLine(" Name: " + oleObject.Name); Console.WriteLine(" DisplayAsIcon: " + oleObject.DisplayAsIcon); Console.WriteLine(" Application Name: " + oleObject.ApplicationName); Console.WriteLine(" File Format: " + oleObject.FileFormat); Console.WriteLine(" Label: " + oleObject.Label); Console.WriteLine(" Full Path: " + oleObject.FullPath); Console.WriteLine(" Is Linked: " + oleObject.Linked); Console.WriteLine(" View Name: " + oleObject.View.Name); Console.WriteLine(" Content (first 10 bytes): " + this.Get10Bytes(oleObject)); } } private string Get10Bytes(OleObject oleObject) { byte[] bytes = oleObject.Content; var chunk = new byte[10]; Array.Copy(bytes, chunk, 10); var builder = new StringBuilder(); foreach (var b in chunk) { builder.Append(b + ", "); } builder.Remove(builder.Length - 3, 1); return builder.ToString(); }