コード例 #1
0
ファイル: AssetLister.cs プロジェクト: zparr/ATF
        /// <summary>
        /// Called on drag and drop event
        /// </summary>
        /// <param name="e">Event args</param>
        protected virtual void OnDragDrop(DragEventArgs e)
        {
            IInstancingContext   instancingContext = m_rootAssetFolder.As <IInstancingContext>();
            IEnumerable <object> converted         = ApplicationUtil.Convert(e.Data, instancingContext, m_dataObjectConverters);

            ApplicationUtil.Drop(converted, instancingContext, m_statusService);
        }
コード例 #2
0
ファイル: TreeControlEditor.cs プロジェクト: zoombapup/ATF
        /// <summary>
        /// Called when the underlying tree control raises the DragOver event</summary>
        /// <param name="e">Event args from the tree control's DragOver event</param>
        protected virtual void OnDragOver(DragEventArgs e)
        {
            bool canInsert = false;

            if (TreeControl.DragBetween)
            {
                TreeControl.Node parent, before;
                Point            clientPoint = TreeControl.PointToClient(new Point(e.X, e.Y));
                if (TreeControl.GetInsertionNodes(clientPoint, out parent, out before))
                {
                    canInsert = ApplicationUtil.CanInsertBetween(
                        m_treeControlAdapter.TreeView,
                        parent != null ? parent.Tag : null,
                        before != null ? before.Tag : null,
                        e.Data);
                }
            }
            else
            {
                canInsert = ApplicationUtil.CanInsert(
                    m_treeControlAdapter.TreeView,
                    m_treeControlAdapter.LastHit,
                    e.Data);
            }



            e.Effect = canInsert ? DragDropEffects.Move : DragDropEffects.None;

            // A refresh is required to display the drag-between cue.
            if (TreeControl.ShowDragBetweenCue)
            {
                TreeControl.Invalidate();
            }
        }
コード例 #3
0
ファイル: AssetLister.cs プロジェクト: zparr/ATF
        private void thumbnailControl_DragDrop(object sender, DragEventArgs e)
        {
            m_lastHit = m_currentAssetFolder;
            IInstancingContext   instancingContext = m_rootAssetFolder.As <IInstancingContext>();
            IEnumerable <object> converted         = ApplicationUtil.Convert(e.Data, instancingContext, m_dataObjectConverters);

            ApplicationUtil.Drop(converted, instancingContext, m_statusService);
        }
コード例 #4
0
ファイル: ListViewEditor.cs プロジェクト: zparr/ATF
 /// <summary>
 /// Called when the underlying ListView raises the DragDrop event</summary>
 /// <param name="e">Event args from the ListView's DragDrop event</param>
 protected virtual void OnDragDrop(DragEventArgs e)
 {
     ApplicationUtil.Insert(
         m_listViewAdapter.ListView,
         null,
         e.Data,
         "Drag and Drop".Localize(),
         m_statusService);
 }
コード例 #5
0
ファイル: AssetLister.cs プロジェクト: zparr/ATF
 /// <summary>
 /// Called on mouse up event
 /// </summary>
 /// <param name="e">Event args</param>
 protected virtual void OnMouseUp(MouseEventArgs e) // for tree control on the left pane
 {
     if (e.Button == MouseButtons.Right)
     {
         List <object> commands    = ApplicationUtil.GetPopupCommandTags(m_lastHit, m_contextMenuCommandProviders);
         Point         screenPoint = m_treeControl.PointToScreen(new Point(e.X, e.Y));
         m_commandService.RunContextMenu(commands, screenPoint);
     }
 }
コード例 #6
0
ファイル: ListViewEditor.cs プロジェクト: zparr/ATF
 /// <summary>
 /// Called when the underlying ListView raises the DragOver event</summary>
 /// <param name="e">Event args from the ListView's DragOver event</param>
 protected virtual void OnDragOver(DragEventArgs e)
 {
     if (ApplicationUtil.CanInsert(m_listViewAdapter.ListView, null, e.Data))
     {
         e.Effect = DragDropEffects.Move;
     }
     else
     {
         e.Effect = DragDropEffects.None;
     }
 }
コード例 #7
0
ファイル: AssetLister.cs プロジェクト: zparr/ATF
        /// <summary>
        /// Called on dragging mouse over event
        /// </summary>
        /// <param name="e">Event args</param>
        protected virtual void OnDragOver(DragEventArgs e)
        {
            e.Effect = DragDropEffects.None;
            IInstancingContext instancingContext = m_rootAssetFolder.As <IInstancingContext>();
            IEnumerable        converted         = ApplicationUtil.Convert(e.Data, instancingContext, m_dataObjectConverters);

            if (converted != null)
            {
                e.Effect = DragDropEffects.Move;
            }
        }
コード例 #8
0
ファイル: AssetLister.cs プロジェクト: zparr/ATF
        private void thumbnailControl_DragOver(object sender, DragEventArgs e)
        {
            e.Effect  = DragDropEffects.None;
            m_lastHit = m_currentAssetFolder;
            IInstancingContext instancingContext = m_rootAssetFolder.As <IInstancingContext>();
            IEnumerable        converted         = ApplicationUtil.Convert(e.Data, instancingContext, m_dataObjectConverters);

            if (converted != null)
            {
                e.Effect = DragDropEffects.Move;
            }
        }
