Table of Contents

Class TextProjectItem

Namespace
Loehnert.Lisrt.Scripting.Project
Assembly
Loehnert.Lisrt.Scripting.dll

Project item for a text file.

public class TextProjectItem : PropertyChangedBase, INotifyPropertyChangedEx, IProjectItem, INotifyPropertyChanged, ICanBeRenamed, ICanBeDeleted, IIsPartOfFileSystem, IByteSerializable
Inheritance
PropertyChangedBase
TextProjectItem
Implements
INotifyPropertyChangedEx
Inherited Members
PropertyChangedBase.Refresh()
PropertyChangedBase.IsNotifying
PropertyChangedBase.PropertyChanged
Extension Methods

Constructors

TextProjectItem(string)

Initializes a new instance of the TextProjectItem class.

public TextProjectItem(string name)

Parameters

name string

Name 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

Uri

Name

Gets the file name with extension.

public string Name { get; }

Property Value

string

Parent

Gets or sets the parent project item.

[DoNotTrack]
public ICompositeProjectItem Parent { get; set; }

Property Value

ICompositeProjectItem

Path

Gets the full path to the file on the file system.

public virtual string Path { get; }

Property Value

string

Text

Gets or sets the text of the file.

public string Text { get; set; }

Property Value

string

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

data byte[]

byte[] representation of the object.

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 string

New 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

Event Type

EventHandler<CancelEventArgs>