• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# BrightIdeasSoftware.ModelDropEventArgs类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中BrightIdeasSoftware.ModelDropEventArgs的典型用法代码示例。如果您正苦于以下问题:C# ModelDropEventArgs类的具体用法?C# ModelDropEventArgs怎么用?C# ModelDropEventArgs使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



ModelDropEventArgs类属于BrightIdeasSoftware命名空间,在下文中一共展示了ModelDropEventArgs类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: objectListView_ModelDropped

        private void objectListView_ModelDropped(object sender, ModelDropEventArgs e)
        {
            var copy = new List<Combatant>(e.SourceModels.OfType<Combatant>());
            if (copy.Count == 0) {
                return;
            }

            this.dirty = true;
            this.Text = String.Concat("* ", this.Text);

            //var handles = this.encounter.Handles;
            //var combatants = this.encounter.Combatants;
            //foreach (var combatant in copy) {
            //    int count;
            //    if (!handles.TryGetValue(combatant.Handle, out count)) {
            //        combatants.Add(combatant.Handle, combatant);
            //    }
            //    else if (combatant is Character) {
            //        continue; // only one copy of a character allowed
            //    }
            //    else {
            //        this.encounter.IncrementCombatant(combatant.Handle);
            //    }
            //}
        }
开发者ID:JazzFisch,项目名称:DnD4eCM,代码行数:25,代码来源:EncounterDetailsWindow.cs


示例2: objectListView_ModelCanDrop

        private void objectListView_ModelCanDrop(object sender, ModelDropEventArgs e)
        {
            if (!e.SourceModels.OfType<Combatant>().Any()) {
                e.Effect = DragDropEffects.None;
                return;
            }

            e.Effect = DragDropEffects.Copy;
        }
开发者ID:JazzFisch,项目名称:DnD4eCM,代码行数:9,代码来源:EncounterDetailsWindow.cs


示例3: HandleEvent_ModelDropped

 public void HandleEvent_ModelDropped(object sender, ModelDropEventArgs e)
 {
     var dropTarget = e.TargetModel as ConnectionInfo;
     if (dropTarget == null) return;
     var dropSource = (ConnectionInfo)e.SourceModels[0];
     DropModel(dropSource, dropTarget, e.DropTargetLocation);
     e.Handled = true;
     Runtime.SaveConnectionsAsync();
 }
开发者ID:mRemoteNG,项目名称:mRemoteNG,代码行数:9,代码来源:ConnectionTreeDragAndDropHandler.cs


示例4: GetDragTargetKlasse

        public static Klasse GetDragTargetKlasse(ModelDropEventArgs e)
        {
            Klasse targetKlasse = e.TargetModel as Klasse;
              if (targetKlasse == null)
              {
            Schueler targetSchueler = e.TargetModel as Schueler;
            if (targetSchueler != null)
            {
              targetKlasse = targetSchueler.getKlasse;
            }
              }

              return targetKlasse;
        }
开发者ID:FOSBOS,项目名称:diNo,代码行数:14,代码来源:SchuelerverwaltungController.cs


示例5: HandleEvent_ModelCanDrop

        public void HandleEvent_ModelCanDrop(object sender, ModelDropEventArgs e)
        {
            _enableFeedback = true;
            _currentFeedbackColor = DropDeniedFeedbackColor;
            _infoMessage = null;
            var dropSource = e.SourceModels.Cast<ConnectionInfo>().First();
            var dropTarget = e.TargetModel as ConnectionInfo;

            e.Effect = CanModelDrop(dropSource, dropTarget, e.DropTargetLocation);
            e.InfoMessage = _infoMessage;
            e.DropSink.EnableFeedback = _enableFeedback;
            e.DropSink.FeedbackColor = _currentFeedbackColor;
            e.Handled = true;
        }
开发者ID:mRemoteNG,项目名称:mRemoteNG,代码行数:14,代码来源:ConnectionTreeDragAndDropHandler.cs


