Table of Contents

Class EmptyPythonItemTemplate

Namespace
Loehnert.Lisrt.Scripting.Python
Assembly
Loehnert.Lisrt.Scripting.dll

Template for a empty python file.

[Export(typeof(IProjectItemTemplate))]
public class EmptyPythonItemTemplate : IProjectItemTemplate
Inheritance
EmptyPythonItemTemplate
Implements
Inherited Members

Properties

Description

Gets a translated description.

public virtual string Description { get; }

Property Value

string

FileExtension

Gets the 'py' file extension.

public string FileExtension { get; }

Property Value

string

Icon

Gets a icon for a python file.

public virtual Uri Icon { get; }

Property Value

Uri

Methods

CanAddToItem(IProjectItem)

Gets a value indicating whether the python project item can be added to another project item.

public bool CanAddToItem(IProjectItem item)

Parameters

item IProjectItem

Item where the template should be added.

Returns

bool

True if it can be added to this item.

CreateAndAddItem(string, IProjectItem)

Creates a new IProjectItem.

public virtual IProjectItem CreateAndAddItem(string name, IProjectItem parent)

Parameters

name string

Name for the new item without extension.

parent IProjectItem

Parent for the new item.

Returns

IProjectItem

A TextProjectItem with FileExtension name and specific icon.

Exceptions

ArgumentNullException

Thrown when name is null or empty.

ArgumentException

Thrown when name contains an invalid file name char or has an extension.

InvalidOperationException

Thrown when parent is not assignable from ICanAddProjectItem.

GetNewPath(string, IProjectItem)

Gets the path for a new item.

protected static string GetNewPath(string name, IProjectItem parent)

Parameters

name string

New item name.

parent IProjectItem

Parent of the new item.

Returns

string

A path to a object with name name.

ValidateNewName(string, IProjectItem)

Gets the validation results of the new name of the item.

public IEnumerable<ValidationResult> ValidateNewName(string newName, IProjectItem parent)

Parameters

newName string

The new name.

parent IProjectItem

The parent item.

Returns

IEnumerable<ValidationResult>

An enumeration of validation results.