Class EmptyPythonItemTemplate
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
FileExtension
Gets the 'py' file extension.
public string FileExtension { get; }
Property Value
Icon
Gets a icon for a python file.
public virtual Uri Icon { get; }
Property Value
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
IProjectItemItem 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
stringName for the new item without extension.
parent
IProjectItemParent 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
stringNew item name.
parent
IProjectItemParent 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
stringThe new name.
parent
IProjectItemThe parent item.
Returns
- IEnumerable<ValidationResult>
An enumeration of validation results.