示例6: treeListView1_ModelCanDrop

        public void treeListView1_ModelCanDrop(object sender, ModelDropEventArgs e)
        {
            e.Handled = true;
              e.Effect = DragDropEffects.None;

              Klasse targetKlasse = GetDragTargetKlasse(e);

              if (targetKlasse == null)
              {
            e.InfoMessage = "Ziel konnte nicht erkannt werden.";
            return;
              }

              Schueler derSchueler = GetDraggedSchueler(e.SourceModels);
              if (derSchueler == null)
              {
            e.InfoMessage = "Nur Schülerzeilen können in eine andere Klasse verschoben werden.";
            return;
              }
              else
              {
            e.Effect = DragDropEffects.Move;
              }
        }
开发者ID:FOSBOS,项目名称:diNo,代码行数:24,代码来源:SchuelerverwaltungController.cs


示例7: dropSink_ModelDropped

 private void dropSink_ModelDropped(object sender, ModelDropEventArgs e)
 {
     OnModelDropped(e);
 }
开发者ID:rxantos,项目名称:tesv-snip,代码行数:4,代码来源:ObjectListView.cs


示例8: PluginTree_ModelDropped

        private void PluginTree_ModelDropped(object sender, ModelDropEventArgs e)
        {
            if (e.DropTargetLocation == DropTargetLocation.Item)
            {
                var group = e.TargetModel as IGroupRecord;
                if (group == null)
                {
                    return;
                }

                var objects = new List<BaseRecord>();
                foreach (IRecord record in e.SourceModels)
                {
                    if (e.Effect == DragDropEffects.Copy)
                    {
                        var r = record.Clone() as BaseRecord;
                        group.AddRecord(r);
                        objects.Add(r);
                    }
                    else if (e.Effect == DragDropEffects.Move)
                    {
                        var r = record as BaseRecord;
                        if (r != null && r.Parent.DeleteRecord(r))
                        {
                            group.AddRecord(r);
                            objects.Add(r);
                        }
                    }
                }

                e.RefreshObjects();
                this.PluginTree.SelectObject(objects);
                this.PluginTree.RefreshObject(group);
                this.PluginTree.RefreshObjects(objects);
            }
            else if (e.DropTargetLocation == DropTargetLocation.AboveItem || e.DropTargetLocation == DropTargetLocation.BelowItem)
            {
                int offset = e.DropTargetLocation == DropTargetLocation.BelowItem ? +1 : 0;
                var rec = e.TargetModel as IRecord;
                if (rec == null)
                {
                    return;
                }

                var group = rec.Parent as IGroupRecord;
                if (group == null)
                {
                    return;
                }

                int idx = group.IndexOf(rec as BaseRecord) + offset;
                var refreshObjects = new List<BaseRecord>();
                var selObjects = new List<BaseRecord>();
                IEnumerable<IRecord> itr = e.SourceModels.OfType<IRecord>();
                if (e.DropTargetLocation == DropTargetLocation.BelowItem)
                {
                    itr = itr.Reverse();
                }

                foreach (IRecord record in itr)
                {
                    if (e.Effect == DragDropEffects.Copy)
                    {
                        var r = record.Clone() as BaseRecord;
                        group.InsertRecord(idx, r);
                        selObjects.Add(r);
                    }
                    else if (e.Effect == DragDropEffects.Move)
                    {
                        var r = record as BaseRecord;
                        var p = r.Parent;
                        if (r.Parent.DeleteRecord(r))
                        {
                            idx = group.IndexOf(rec as BaseRecord) + offset;
                            group.InsertRecord(idx, r);
                            selObjects.Add(r);
                        }
                    }
                }

                e.RefreshObjects();
                this.PluginTree.SelectObject(selObjects);
                this.PluginTree.RefreshObject(group);
                this.PluginTree.RefreshObjects(selObjects);
            }
        }
开发者ID:rxantos,项目名称:tesv-snip,代码行数:86,代码来源:PluginTreeView.cs


