Ejemplo n.º 1
0
Archivo: Window.cs Proyecto: MrJoe/lat
        void OnSearchExport(object o, SearchResultExportEventArgs args)
        {
            TreeIter iter;

            if (!serverComboBox.GetActiveIter(out iter))
            {
                return;
            }

            string profileName = (string)serverComboBox.Model.GetValue(iter, 0);

            Connection conn = Global.Connections [profileName];

            if (conn == null)
            {
                return;
            }

            if (args.IsDND)
            {
                string data = null;
                Util.ExportData(conn, args.DN, out data);
                args.Data = data;
            }
            else
            {
                Util.ExportData(conn, mainWindow, args.DN);
            }
        }
Ejemplo n.º 2
0
        void OnSearchDragDataGet(object o, DragDataGetArgs args)
        {
            Gtk.TreeModel model;
            Gtk.TreeIter  iter;

            if (!this.Selection.GetSelected(out model, out iter))
            {
                return;
            }

            string dn = (string)model.GetValue(iter, 0);

            SearchResultExportEventArgs myargs = new SearchResultExportEventArgs(dn, true);

            if (Export != null)
            {
                Export(this, myargs);
            }

            if (myargs.Data == null)
            {
                return;
            }

            Atom[] targets = args.Context.Targets;

            args.SelectionData.Set(targets[0], 8, System.Text.Encoding.UTF8.GetBytes(myargs.Data));
        }
Ejemplo n.º 3
0
        void OnExportActivate(object o, EventArgs args)
        {
            Gtk.TreeModel model;
            Gtk.TreeIter  iter;

            if (!this.Selection.GetSelected(out model, out iter))
            {
                return;
            }

            string dn = (string)model.GetValue(iter, 0);

            SearchResultExportEventArgs myargs = new SearchResultExportEventArgs(dn, false);

            if (Export != null)
            {
                Export(this, myargs);
            }
        }
Ejemplo n.º 4
0
        void OnSearchDragDataGet(object o, DragDataGetArgs args)
        {
            Gtk.TreeModel model;
            Gtk.TreeIter iter;

            if (!this.Selection.GetSelected (out model, out iter))
                return;

            string dn = (string) model.GetValue (iter, 0);

            SearchResultExportEventArgs myargs = new SearchResultExportEventArgs (dn, true);

            if (Export != null)
                Export (this, myargs);

            if (myargs.Data == null)
                return;

            Atom[] targets = args.Context.Targets;

            args.SelectionData.Set (targets[0], 8, System.Text.Encoding.UTF8.GetBytes (myargs.Data));
        }
Ejemplo n.º 5
0
        void OnExportActivate(object o, EventArgs args)
        {
            Gtk.TreeModel model;
            Gtk.TreeIter iter;

            if (!this.Selection.GetSelected (out model, out iter))
                return;

            string dn = (string) model.GetValue (iter, 0);

            SearchResultExportEventArgs myargs = new SearchResultExportEventArgs (dn, false);

            if (Export != null)
                Export (this, myargs);
        }