C# Class 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).
Inheritance: IViewModel, IDataErrorInfo, INotifyPropertyChanged
Afficher le fichier Open project: blackberry/VSPlugin Class Usage Examples

Private Properties

Свойство Type Description
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

Méthodes publiques

Méthode Description
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

Méthodes protégées

Méthode Description
NotifyPropertyChanged ( string propertyName ) : void

Private Methods

Méthode Description
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

Method Details

AddIcon() public méthode

public AddIcon ( FileInfo icon ) : void
icon System.IO.FileInfo
Résultat void

AddIcon() public méthode

public AddIcon ( string iconName ) : void
iconName string
Résultat void

AddLocalAsset() public méthode

public AddLocalAsset ( string assetPath ) : void
assetPath string
Résultat void

AddSplashScreen() public méthode

public AddSplashScreen ( FileInfo splashScreen ) : void
splashScreen System.IO.FileInfo
Résultat void

AddSplashScreen() public méthode

public AddSplashScreen ( string splashScreenName ) : void
splashScreenName string
Résultat void

CheckPermission() public méthode

public CheckPermission ( string identifier ) : void
identifier string
Résultat void

Close() public méthode

Close View Model
public Close ( ) : void
Résultat void

DeleteIcon() public méthode

public DeleteIcon ( object iconName ) : void
iconName object
Résultat void

DeleteLocalAsset() public méthode

public DeleteLocalAsset ( object asset ) : void
asset object
Résultat void

DeleteSplashScreen() public méthode

public DeleteSplashScreen ( object splashScreenName ) : void
splashScreenName object
Résultat void

DoIdle() public méthode

Called on idle time. This is when we check if the designer is out of sync with the underlying text buffer.
public DoIdle ( ) : void
Résultat void

EditLocalAsset() public méthode

public EditLocalAsset ( string identifier, bool isPublic, string assetType ) : void
identifier string
isPublic bool
assetType string
Résultat void

NotifyPropertyChanged() protected méthode

protected NotifyPropertyChanged ( string propertyName ) : void
propertyName string
Résultat void

OnSelectChanged() public méthode

public OnSelectChanged ( object p ) : void
p object
Résultat void

UnCheckPermission() public méthode

public UnCheckPermission ( string identifier ) : void
identifier string
Résultat void

ViewModel() public méthode

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
Résultat System

getAuthor() public méthode

Get the author ID
public getAuthor ( ) : string
Résultat string

getAuthorID() public méthode

Get the author ID
public getAuthorID ( ) : string
Résultat string

isPermissionChecked() public méthode

public isPermissionChecked ( string identifier ) : bool
identifier string
Résultat bool

setAuthorInfo() public méthode

Read the author information from the debug token and update the appropriate boxes.
public setAuthorInfo ( ) : void
Résultat void

this() public méthode

public this ( string columnName ) : string
columnName string
Résultat string