C# Класс RIM.VSNDK_Package.ViewModel

ViewModel is where the interesting portion of the VsTemplate Designer lives. The View binds to an instance of this class. The View binds the various designer controls to the methods derived from IViewModel that get and set values in the XmlModel. The ViewModel and an underlying XmlModel manage how an IVsTextBuffer is shared between the designer and the XML editor (if opened).
Наследование: IViewModel, IDataErrorInfo, INotifyPropertyChanged
Показать файл Открыть проект Примеры использования класса

Private Properties

Свойство Тип Описание
BufferReloaded void
CanEditFile bool
FormatBuffer void
GetParseTree System.Xml.Linq.XDocument
GetSource Microsoft.VisualStudio.Package.Source
GetXmlLanguageService Microsoft.VisualStudio.Package.LanguageService
LoadModelFromXmlModel void
LoadPermissions void
OnUnderlyingEditCompleted void
OnUndoRedoCompleted void
SaveModelToXmlModel void
getImagePath string
getPermissionIcon string
p_OutputDataReceived void

Открытые методы

Метод Описание
AddIcon ( FileInfo icon ) : void
AddIcon ( string iconName ) : void
AddLocalAsset ( string assetPath ) : void
AddSplashScreen ( FileInfo splashScreen ) : void
AddSplashScreen ( string splashScreenName ) : void
CheckPermission ( string identifier ) : void
Close ( ) : void

Close View Model

DeleteIcon ( object iconName ) : void
DeleteLocalAsset ( object asset ) : void
DeleteSplashScreen ( object splashScreenName ) : void
DoIdle ( ) : void

Called on idle time. This is when we check if the designer is out of sync with the underlying text buffer.

EditLocalAsset ( string identifier, bool isPublic, string assetType ) : void
OnSelectChanged ( object p ) : void
UnCheckPermission ( string identifier ) : void
ViewModel ( Microsoft.VisualStudio.Shell.Package pkg, XmlStore xmlStore, XmlModel xmlModel, IServiceProvider provider, IVsTextLines buffer ) : System

Constructor

getAuthor ( ) : string

Get the author ID

getAuthorID ( ) : string

Get the author ID

isPermissionChecked ( string identifier ) : bool
setAuthorInfo ( ) : void

Read the author information from the debug token and update the appropriate boxes.

this ( string columnName ) : string

Защищенные методы

Метод Описание
NotifyPropertyChanged ( string propertyName ) : void

Приватные методы

Метод Описание
BufferReloaded ( object sender, EventArgs e ) : void

BufferReloaded event handler

CanEditFile ( ) : bool

This function asks the QueryEditQuerySave service if it is possible to edit the file. This can result in an automatic checkout of the file and may even prompt the user for permission to checkout the file. If the user says no or the file cannot be edited this returns false.

FormatBuffer ( Microsoft.VisualStudio.Package.Source src ) : void

Reformat the text buffer

GetParseTree ( ) : System.Xml.Linq.XDocument

Get an up to date XML parse tree from the XML Editor.

GetSource ( ) : Microsoft.VisualStudio.Package.Source

Get the XML Editor Source object for this document.

GetXmlLanguageService ( ) : Microsoft.VisualStudio.Package.LanguageService

Get the XML Editor language service

LoadModelFromXmlModel ( ) : void

Load the model from the underlying text buffer.

LoadPermissions ( ) : void

Load the permissions list

OnUnderlyingEditCompleted ( object sender, XmlEditingScopeEventArgs e ) : void

Handle edit scope completion event. This happens when the XML editor buffer decides to update it's XDocument parse tree.

OnUndoRedoCompleted ( object sender, XmlEditingScopeEventArgs e ) : void

Handle undo/redo completion event. This happens when the user invokes Undo/Redo on a buffer edit operation. We need to resync when this happens.

SaveModelToXmlModel ( string undoEntry ) : void

This method is called when it is time to save the designer values to the underlying buffer.

getImagePath ( string imgName ) : string
getPermissionIcon ( string ID ) : string

Given the permission ID return the appropriate Icon

p_OutputDataReceived ( object sender, System e ) : void

On Data Received event handler

Описание методов

AddIcon() публичный Метод

public AddIcon ( FileInfo icon ) : void
icon System.IO.FileInfo
Результат void

AddIcon() публичный Метод

public AddIcon ( string iconName ) : void
iconName string
Результат void

AddLocalAsset() публичный Метод

public AddLocalAsset ( string assetPath ) : void
assetPath string
Результат void

AddSplashScreen() публичный Метод

public AddSplashScreen ( FileInfo splashScreen ) : void
splashScreen System.IO.FileInfo
Результат void

AddSplashScreen() публичный Метод

public AddSplashScreen ( string splashScreenName ) : void
splashScreenName string
Результат void

CheckPermission() публичный Метод

public CheckPermission ( string identifier ) : void
identifier string
Результат void

Close() публичный Метод

Close View Model
public Close ( ) : void
Результат void

DeleteIcon() публичный Метод

public DeleteIcon ( object iconName ) : void
iconName object
Результат void

DeleteLocalAsset() публичный Метод

public DeleteLocalAsset ( object asset ) : void
asset object
Результат void

DeleteSplashScreen() публичный Метод

public DeleteSplashScreen ( object splashScreenName ) : void
splashScreenName object
Результат void

DoIdle() публичный Метод

Called on idle time. This is when we check if the designer is out of sync with the underlying text buffer.
public DoIdle ( ) : void
Результат void

EditLocalAsset() публичный Метод

public EditLocalAsset ( string identifier, bool isPublic, string assetType ) : void
identifier string
isPublic bool
assetType string
Результат void

NotifyPropertyChanged() защищенный Метод

protected NotifyPropertyChanged ( string propertyName ) : void
propertyName string
Результат void

OnSelectChanged() публичный Метод

public OnSelectChanged ( object p ) : void
p object
Результат void

UnCheckPermission() публичный Метод

public UnCheckPermission ( string identifier ) : void
identifier string
Результат void

ViewModel() публичный Метод

Constructor
public ViewModel ( Microsoft.VisualStudio.Shell.Package pkg, XmlStore xmlStore, XmlModel xmlModel, IServiceProvider provider, IVsTextLines buffer ) : System
pkg Microsoft.VisualStudio.Shell.Package
xmlStore XmlStore
xmlModel XmlModel
provider IServiceProvider
buffer IVsTextLines
Результат System

getAuthor() публичный Метод

Get the author ID
public getAuthor ( ) : string
Результат string

getAuthorID() публичный Метод

Get the author ID
public getAuthorID ( ) : string
Результат string

isPermissionChecked() публичный Метод

public isPermissionChecked ( string identifier ) : bool
identifier string
Результат bool

setAuthorInfo() публичный Метод

Read the author information from the debug token and update the appropriate boxes.
public setAuthorInfo ( ) : void
Результат void

this() публичный Метод

public this ( string columnName ) : string
columnName string
Результат string