tailieunhanh - Developing Visual Studio .NET Macros and Add-Ins phần 7

Khi số tiền thu được vĩ mô, so sánh đối tượng EditPoint bắt đầu để các đối tượng EditPoint cuối, sử dụng các phương pháp lessthan. Phương pháp này so sánh các vị trí trong tài liệu, và nếu đối tượng trước đó trong tài liệu hơn so với các tham số (có nghĩa là, nếu điểm bắt đầu là ít hơn so với điểm kết thúc), chức năng trả về True. | Programming the Document and User Interface Objects 221 After calls to LineDown and StartOfLine the EditPoint changed but the original highlighted text in the document did not. By calling CreateEditPoint you are effectively creating an object that is disconnected from the original selection. As the macro proceeds it compares the start EditPoint object to the end EditPoint object using the LessThan method. This method compares the positions within the document and if the object is earlier in the document than the parameter that is if the start point is less than the end point the function returns True. You also have at your disposal GreaterThan and EqualTo functions which are members of EditPoint TextPoint and VirtualPoint. There is really little difference between a TextPoint and a VirtualPoint except that a VirtualPoint can appear at the very end of a line representing the whitespace to the right of a line. Working with Multiple Windows and Panes In Visual Studio .NET the IDE user can have multiple windows open each containing a copy of the same source code file. Additionally the user can split each window vertically into two panes allowing two separate views of the same file. Changes to a document affect not only the current pane or window but all panes and windows containing the same document. Such changes include undo and redo actions. However each pane and window maintains its own insertion point and highlighted text. You can highlight text in one pane while highlighting separate text in another pane or window for the same document. Similarly you can have the insertion point at one place in one pane or window and in another place within the same document but in another pane or window. When you have multiple windows showing the same document the object corresponds to the window that is active. Further if the windows have multiple panes the object will correspond to the pane that is active. The following macro creates a new