示例9: PluginTree_ModelCanDrop

        private void PluginTree_ModelCanDrop(object sender, ModelDropEventArgs e)
        {
            e.Effect = DragDropEffects.None;
            if (e.DropTargetLocation == DropTargetLocation.Background)
            {
                return;
            }

            if (e.SourceModels.OfType<Plugin>().Any())
            {
                e.InfoMessage = "Cannot drag plugins";
                return;
            }

            if (e.TargetModel != null)
            {
                var rec = e.TargetModel as BaseRecord;
                var targetPlugin = this.GetPluginFromNode(rec);
                var targetParent = rec.Parent;
                if (e.SourceModels.Contains(e.TargetModel))
                {
                    // e.InfoMessage = "Cannot drop on self";
                }
                else
                {
                    var parents = e.SourceModels.OfType<BaseRecord>().Select(x => x.Parent).Distinct();
                    if (parents.Count() != 1)
                    {
                        e.InfoMessage = Resources.CannotDragNodesWithDifferentParents;
                        return;
                    }

                    var srcParent = parents.FirstOrDefault();
                    if (e.DropTargetLocation == DropTargetLocation.Item && srcParent.Equals(targetParent))
                    {
                        return;
                    }

                    Plugin srcPlugin = this.GetPluginFromNode(srcParent);
                    foreach (BaseRecord r in e.SourceModels)
                    {
                        foreach (var r2 in r.Enumerate(x => x is IGroupRecord || x.Equals(rec)))
                        {
                            if (r2.Equals(rec))
                            {
                                e.InfoMessage = Resources.CannotDropOnDescendent;
                                return;
                            }
                        }
                    }

                    if (e.DropTargetLocation == DropTargetLocation.Item && !(e.TargetModel is IGroupRecord))
                    {
                        // e.InfoMessage = "Can only drop on groups or plugins";
                    }
                    else
                    {
                        if (srcPlugin.Equals(targetPlugin))
                        {
                            // same plugin defaults to move unless ctrl down
                            e.Effect = e.DropSink.IsControlDown ? DragDropEffects.Copy : DragDropEffects.Move;
                        }
                        else
                        {
                            // same plugin defaults to copy unless shift down
                            e.Effect = (!e.DropSink.IsControlDown && e.DropSink.IsShiftDown) ? DragDropEffects.Move : DragDropEffects.Copy;
                        }
                    }
                }
            }
        }
开发者ID:rxantos,项目名称:tesv-snip,代码行数:71,代码来源:PluginTreeView.cs


示例10: OnModelDropped

 protected override void OnModelDropped(ModelDropEventArgs args)
 {
     base.OnModelDropped(args);
 }
开发者ID:sjroesink,项目名称:zVirtualScenes,代码行数:4,代码来源:MainForm.cs


示例11: OnModelDropped

 /// <summary>
 /// 
 /// </summary>
 /// <param name="args"></param>
 protected virtual void OnModelDropped(ModelDropEventArgs args) {
     if (this.ModelDropped != null)
         this.ModelDropped(this, args);
 }
开发者ID:heliwave,项目名称:QuranCode,代码行数:8,代码来源:Events.cs


示例12: dataListViewScenes_ModelDropped_1

        private void dataListViewScenes_ModelDropped_1(object sender, ModelDropEventArgs e)
        {
            int TargetIndex = 0;

            //Handle if dropped into empty Action box
            if (e.TargetModel == null)
                TargetIndex = 0;
            else
                TargetIndex = e.DropTargetIndex;

            if (e.SourceModels[0].GetType().Equals(typeof(scene)))
            {
                switch (e.DropTargetLocation)
                {
                    case DropTargetLocation.AboveItem:
                        //offset = 0
                        dataListViewScenes.MoveObjects(TargetIndex, e.SourceModels);
                        dataListViewScenes.SelectedObjects = e.SourceModels;
                        break;
                    case DropTargetLocation.BelowItem:
                        //offset = 1
                        dataListViewScenes.MoveObjects(TargetIndex +1, e.SourceModels);
                        dataListViewScenes.SelectedObjects = e.SourceModels;
                        break;
                }
            }

            //SAve the sort order to the DB
            foreach (scene scene_in_list in dataListViewScenes.Objects)
            {
                using (zvsEntities2 db = new zvsEntities2(zvsEntityControl.GetzvsConnectionString))
                {
                    scene scene = db.scenes.FirstOrDefault(s => s.id == scene_in_list.id);
                    if (scene != null)
                    {
                        scene.sort_order = dataListViewScenes.IndexOf(scene_in_list);
                    }
                    db.SaveChanges();
                }
            }
        }
