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

C# Models.ModelBase类代码示例

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

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



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

示例1: DynamoNodeButton

 public DynamoNodeButton(ModelBase model, string eventName)
     : this()
 {
     this.model = model;
     this.eventName = eventName;
     Click += OnDynamoNodeButtonClick;
 }
开发者ID:norbertzsiros,项目名称:Dynamo,代码行数:7,代码来源:DynamoNodeButton.cs


示例2: RecordCreatedModel

        internal void RecordCreatedModel(ModelBase model)
        {
            if (null == model) return;

            using (undoRecorder.BeginActionGroup())
            {
                undoRecorder.RecordCreationForUndo(model);
            }
        }
开发者ID:mikeyforrest,项目名称:Dynamo,代码行数:9,代码来源:WorkspaceModel.cs


示例3: RecordModelForModification

 // See RecordModelsForModification below for more details.
 internal static void RecordModelForModification(ModelBase model, UndoRedoRecorder recorder)
 {
     if (null != model)
     {
         var models = new List<ModelBase> { model };
         RecordModelsForModification(models, recorder);
     }
 }
开发者ID:mikeyforrest,项目名称:Dynamo,代码行数:9,代码来源:WorkspaceModel.cs


示例4: UpdatePythonNodeContent

        private void UpdatePythonNodeContent(ModelBase pythonNode, string value)
        {
            var command = new DynCmd.UpdateModelValueCommand(
                System.Guid.Empty, pythonNode.GUID, "ScriptContent", value);

            ViewModel.ExecuteCommand(command);
        }
开发者ID:norbertzsiros,项目名称:Dynamo,代码行数:7,代码来源:PythonEditTests.cs


示例5: UpdatePythonNodeContent

        private void UpdatePythonNodeContent(ModelBase pythonNode, string value)
        {
            var command = new DynCmd.UpdateModelValueCommand(
                pythonNode.GUID, "ScriptContent", value);

            dynSettings.Controller.DynamoViewModel.ExecuteCommand(command);
        }
开发者ID:heegwon,项目名称:Dynamo,代码行数:7,代码来源:PythonEditTests.cs


示例6: RecordCreatedModel

 internal void RecordCreatedModel(ModelBase model)
 {
     if (null != model)
     {
         undoRecorder.BeginActionGroup();
         undoRecorder.RecordCreationForUndo(model);
         undoRecorder.EndActionGroup();
     }
 }
开发者ID:heegwon,项目名称:Dynamo,代码行数:9,代码来源:WorkspaceModel.cs


示例7: ModelEventArgs

 public ModelEventArgs(ModelBase model)
     : this(model, false)
 {
 }
开发者ID:heegwon,项目名称:Dynamo,代码行数:4,代码来源:DynamoModel.cs


示例8: AddToSelectedModels

 /// <summary>
 /// This is called when a model is deleted from a group
 /// and UNDO is clicked.
 /// </summary>
 /// <param name="model">The model.</param>
 /// <param name="checkOverlap"> checkoverlap determines whether the selected model is 
 /// completely inside that group</param>
 internal void AddToSelectedModels(ModelBase model, bool checkOverlap = false)
 {           
     var list = this.SelectedModels.ToList();
     if (list.Where(x => x.GUID == model.GUID).Any()) return;
     if (!CheckModelIsInsideGroup(model, checkOverlap)) return;           
     list.Add(model);
     this.SelectedModels = list;
     this.UpdateBoundaryFromSelection();
 }
开发者ID:norbertzsiros,项目名称:Dynamo,代码行数:16,代码来源:AnnotationModel.cs


示例9: RecordActionInternal

        private void RecordActionInternal(XmlElement group, ModelBase model, UserAction action)
        {
            if (IsRecordedInActionGroup(group, model))
                return;

            // Serialize the affected model into xml representation
            // and store it under the current action group.
            XmlNode childNode = model.Serialize(document, SaveContext.Undo);
            SetNodeAction(childNode, action.ToString());
            group.AppendChild(childNode);
        }
开发者ID:norbertzsiros,项目名称:Dynamo,代码行数:11,代码来源:UndoRedoRecorder.cs


