Class TextProjectItem
Project item for a text file.
public class TextProjectItem : PropertyChangedBase, INotifyPropertyChangedEx, IProjectItem, INotifyPropertyChanged, ICanBeRenamed, ICanBeDeleted, IIsPartOfFileSystem, IByteSerializable
- Inheritance
-
PropertyChangedBaseTextProjectItem
- Implements
-
INotifyPropertyChangedEx
- Inherited Members
-
PropertyChangedBase.Refresh()PropertyChangedBase.IsNotifyingPropertyChangedBase.PropertyChanged
- Extension Methods
Constructors
TextProjectItem(string)
Initializes a new instance of the TextProjectItem class.
public TextProjectItem(string name)
Parameters
name
stringName of the file usually with extension.
Exceptions
- ArgumentNullException
Thrown when
name
is null or empty.
Properties
Icon
Gets or sets the default icon for a file.
public virtual Uri Icon { get; set; }
Property Value
Name
Gets the file name with extension.
public string Name { get; }
Property Value
Parent
Gets or sets the parent project item.
[DoNotTrack]
public ICompositeProjectItem Parent { get; set; }
Property Value
Path
Gets the full path to the file on the file system.
public virtual string Path { get; }
Property Value
Text
Gets or sets the text of the file.
public string Text { get; set; }
Property Value
Methods
Delete()
Deletes the project item at the path.
public void Delete()
Exceptions
- InvalidOperationException
Thrown when Parent is null.
FromBytes(byte[])
Populates an object from a byte[].
public void FromBytes(byte[] data)
Parameters
Exceptions
- NotImplementedException
Always thrown.
LoadFromFile()
Loads the Text from the file.
public void LoadFromFile()
Rename(string)
Renames the project item.
public void Rename(string name)
Parameters
name
stringNew name for the item.
Exceptions
- ArgumentNullException
Thrown when
name
is null or empty.
Save()
Saves the Text to the file.
public void Save()
ToBytes()
Retrieves a byte[] representation of the name and file stream.
public byte[] ToBytes()
Returns
- byte[]
Bytes representing the instance.
Events
TextIsReloading
Occurs before Text is reloaded.
public event EventHandler<CancelEventArgs> TextIsReloading