コード例 #1
0
 public DragDropActionBase(IVidgetBackend backend, ICamera camera)
     : this()
 {
     this.Backend = backend;
     this.Camera  = camera;
     SetDragTarget();
 }
コード例 #2
0
 public DragDropCatcher(T baseAction, IVidgetBackend backend) : base()
 {
     this.Priority   = baseAction.Priority;
     this.backend    = backend;
     this.baseAction = baseAction;
     this.Dragging   = false;
 }
コード例 #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);
        }
コード例 #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);
        }
コード例 #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));
     }
 }
コード例 #6
0
        public static Widget ToXwt(this IVidgetBackend backend)
        {
            var vb = backend as IXwtBackend;

            if (vb != null)
            {
                return(vb.Widget);
            }
            return(backend as Widget);
        }
コード例 #7
0
ファイル: BackendExtensions.cs プロジェクト: git-thinh/limada
        public static SWF.Control ToSwf(this IVidgetBackend item)
        {
            var swfBackend = item as ISwfBackend;

            if (swfBackend != null)
            {
                return(swfBackend.Control);
            }
            return(item as SWF.Control);
        }
コード例 #8
0
ファイル: GtkBackendHelper.cs プロジェクト: git-thinh/limada
        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);
        }
コード例 #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);
        }
コード例 #10
0
 public DragDropBackendHandler(IVidgetBackend backend)
 {
     this.Backend = backend as System.Windows.Forms.Control;
 }
コード例 #11
0
 public DragDropMouseBackendHandler(IVidgetBackend widget) : base(widget)
 {
 }
コード例 #12
0
 public DragDropMouseBackendHandler(IVidgetBackend backend) : base(backend)
 {
 }
コード例 #13
0
ファイル: VindowBackend.cs プロジェクト: git-thinh/limada
 public virtual void SetContent(IVidget value)
 {
     Content = value.Backend;
 }
コード例 #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;
 }
コード例 #15
0
 public DragDropBackendHandler(IVidgetBackend backend)
 {
     this.Backend = backend;
 }
コード例 #16
0
 public DragDropBackendHandler(IVidgetBackend widget)
 {
     this.Widget = widget as Widget;
 }