示例10: IsRecordedInActionGroup

        /// <summary>
        /// The recorder calls this method to determine if a given model has 
        /// already been recorded in the active action group. For an example,
        /// if there is a connection between NodeA and NodeB, selecting both 
        /// the nodes and deleting them will cause the connection model to be 
        /// recorded twice (when a node is deleted, its connections are being 
        /// recorded for undo).
        /// </summary>
        /// <param name="group">The action group to check against.</param>
        /// <param name="model">The model to check against.</param>
        /// <returns>Returns true if the model has already been recorded in the
        /// current action group, or false otherwise.</returns>
        private bool IsRecordedInActionGroup(XmlElement group, ModelBase model)
        {
            if (null == group)
                throw new ArgumentNullException("group");
            if (null == model)
                throw new ArgumentNullException("model");

            Guid guid = model.GUID;
            foreach (XmlNode childNode in group.ChildNodes)
            {
                // See if the model supports Guid identification, in unit test cases 
                // those sample models do not support this so in such cases identity 
                // check will not be performed.
                // 
                XmlAttribute guidAttribute = childNode.Attributes["guid"];
                if (null != guidAttribute && (guid == Guid.Parse(guidAttribute.Value)))
                    return true; // This model was found to be recorded.
            }

            return false;
        }
开发者ID:norbertzsiros,项目名称:Dynamo,代码行数:33,代码来源:UndoRedoRecorder.cs


示例11: RecordModificationForUndo

        /// <summary>
        /// Record the given model right before it is modified. This results
        /// in a modification action to be recorded under the current action 
        /// group. Undoing this action will result in the model being reverted
        /// to the states that it was in before the modification took place.
        /// </summary>
        /// <param name="model">The model to be recorded.</param>
        public void RecordModificationForUndo(ModelBase model)
        {
            RecordActionInternal(currentActionGroup,
                model, UserAction.Modification);

            redoStack.Clear(); // Wipe out the redo-stack.
        }
开发者ID:norbertzsiros,项目名称:Dynamo,代码行数:14,代码来源:UndoRedoRecorder.cs


示例12: RecordModelForModification

 // See RecordModelsForModification below for more details.
 internal void RecordModelForModification(ModelBase model)
 {
     if (null != model)
     {
         List<ModelBase> models = new List<ModelBase>();
         models.Add(model);
         RecordModelsForModification(models);
     }
 }
开发者ID:klubeley,项目名称:Dynamo,代码行数:10,代码来源:WorkspaceModel.cs


示例13: RemoveGroup

 public void RemoveGroup(ModelBase model)
 {
     var annotation = model as AnnotationModel;
     RemoveAnnotation(annotation);
     annotation.Dispose();
 }
开发者ID:mikeyforrest,项目名称:Dynamo,代码行数:6,代码来源:WorkspaceModel.cs


示例14: ModelModificationUndoHelper

 public ModelModificationUndoHelper(UndoRedoRecorder recorder, ModelBase model)
     : this(recorder, new [] { model })
 {
 }
开发者ID:norbertzsiros,项目名称:Dynamo,代码行数:4,代码来源:UndoRedoRecorder.cs


示例15: model_Disposed

 /// <summary>
 /// Recalculate the group when a node is disposed
 /// </summary>
 /// <param name="node">The node.</param>
 private void model_Disposed(ModelBase model)
 {
     var modelList = this.SelectedModels.ToList();
     bool remove = modelList.Remove(model);
     if (remove)
     {
         DeletedModelBases.Add(model);
         SelectedModels = modelList;
         UpdateBoundaryFromSelection();
     }
 }
开发者ID:norbertzsiros,项目名称:Dynamo,代码行数:15,代码来源:AnnotationModel.cs


示例16: RecordModelForModification

 // See RecordModelsForModification below for more details.
 public void RecordModelForModification(ModelBase model)
 {
     if (null != model)
     {
         var models = new List<ModelBase> { model };
         RecordModelsForModification(models);
     }
 }
开发者ID:heegwon,项目名称:Dynamo,代码行数:9,代码来源:WorkspaceModel.cs


示例17: CheckModelIsInsideGroup

 private bool CheckModelIsInsideGroup(ModelBase model, bool checkOverlap)
 {
     if (!checkOverlap) return true;
     var modelRect = model.Rect;
     if (this.Rect.Contains(modelRect))
     {
         return true;
     }
     return false;
 }
开发者ID:norbertzsiros,项目名称:Dynamo,代码行数:10,代码来源:AnnotationModel.cs


示例18: RecordDeletionForUndo

        /// <summary>
        /// Record the given model right before it has been deleted. This 
        /// results in a deletion action to be recorded under the current action 
        /// group. Undoing this action will result in the model being created 
        /// and re-inserted into the current workspace.
        /// </summary>
        /// <param name="model">The model to be recorded.</param>
        public void RecordDeletionForUndo(ModelBase model)
        {
            RecordActionInternal(this.currentActionGroup,
                model, UserAction.Deletion);

            this.redoStack.Clear(); // Wipe out the redo-stack.
        }
开发者ID:RobertiF,项目名称:Dynamo,代码行数:14,代码来源:UndoRedoRecorder.cs



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C# Models.NodeMigrationData类代码示例发布时间:2022-05-24
下一篇:
C# Models.FunctionNamePromptEventArgs类代码示例发布时间: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