开发者ID:sjroesink,项目名称:zVirtualScenes,代码行数:41,代码来源:MainForm.cs


示例13: OnModelDropped

        protected override void OnModelDropped(ModelDropEventArgs args)
        {
            base.OnModelDropped(args);

            if (!args.Handled)
                this.RearrangeModels(args);
        }
开发者ID:seriesrenamer,项目名称:seriesrenamer,代码行数:7,代码来源:DropSink.cs


示例14: RearrangeModels

        /// <summary>
        /// Do the work of processing the dropped items
        /// </summary>
        /// <param name="args"></param>
        public virtual void RearrangeModels(ModelDropEventArgs args)
        {
            switch (args.DropTargetLocation) {
                case DropTargetLocation.AboveItem:
                    this.ListView.MoveObjects(args.DropTargetIndex, args.SourceModels);
                    break;
                case DropTargetLocation.BelowItem:
                    this.ListView.MoveObjects(args.DropTargetIndex + 1, args.SourceModels);
                    break;
                case DropTargetLocation.Background:
                    this.ListView.AddObjects(args.SourceModels);
                    break;
                default:
                    return;
            }

            if (args.SourceListView != this.ListView) {
                args.SourceListView.RemoveObjects(args.SourceModels);
            }
        }
开发者ID:seriesrenamer,项目名称:seriesrenamer,代码行数:24,代码来源:DropSink.cs


示例15: dataListViewSceneCMDs_ModelCanDrop

 private void dataListViewSceneCMDs_ModelCanDrop(object sender, ModelDropEventArgs e)
 {
     if (e.SourceModels[0].GetType().Equals(typeof(device)))
     {
         e.Effect = DragDropEffects.Copy;
         e.InfoMessage = "Create new action for this device";
     }
     else if (e.SourceModels[0].GetType().Equals(typeof(scene_commands)))
     {
         e.Effect = DragDropEffects.Move;
         e.InfoMessage = "Rearrage Order";
     }
     else
     {
         e.Effect = DragDropEffects.None;
         e.InfoMessage = "Can not drop this here.";
     }
 }
开发者ID:sjroesink,项目名称:zVirtualScenes,代码行数:18,代码来源:MainForm.cs


