Exemplo n.º 1
0
 public DragDropActionBase(IVidgetBackend backend, ICamera camera)
     : this()
 {
     this.Backend = backend;
     this.Camera  = camera;
     SetDragTarget();
 }
Exemplo n.º 2
0
 public DragDropCatcher(T baseAction, IVidgetBackend backend) : base()
 {
     this.Priority   = baseAction.Priority;
     this.backend    = backend;
     this.baseAction = baseAction;
     this.Dragging   = false;
 }
Exemplo n.º 3
0
        public static FrameworkElement ToWpf(this IVidgetBackend backend)
        {
            var vb = backend as IWpfBackend;

            if (vb != null)
            {
                return(vb.Control);
            }
            var xb = backend as Limaki.View.XwtBackend.IXwtBackend;

            if (xb != null && ((Xwt.Backends.IFrontend)xb.Widget).Backend is Xwt.WPFBackend.WidgetBackend)
            {
                return(((Xwt.WPFBackend.WidgetBackend)((Xwt.Backends.IFrontend)xb.Widget).Backend).Widget);
            }

            var widget = backend as Xwt.Widget;

            if (widget != null)
            {
                var wpfBackend = widget.GetBackend() as Xwt.WPFBackend.WidgetBackend;
                if (wpfBackend != null)
                {
                    return(Xwt.WPFBackend.WidgetBackend.GetFrameworkElement(wpfBackend));
                }
            }

            return(backend as FrameworkElement);
        }
Exemplo n.º 4
0
        public static FrameworkElement GetFrameworkElement(this IVidgetBackend vidgetBackend)
        {
            var backend = vidgetBackend as FrameworkElement;

            if (backend != null)
            {
                return(backend);
            }
            var widget = vidgetBackend as Xwt.Widget;

            if (widget != null)
            {
                var wpfBackend = widget.GetBackend() as Xwt.WPFBackend.WidgetBackend;
                if (wpfBackend != null)
                {
                    backend = Xwt.WPFBackend.WidgetBackend.GetFrameworkElement(wpfBackend);
                }
            }
            else
            {
                var wpfBackend = vidgetBackend as IWpfBackend;
                if (wpfBackend != null)
                {
                    return(wpfBackend.Control);
                }
            }
            return(backend);
        }
Exemplo n.º 5
0
 public static void ForewardDragOver(IMouseAction baseAction, IVidgetBackend backend, DragOverEventArgs e)
 {
     if (baseAction.Enabled)
     {
         var pt = e.Position;
         baseAction.OnMouseMove(new MouseActionEventArgs(MouseActionButtons.None, ModifierKeys.None, 0, pt.X, pt.Y, 0));
     }
 }
Exemplo n.º 6
0
        public static Widget ToXwt(this IVidgetBackend backend)
        {
            var vb = backend as IXwtBackend;

            if (vb != null)
            {
                return(vb.Widget);
            }
            return(backend as Widget);
        }
Exemplo n.º 7
0
        public static SWF.Control ToSwf(this IVidgetBackend item)
        {
            var swfBackend = item as ISwfBackend;

            if (swfBackend != null)
            {
                return(swfBackend.Control);
            }
            return(item as SWF.Control);
        }
Exemplo n.º 8
0
        public static Widget ToGtk(this IVidgetBackend backend)
        {
            var vb = backend as IGtkBackend;

            if (vb != null)
            {
                return(vb.Widget);
            }
            var xb = backend as Limaki.View.XwtBackend.IXwtBackend;

            if (xb != null && ((Xwt.Backends.IFrontend)xb.Widget).Backend is Xwt.GtkBackend.WidgetBackend)
            {
                return(((Xwt.GtkBackend.WidgetBackend)((Xwt.Backends.IFrontend)xb.Widget).Backend).Widget);
            }

            return(backend as Widget);
        }
Exemplo n.º 9
0
        public bool IsSameApp(IVidgetBackend a, IVidgetBackend b)
        {
            var control     = a as Control;
            var thisControl = b as Control;

            if (control != null)
            {
                Form form    = control.FindForm();
                bool sameApp = false;
                foreach (Form iForm in Application.OpenForms)
                {
                    if (iForm == form)
                    {
                        sameApp = true;
                        break;
                    }
                }
                return(sameApp);
            }
            return(false);
        }
Exemplo n.º 10
0
 public DragDropBackendHandler(IVidgetBackend backend)
 {
     this.Backend = backend as System.Windows.Forms.Control;
 }
Exemplo n.º 11
0
 public DragDropMouseBackendHandler(IVidgetBackend widget) : base(widget)
 {
 }
Exemplo n.º 12
0
 public DragDropMouseBackendHandler(IVidgetBackend backend) : base(backend)
 {
 }
Exemplo n.º 13
0
 public virtual void SetContent(IVidget value)
 {
     Content = value.Backend;
 }
Exemplo n.º 14
0
 public VisualsDragDropAction(Func <IGraphScene <IVisual, IVisualEdge> > sceneHandler, IVidgetBackend backend, ICamera camera, IGraphSceneLayout <IVisual, IVisualEdge> layout)
     : base(backend, camera)
 {
     this.SceneHandler = sceneHandler;
     this.Layout       = layout;
 }
Exemplo n.º 15
0
 public DragDropBackendHandler(IVidgetBackend backend)
 {
     this.Backend = backend;
 }
Exemplo n.º 16
0
 public DragDropBackendHandler(IVidgetBackend widget)
 {
     this.Widget = widget as Widget;
 }