Как определить CaretColumn в редакторе скриптов PowerGUI?

Я нашел следующее

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

определить строку курсора в редакторе скриптов PowerGui 2.4.

Но я не нашел ничего, чтобы получить колонку. Это действительно отсутствует?

И где лучше всего задать такой вопрос?


Да, в настоящее время собственность называется CaretCharacter. Но почему они назвали это CaretCharacter, а не CaretColumn?

2 ответа

Решение

Вот:

[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;}

Это даст столбец курсора:

[Quest.PowerGUI.SDK.ScriptEditorFactory]::CurrentInstance.CurrentDocumentWindow.Document.CaretCharacter
Другие вопросы по тегам