示例16: dataListViewSceneCMDs_ModelDropped

        private void dataListViewSceneCMDs_ModelDropped(object sender, ModelDropEventArgs e)
        {
            int TargetIndex = 0;

            //Handle if dropped into empty Action box
            if (e.TargetModel == null)
                TargetIndex = 0;
            else
                TargetIndex = e.DropTargetIndex;

            // Handle Device Drop
            if (e.SourceModels[0].GetType().Equals(typeof(device)))
            {
                scene scene = (scene)dataListViewScenes.SelectedObject;
                using (zvsEntities2 db = new zvsEntities2(zvsEntityControl.GetzvsConnectionString))
                {
                    scene selected_scene = db.scenes.FirstOrDefault(c => c.id == scene.id);
                    if (selected_scene != null)
                    {
                        if (selected_scene.is_running)
                        {
                            MessageBox.Show("Cannot modify scene when it is running.", ProgramName);
                            return;
                        }

                        foreach (device selected_device in e.SourceModels)
                        {
                            if (selected_device != null)
                            {
                                int pos = TargetIndex;
                                switch (e.DropTargetLocation)
                                {
                                    case DropTargetLocation.BelowItem:
                                        pos += 1;
                                        break;
                                }

                                AddEditSceneDeviceCMD addCMDform = new AddEditSceneDeviceCMD(null, selected_device.id, selected_scene.id, pos);
                                addCMDform.ShowDialog();

                            }
                        }
                    }
                }
            }
            else if (e.SourceModels[0].GetType().Equals(typeof(scene_commands)))
            {
                //Rearrage Actions
                scene scene = (scene)dataListViewScenes.SelectedObject;
                using (zvsEntities2 db = new zvsEntities2(zvsEntityControl.GetzvsConnectionString))
                {
                    scene selected_scene = db.scenes.FirstOrDefault(c => c.id == scene.id);
                    if (selected_scene != null)
                    {
                        if (selected_scene.is_running)
                        {
                            MessageBox.Show("Cannot modify scene when it is running.", ProgramName);
                            return;
                        }

                        switch (e.DropTargetLocation)
                        {
                            case DropTargetLocation.AboveItem:
                                //offset = 0
                                dataListViewSceneCMDs.MoveObjects(TargetIndex, e.SourceModels);
                                dataListViewSceneCMDs.SelectedObjects = e.SourceModels;
                                break;
                            case DropTargetLocation.BelowItem:
                                //offset = 1
                                dataListViewSceneCMDs.MoveObjects(TargetIndex + 1, e.SourceModels);
                                dataListViewSceneCMDs.SelectedObjects = e.SourceModels;
                                break;
                        }

                        //SAve the sort order to the DB
                        foreach (scene_commands cmd in dataListViewSceneCMDs.Objects)
                        {
                            scene_commands scene_cmd = db.scene_commands.FirstOrDefault(s => s.id == cmd.id);
                            if (scene_cmd != null)
                            {
                                scene_cmd.sort_order = dataListViewSceneCMDs.IndexOf(cmd);
                            }
                            db.SaveChanges();
                        }
                    }
                }
            }
        }
开发者ID:sjroesink,项目名称:zVirtualScenes,代码行数:88,代码来源:MainForm.cs


示例17: OnModelDropped

 protected override void OnModelDropped(ModelDropEventArgs args)
 {
     base.OnModelDropped(args);
     if (!args.Handled)
     {
         _form.HostModelDropped(args);
     }
     args.Handled = true;
 }
开发者ID:kaduardo,项目名称:cyberduck,代码行数:9,代码来源:BrowserForm.cs


示例18: OnModelCanDrop

            protected override void OnModelCanDrop(ModelDropEventArgs args)
            {
                base.OnModelCanDrop(args);

                args.Effect = DragDropEffects.None;

                //args.Handled = true; // OnCanDrop is not being called anymore

                if (args.Handled)
                    return;

                args.Effect = CalculateStandardDropActionFromKeys();

                // Don't allow drops from other list, if that's what's configured
                if (!AcceptExternal)
                {
                    args.Effect = DragDropEffects.None;
                    args.DropTargetLocation = DropTargetLocation.None;
                }
                else
                {
                    _form.HostModelCanDrop(args);
                }
                args.Handled = true;
            }
开发者ID:kaduardo,项目名称:cyberduck,代码行数:25,代码来源:BrowserForm.cs


示例19: DropSinkModelCanDrop

 void DropSinkModelCanDrop(object sender, ModelDropEventArgs e) { this.OnModelCanDrop(e); }
开发者ID:heliwave,项目名称:QuranCode,代码行数:1,代码来源:ObjectListView.cs


示例20: filterTree_ModelDropped

 private void filterTree_ModelDropped(object sender, ModelDropEventArgs e)
 {
     // throw new NotImplementedException();
 }
开发者ID:Emilgardis,项目名称:falloutsnip,代码行数:4,代码来源:SearchFilterAdvanced.cs



注:本文中的BrightIdeasSoftware.ModelDropEventArgs类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# BrightIdeasSoftware.OLVListItem类代码示例发布时间:2022-05-24
下一篇:
C# QUnit.Assert类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap