Ejemplo n.º 1
0
		public InsertBugAction (Gtk.TextIter start,
		                        string id,
		                        Gtk.TextBuffer buffer,
		                        BugzillaLink tag)
		{
			Tag = tag;
			Id = id;

			Offset = start.Offset;
		}
Ejemplo n.º 2
0
        public InsertBugAction(Gtk.TextIter start,
                               string id,
                               Gtk.TextBuffer buffer,
                               BugzillaLink tag)
        {
            Tag = tag;
            Id  = id;

            Offset = start.Offset;
        }
Ejemplo n.º 3
0
        bool InsertBug(int x, int y, string uri, int id)
        {
            try {
                BugzillaLink link_tag = (BugzillaLink)
                                        Note.TagTable.CreateDynamicTag(BugzillaLinkTagName);
                link_tag.BugUrl = uri;

                // Place the cursor in the position where the uri was
                // dropped, adjusting x,y by the TextView's VisibleRect.
                Gdk.Rectangle rect = Window.Editor.VisibleRect;
                x = x + rect.X;
                y = y + rect.Y;
                Gtk.TextIter cursor = Window.Editor.GetIterAtLocation(x, y);
                Buffer.PlaceCursor(cursor);

                Buffer.Undoer.AddUndoAction(new InsertBugAction(cursor, id.ToString(), Buffer, link_tag));

                Gtk.TextTag[] tags = { link_tag };
                Buffer.InsertWithTags(ref cursor, id.ToString(), tags);
                return(true);
            } catch {
                return(false);
            }
        }