C# Class XSharp.Project.VOEditorPane

Inheritance: Microsoft.VisualStudio.Shell.WindowPane, IVsPersistDocData, IPersistFileFormat, IVsFileChangeEvents, IVsDocDataFileChangeControl, IVsFileBackup, IExtensibleObject, IEditor
Mostra file Open project: X-Sharp/XSharpPublic Class Usage Examples

Protected Properties

Property Type Description
MyExtension string
editorControl VOWEDControl

Private Properties

Property Type Description
CanEditFile bool
Dispose void
GetResourceString string
IExtensibleObject void
IPersistFileFormat int
IPersistFileFormat int
IPersistFileFormat int
IPersistFileFormat int
IPersistFileFormat int
IPersistFileFormat int
IPersistFileFormat int
IVsDocDataFileChangeControl int
IVsFileBackup int
IVsFileBackup int
IVsFileChangeEvents int
IVsFileChangeEvents int
IVsPersistDocData int
IVsPersistDocData int
IVsPersistDocData int
IVsPersistDocData int
IVsPersistDocData int
IVsPersistDocData int
IVsPersistDocData int
IVsPersistDocData int
IsDirtyChangedHandler void
Microsoft int
NotifyDocChanged void
OnFileChangeEvent void
OnSelectionChanged void
PrivateInit void
SetFileChangeNotification int
SetReadOnly void
StatusBarMessageHandler void
SuspendFileChangeNotification int
TriggerSaveHandler void

Public Methods

Method Description
Copy ( ) : int

This function performs the copy operation in the editor.

Cut ( ) : int

This function performs the cut operation in the editor.

Delete ( long unit, long count ) : int

This function performs a delete in the editor.

Paste ( ) : int

This function performs the paste operation in the editor.

VOEditorPane ( XSharpProjectPackage package ) : System

Protected Methods

Method Description
OnClose ( ) : void
_GetClassID ( ) : System.Guid
addCommand ( IMenuCommandService mcs, System.Guid menuGroup, int cmdID, EventHandler commandEvent, EventHandler queryEvent ) : void

Helper function used to add commands using IMenuCommandService

getFormatList ( ) : string
onQueryUnimplemented ( object sender, EventArgs e ) : void
onUnimplemented ( object sender, EventArgs e ) : void
setupCommands ( ) : void

Private Methods

Method Description
CanEditFile ( ) : bool

This function asks to the QueryEditQuerySave service if it is possible to edit the file.

Dispose ( bool disposing ) : void
GetResourceString ( string resourceName ) : string

This method loads a localized string based on the specified resource.

IExtensibleObject ( string Name, IExtensibleObjectSite pParent, Object &ppDisp ) : void

This function is used for Macro playback. Whenever a macro gets played this funtion will be called and then the IEditor functions will be called on the object that ppDisp is set to. Since VOFormEditorPane implements IEditor we will just set it to "this".

IPersistFileFormat ( System.Guid &pClassID ) : int

Returns the class identifier of the editor type

IPersistFileFormat ( int &pfIsDirty ) : int

Determines whether an object has changed since being saved to its current file

IPersistFileFormat ( string strFileName ) : int

Notifies the object that it has concluded the Save transaction

IPersistFileFormat ( string strFileName, int fRemember, uint nFormatIndex ) : int

Save the contents of the editor into the specified file. If doing the save on the same file, we need to suspend notifications for file changes during the save operation.

IPersistFileFormat ( string &pstrFileName, uint &pnFormatIndex ) : int

Returns the path to the object's current working file

IPersistFileFormat ( string filename, uint grfMode, int fReadOnly ) : int

Loads the file content into the editor

IPersistFileFormat ( uint nFormatIndex ) : int

Initialization for the object

IVsDocDataFileChangeControl ( int fIgnore ) : int

Used to determine whether changes to DocData in files should be ignored or not

IVsFileBackup ( int &pbObsolete ) : int

Used to set the backup dirty bit. This bit should be set when the object is modified and cleared on calls to BackupFile and any Save method

IVsFileBackup ( string strBackupFileName ) : int

This method is used to Persist the data to a single file. On a successful backup this should clear up the backup dirty bit

IVsFileChangeEvents ( string pszDirectory ) : int

Notify the editor of the changes made to a directory

IVsFileChangeEvents ( uint cChanges, string rgpszFile, uint rggrfChange ) : int

Notify the editor of the changes made to one or more files

IVsPersistDocData ( ) : int

Close the IVsPersistDocData object

IVsPersistDocData ( System.Guid &pClassID ) : int

Returns the Guid of the editor factory that created the IVsPersistDocData object

IVsPersistDocData ( Microsoft dwSave, string &pbstrMkDocumentNew, int &pfSaveCanceled ) : int

Saves the document data. Before actually saving the file, we first need to indicate to the environment that a file is about to be saved. This is done through the "SVsQueryEditQuerySave" service. We call the "QuerySaveFile" function on the service instance and then proceed depending on the result returned as follows: If result is QSR_SaveOK - We go ahead and save the file and the file is not read only at this point. If result is QSR_ForceSaveAs - We invoke the "Save As" functionality which will bring up the Save file name dialog If result is QSR_NoSave_Cancel - We cancel the save operation and indicate that the document could not be saved by setting the "pfSaveCanceled" flag If result is QSR_NoSave_Continue - Nothing to do here as the file need not be saved

IVsPersistDocData ( int &pfDirty ) : int

Used to determine if the document data has changed since the last time it was saved

IVsPersistDocData ( string pszMkDocument ) : int

Loads the document data from the file specified

IVsPersistDocData ( uint grfFlags ) : int

Reloads the document data

IVsPersistDocData ( uint docCookie, IVsHierarchy pHierNew, uint itemidNew ) : int

Called by the Running Document Table when it registers the document data.

IVsPersistDocData ( uint grfAttribs, IVsHierarchy pHierNew, uint itemidNew, string pszMkDocumentNew ) : int

Renames the document data

IsDirtyChangedHandler ( object o, EventArgs e ) : void
Microsoft ( System.Guid &pClassID ) : int
NotifyDocChanged ( ) : void

Gets an instance of the RunningDocumentTable (RDT) service which manages the set of currently open documents in the environment and then notifies the client that an open document has changed

OnFileChangeEvent ( object sender, System e ) : void

This event is triggered when one of the files loaded into the environment has changed outside of the editor

OnSelectionChanged ( object sender, EventArgs e ) : void
PrivateInit ( XSharpProjectPackage package ) : void

Initialization routine for the Editor. Loads the list of properties for the document which will show up in the properties window

SetFileChangeNotification ( string strFileName, bool fStart ) : int

In this function we inform the shell when we wish to receive events when our file is changed or we inform the shell when we wish not to receive events anymore.

SetReadOnly ( bool _isFileReadOnly ) : void

Used to ReadOnly property for the Rich TextBox and correspondingly update the editor caption

StatusBarMessageHandler ( string cText ) : void
SuspendFileChangeNotification ( string strFileName, int fSuspend ) : int

In this function we suspend receiving file change events for a file or we reinstate a previously suspended file depending on the value of the given fSuspend flag.

TriggerSaveHandler ( object o, EventArgs e ) : void

Method Details

Copy() public method

This function performs the copy operation in the editor.
public Copy ( ) : int
return int

Cut() public method

This function performs the cut operation in the editor.
public Cut ( ) : int
return int

Delete() public method

This function performs a delete in the editor.
public Delete ( long unit, long count ) : int
unit long The type of units that we are going to delete. The two valid options /// for this are TOMWord and TOMCharacter, which are defined in the TOMConstants enumeration.
count long The number of units that we are going to delete. Passing in a negative number /// will be similar to pressing backspace and passing in a positive number will be similar to /// pressing delete.
return int

OnClose() protected method

protected OnClose ( ) : void
return void

Paste() public method

This function performs the paste operation in the editor.
public Paste ( ) : int
return int

VOEditorPane() public method

public VOEditorPane ( XSharpProjectPackage package ) : System
package XSharpProjectPackage Our Package instance.
return System

_GetClassID() protected method

protected _GetClassID ( ) : System.Guid
return System.Guid

addCommand() protected static method

Helper function used to add commands using IMenuCommandService
protected static addCommand ( IMenuCommandService mcs, System.Guid menuGroup, int cmdID, EventHandler commandEvent, EventHandler queryEvent ) : void
mcs IMenuCommandService The IMenuCommandService interface.
menuGroup System.Guid This guid represents the menu group of the command.
cmdID int The command ID of the command.
commandEvent EventHandler An EventHandler which will be called whenever the command is invoked.
queryEvent EventHandler An EventHandler which will be called whenever we want to query the status of /// the command. If null is passed in here then no EventHandler will be added.
return void

getFormatList() protected method

protected getFormatList ( ) : string
return string

onQueryUnimplemented() protected method

protected onQueryUnimplemented ( object sender, EventArgs e ) : void
sender object
e System.EventArgs
return void

onUnimplemented() protected method

protected onUnimplemented ( object sender, EventArgs e ) : void
sender object
e System.EventArgs
return void

setupCommands() protected method

protected setupCommands ( ) : void
return void

Property Details

MyExtension protected_oe property

protected string MyExtension
return string

editorControl protected_oe property

protected VOWEDControl editorControl
return VOWEDControl