2011-06-19 58 views
1

我發現下面如何確定PowerGUI腳本編輯器中的CaretColumn?

[Quest.PowerGUI.SDK.ScriptEditorFactory]::CurrentInstance.CurrentDocumentWindow.Document.CaretLine 

來確定光標在2.4的PowerGUI腳本編輯器的線。

但我沒有發現任何可以獲得專欄。它真的失蹤了嗎?

哪裏是問這樣一個問題的最佳地點?


是的,目前該屬性被稱爲CaretCharacter。 但是他們爲什麼稱它爲CaretCharacter而不是CaretColumn?

回答

1

這裏是:

[Quest.PowerGUI.SDK.ScriptEditorFactory]::CurrentInstance.CurrentDocumentWindow.Document.CaretCharacter 

你怎麼能自己發現?

$a = [Quest.PowerGUI.SDK.ScriptEditorFactory]::CurrentInstance.CurrentDocumentWindow.Document 
$a |Get-Member 

TypeName: Quest.PowerGUI.SDK.Document 

Name    MemberType Definition                   
----    ---------- ----------                   
Append   Method  System.Void Append(string text)              
EnsureVisible Method  System.Void EnsureVisible(int lineNumber)           
Equals   Method  bool Equals(System.Object obj)              
GetHashCode  Method  int GetHashCode()                 
GetType   Method  type GetType()                  
Insert   Method  System.Void Insert(string text, int lineNumber, int charNumber)      
Select   Method  System.Void Select(int startLine, int startCharacter, int endLine, int endCharacter) 
SetCaretPosition Method  System.Void SetCaretPosition(int lineNumber, int charNumber)       
ToString   Method  string ToString()                 
CaretCharacter Property System.Int32 CaretCharacter {get;set;}            
CaretLine  Property System.Int32 CaretLine {get;set;}             
IsSaved   Property System.Boolean IsSaved {get;}              
Lines   Property Quest.PowerGUI.SDK.LineCollection Lines {get;}          
Path    Property System.String Path {get;}               
SelectedText  Property System.String SelectedText {get;set;}            
Text    Property System.String Text {get;set;} 
1

這將使光標的列:

[Quest.PowerGUI.SDK.ScriptEditorFactory]::CurrentInstance.CurrentDocumentWindow.Document.CaretCharacter