当前位置: 首页>>代码示例>>C#>>正文


C# Models.ModelBase类代码示例

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


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


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