コード例 #9
0
        /// <summary>
        /// Method triggered when DragOver event is fired on the TreeListView</summary>
        /// <param name="e">Drag-and-drop event arguments</param>
        protected virtual void OnDragOver(DragEventArgs e)
        {
            bool canInsert = false;

            try
            {
                canInsert = ApplicationUtil.CanInsert(View, LastHit, e.Data);
            }
            finally
            {
                e.Effect = canInsert ? DragDropEffects.Move : DragDropEffects.None;
            }
        }
コード例 #10
0
ファイル: AssetLister.cs プロジェクト: zparr/ATF
        private void thumbnailControl_MouseUp(object sender, MouseEventArgs e)
        {
            IResource asset = null;

            if (e.Button == MouseButtons.Right)
            {
                Point screenPoint;
                Point clientPoint = new Point(e.X, e.Y);
                if (m_thumbnailControl.Visible)
                {
                    asset       = SelectedAsset(m_thumbnailControl, clientPoint);
                    screenPoint = m_thumbnailControl.PointToScreen(clientPoint);
                }
                else
                {
                    asset       = SelectedAsset(m_listView, clientPoint);
                    screenPoint = m_listView.PointToScreen(clientPoint);
                }

                if (asset != null)
                {
                    IResource assetObj = asset as IResource;
                    if (assetObj != null)
                    {
                        List <object> commands = ApplicationUtil.GetPopupCommandTags(assetObj, m_contextMenuCommandProviders);
                        commands.Add(Command.ReloadAsset);
                        commands.Add(Command.UnloadAssets);
                        commands.Add(Command.DetailsView);
                        commands.Add(Command.ThumbnailView);
                        commands.Add(Command.AddExistingAsset);

                        m_commandService.RunContextMenu(commands, screenPoint);
                    }
                }
                else
                {
                    List <object> commands = new List <object>();
                    commands.Add(Command.ReloadAsset);
                    commands.Add(Command.UnloadAssets);
                    commands.Add(Command.DetailsView);
                    commands.Add(Command.ThumbnailView);
                    commands.Add(Command.AddExistingAsset);

                    m_commandService.RunContextMenu(commands, screenPoint);
                }
            }

            m_dragging = false;
        }
コード例 #11
0
        /// <summary>
        /// Called when the underlying tree control raises the DragDrop event</summary>
        /// <param name="e">Event args from the tree control's DragDrop event</param>
        protected virtual void OnDragDrop(DragEventArgs e)
        {
            ApplicationUtil.Insert(
                m_treeControlAdapter.TreeView,
                m_treeControlAdapter.LastHit,
                e.Data,
                "Drag and Drop",
                m_statusService);

            if (!TreeControl.ShowDragBetweenCue)
            {
                return;
            }

            TreeControl.ShowDragBetweenCue = false;
            TreeControl.Invalidate();
        }
コード例 #12
0
        /// <summary>
        /// Called when the underlying tree control raises the DragOver event</summary>
        /// <param name="e">Event args from the tree control's DragOver event</param>
        protected virtual void OnDragOver(DragEventArgs e)
        {
            bool showDragBetweenCue = TreeControl.ShowDragBetweenCue;

            TreeControl.ShowDragBetweenCue = false;

            bool canInsert = ApplicationUtil.CanInsert(
                m_treeControlAdapter.TreeView,
                m_treeControlAdapter.LastHit,
                e.Data);

            e.Effect = canInsert ? DragDropEffects.Move : DragDropEffects.None;

            if (showDragBetweenCue != TreeControl.ShowDragBetweenCue)
            {
                TreeControl.Refresh();
            }
        }
コード例 #13
0
ファイル: TreeControlEditor.cs プロジェクト: zoombapup/ATF
        /// <summary>
        /// Called when the underlying tree control raises the DragDrop event</summary>
        /// <param name="e">Event args from the tree control's DragDrop event</param>
        protected virtual void OnDragDrop(DragEventArgs e)
        {
            if (TreeControl.DragBetween)
            {
                TreeControl.Node parent, before;
                Point            clientPoint = TreeControl.PointToClient(new Point(e.X, e.Y));
                if (TreeControl.GetInsertionNodes(clientPoint, out parent, out before))
                {
                    ApplicationUtil.InsertBetween(
                        m_treeControlAdapter.TreeView,
                        parent != null ? parent.Tag : null,
                        before != null ? before.Tag : null,
                        e.Data,
                        "Drag and Drop",
                        m_statusService);
                }
            }
            else
            {
                ApplicationUtil.Insert(
                    m_treeControlAdapter.TreeView,
                    m_treeControlAdapter.LastHit,
                    e.Data,
                    "Drag and Drop",
                    m_statusService);
            }


            if (!TreeControl.ShowDragBetweenCue)
            {
                return;
            }


            TreeControl.Invalidate();
        }
コード例 #14
0
 /// <summary>
 /// Method triggered when DragDrop event is fired on the TreeListView</summary>
 /// <param name="e">Drag-and-drop event arguments</param>
 protected virtual void OnDragDrop(DragEventArgs e)
 {
     ApplicationUtil.Insert(View, LastHit, e.Data, "Drag and drop", StatusService);
 }