1

我发现了以下

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

在 PowerGui 2.4 脚本编辑器中确定光标所在的行。

但我没有找到任何东西来获得专栏。真的失踪了吗?

提出这样一个问题的最佳地点在哪里?


是的,目前该属性称为 CaretCharacter。但为什么他们称它为 CaretCharacter 而不是 CaretColumn?

4

2 回答 2

1

这将给出光标所在的列:

[Quest.PowerGUI.SDK.ScriptEditorFactory]::CurrentInstance.CurrentDocumentWindow.Document.CaretCharacter
于 2011-06-20T12:50:41.277 回答
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;}
于 2011-06-20T12:56:08.907 回答