本文整理匯總了C#中MonoDevelop.Ide.Gui.TextEditor.PointToLocation方法的典型用法代碼示例。如果您正苦於以下問題:C# TextEditor.PointToLocation方法的具體用法?C# TextEditor.PointToLocation怎麽用?C# TextEditor.PointToLocation使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類MonoDevelop.Ide.Gui.TextEditor
的用法示例。
在下文中一共展示了TextEditor.PointToLocation方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: AssemblyBrowserWidget
public AssemblyBrowserWidget ()
{
this.Build ();
buttonBack = new Gtk.Button (ImageService.GetImage ("md-breadcrumb-prev", Gtk.IconSize.Menu));
buttonBack.Clicked += OnNavigateBackwardActionActivated;
buttonForeward = new Gtk.Button (ImageService.GetImage ("md-breadcrumb-next", Gtk.IconSize.Menu));
buttonForeward.Clicked += OnNavigateForwardActionActivated;
comboboxVisibilty = ComboBox.NewText ();
comboboxVisibilty.InsertText (0, GettextCatalog.GetString ("Only public members"));
comboboxVisibilty.InsertText (1, GettextCatalog.GetString ("All members"));
comboboxVisibilty.Active = 0;
comboboxVisibilty.Changed += delegate {
TreeView.PublicApiOnly = comboboxVisibilty.Active == 0;
FillInspectLabel ();
};
searchentry1 = new MonoDevelop.Components.SearchEntry ();
searchentry1.Ready = true;
searchentry1.HasFrame = true;
searchentry1.WidthRequest = 200;
searchentry1.Visible = true;
searchentry1.EmptyMessage = GettextCatalog.GetString ("Search for types or members");
searchentry1.InnerEntry.Changed += SearchEntryhandleChanged;
CheckMenuItem checkMenuItem = this.searchentry1.AddFilterOption (0, GettextCatalog.GetString ("Types"));
checkMenuItem.Active = true;
checkMenuItem.Toggled += delegate {
if (checkMenuItem.Active) {
searchMode = AssemblyBrowserWidget.SearchMode.Type;
CreateColumns ();
StartSearch ();
}
};
CheckMenuItem checkMenuItem1 = this.searchentry1.AddFilterOption (1, GettextCatalog.GetString ("Members"));
checkMenuItem1.Toggled += delegate {
if (checkMenuItem1.Active) {
searchMode = AssemblyBrowserWidget.SearchMode.Member;
CreateColumns ();
StartSearch ();
}
};
languageCombobox = Gtk.ComboBox.NewText ();
//languageCombobox.AppendText (GettextCatalog.GetString ("Summary"));
languageCombobox.AppendText (GettextCatalog.GetString ("IL"));
languageCombobox.AppendText (GettextCatalog.GetString ("C#"));
languageCombobox.Active = Math.Min (1, PropertyService.Get ("AssemblyBrowser.InspectLanguage", 1));
languageCombobox.Changed += LanguageComboboxhandleChanged;
loader = new CecilLoader (true);
loader.IncludeInternalMembers = true;
TreeView = new AssemblyBrowserTreeView (new NodeBuilder[] {
new ErrorNodeBuilder (),
new ProjectNodeBuilder (this),
new AssemblyNodeBuilder (this),
new ModuleReferenceNodeBuilder (),
new AssemblyReferenceNodeBuilder (this),
//new AssemblyReferenceFolderNodeBuilder (this),
new AssemblyResourceFolderNodeBuilder (),
new ResourceNodeBuilder (),
new NamespaceBuilder (this),
new DomTypeNodeBuilder (this),
new DomMethodNodeBuilder (this),
new DomFieldNodeBuilder (this),
new DomEventNodeBuilder (this),
new DomPropertyNodeBuilder (this),
new BaseTypeFolderNodeBuilder (this),
new BaseTypeNodeBuilder (this)
}, new TreePadOption [0]);
TreeView.Tree.Selection.Mode = Gtk.SelectionMode.Single;
TreeView.Tree.CursorChanged += HandleCursorChanged;
TreeView.ShadowType = ShadowType.None;
TreeView.BorderWidth = 1;
TreeView.ShowBorderLine = false;
TreeView.Zoom = 1.0;
treeViewPlaceholder.Add (TreeView);
// this.descriptionLabel.ModifyFont (Pango.FontDescription.FromString ("Sans 9"));
// this.documentationLabel.ModifyFont (Pango.FontDescription.FromString ("Sans 12"));
// this.documentationLabel.ModifyBg (Gtk.StateType.Normal, new Gdk.Color (255, 255, 225));
// this.documentationLabel.Wrap = true;
var options = new MonoDevelop.Ide.Gui.CommonTextEditorOptions () {
ShowFoldMargin = false,
ShowIconMargin = false,
ShowLineNumberMargin = false,
HighlightCaretLine = true,
};
inspectEditor = new TextEditor (new TextDocument (), options);
inspectEditor.ButtonPressEvent += HandleInspectEditorButtonPressEvent;
this.inspectEditor.Document.ReadOnly = true;
// this.inspectEditor.Document.SyntaxMode = new Mono.TextEditor.Highlighting.MarkupSyntaxMode ();
this.inspectEditor.TextViewMargin.GetLink = delegate(Mono.TextEditor.MarginMouseEventArgs arg) {
var loc = inspectEditor.PointToLocation (arg.X, arg.Y);
int offset = inspectEditor.LocationToOffset (loc);
//.........這裏部分代碼省略.........