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

C# Models.WorkspaceModel类代码示例

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

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



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

示例1: ElementsQueryBase

 protected ElementsQueryBase(WorkspaceModel workspaceModel) : base(workspaceModel)
 {
     var u = RevitDynamoModel.RevitServicesUpdater;
     u.ElementsAdded += Updater_ElementsAdded;
     u.ElementsModified += Updater_ElementsModified;
     u.ElementsDeleted += Updater_ElementsDeleted;
 }
开发者ID:whztt07,项目名称:Dynamo,代码行数:7,代码来源:Elements.cs


示例2: DummyNode

 public DummyNode(WorkspaceModel workspace)
     : base(workspace)
 {
     this.LegacyNodeName = "DSCoreNodesUI.DummyNode";
     this.LegacyAssembly = string.Empty;
     this.NodeNature = Nature.Unresolved;
 }
开发者ID:RobertiF,项目名称:Dynamo,代码行数:7,代码来源:DummyNode.cs


示例3: Initialize

        /// <summary>
        /// Call this method to determine if the task should be scheduled for 
        /// execution.
        /// </summary>
        /// <param name="workspaceModel">Render packages for all the nodes in 
        /// this workspaceModel will be extracted, if 'nodeModel' parameter is 
        /// null.</param>
        /// <param name="nodeModel">An optional NodeModel from which all upstream 
        /// nodes are to be examined for render packages. If this parameter is 
        /// null, render packages are extracted from all nodes in workspaceModel.
        /// </param>
        /// <returns>Returns true if the task should be scheduled for execution,
        /// or false otherwise.</returns>
        /// 
        internal bool Initialize(WorkspaceModel workspaceModel, NodeModel nodeModel)
        {
            if (workspaceModel == null)
                throw new ArgumentNullException("workspaceModel");

            if (nodeModel == null) // No node is specified, gather all nodes.
            {
                NodeId = Guid.Empty;

                // Duplicate a list of all nodes for consumption later.
                duplicatedNodeReferences = workspaceModel.Nodes.ToList();
            }
            else
            {
                NodeId = nodeModel.GUID;

                // Recursively gather all upstream nodes.
                var gathered = new List<NodeModel>();
                GatherAllUpstreamNodes(nodeModel, gathered);
                duplicatedNodeReferences = gathered;
            }

            Debug.WriteLine(string.Format("Aggregation task initialized for {0}", nodeModel == null?"null":nodeModel.GUID.ToString()));
            return duplicatedNodeReferences.Any();
        }
开发者ID:whztt07,项目名称:Dynamo,代码行数:39,代码来源:AggregateRenderPackageAsyncTask.cs


示例4: Initialize

        /// <summary>
        /// Call this method to determine if the task should be scheduled for 
        /// execution.
        /// </summary>
        /// <param name="workspaceModel">Render packages for all the nodes in 
        /// this workspaceModel will be extracted, if 'nodeModel' parameter is 
        /// null.</param>
        /// <param name="nodeModel">An optional NodeModel from which all upstream 
        /// nodes are to be examined for render packages. If this parameter is 
        /// null, render packages are extracted from all nodes in workspaceModel.
        /// </param>
        /// <returns>Returns true if the task should be scheduled for execution,
        /// or false otherwise.</returns>
        /// 
        internal bool Initialize(WorkspaceModel workspaceModel, NodeModel nodeModel)
        {
            if (workspaceModel == null)
                throw new ArgumentNullException("workspaceModel");

            if (nodeModel == null) // No node is specified, gather all nodes.
            {
                targetedNodeId = Guid.Empty;

                // Duplicate a list of all nodes for consumption later.
                var nodes = workspaceModel.Nodes.Where(n => n.IsVisible);
                duplicatedNodeReferences = nodes.ToList();
            }
            else
            {
                targetedNodeId = nodeModel.GUID;

                // Recursively gather all upstream nodes. Stop 
                // gathering if this node does not display upstream.
                var gathered = new List<NodeModel>();
                WorkspaceUtilities.GatherAllUpstreamNodes(nodeModel,
                    gathered, model => model.IsUpstreamVisible);

                duplicatedNodeReferences = gathered;
            }

            return duplicatedNodeReferences.Any();
        }
开发者ID:JinWooShin,项目名称:Dynamo,代码行数:42,代码来源:AggregateRenderPackageAsyncTask.cs


示例5: OnWorkspaceAdded

        protected virtual void OnWorkspaceAdded(WorkspaceModel obj)
        {
            var handler = WorkspaceAdded;
            if (handler != null) handler(obj);

            WorkspaceEvents.OnWorkspaceAdded(obj.Guid, obj.Name, obj.GetType());
        }
开发者ID:MrWalsh,项目名称:Dynamo,代码行数:7,代码来源:DynamoModelEvents.cs


示例6: OnWorkspaceCleared

        public virtual void OnWorkspaceCleared(WorkspaceModel workspace)
        {
            if (WorkspaceCleared != null)
                WorkspaceCleared(workspace);

            WorkspaceEvents.OnWorkspaceCleared();
        }
开发者ID:MrWalsh,项目名称:Dynamo,代码行数:7,代码来源:DynamoModelEvents.cs


示例7: WatchImageCore

        public WatchImageCore(WorkspaceModel ws) : base(ws)
        {
            InPortData.Add(new PortData("image", "image"));
            OutPortData.Add(new PortData("image", "image"));

            RegisterAllPorts();
        }
开发者ID:whztt07,项目名称:Dynamo,代码行数:7,代码来源:WatchImage.cs


示例8: Formula

 public Formula(WorkspaceModel workspace)
     : base(workspace)
 {
     ArgumentLacing = LacingStrategy.Shortest;
     OutPortData.Add(new PortData("", "Result of math computation"));
     RegisterAllPorts();
 }
开发者ID:RobertiF,项目名称:Dynamo,代码行数:7,代码来源:Formula.cs


示例9: DSFunction

 public DSFunction(WorkspaceModel ws, FunctionDescriptor definition)
     : base(ws)
 {
     ArgumentLacing = LacingStrategy.Shortest;
     Definition = definition;
     Initialize();
 }
开发者ID:RobertiF,项目名称:Dynamo,代码行数:7,代码来源:DSFunction.cs


示例10: GetWorksheetsFromExcelWorkbook

 public GetWorksheetsFromExcelWorkbook(WorkspaceModel workspace)
     : base(workspace)
 {
     InPortData.Add(new PortData("workbook", "The excel workbook"));
     OutPortData.Add(new PortData("worksheets", "A list of worksheets"));
     RegisterAllPorts();
 }
开发者ID:RobertiF,项目名称:Dynamo,代码行数:7,代码来源:Excel.cs


示例11: OnWorkspaceSaved

 internal void OnWorkspaceSaved(WorkspaceModel model)
 {
     if (WorkspaceSaved != null)
     {
         WorkspaceSaved(model);
     }
 }
开发者ID:jbenoit44,项目名称:Dynamo,代码行数:7,代码来源:DynamoModel.cs


示例12: OnWorkspaceRemoved

        protected virtual void OnWorkspaceRemoved(WorkspaceModel obj)
        {
            var handler = WorkspaceRemoved;
            if (handler != null) handler(obj);

            WorkspaceEvents.OnWorkspaceRemoved(obj.Guid, obj.Name);
        }
开发者ID:JinWooShin,项目名称:Dynamo,代码行数:7,代码来源:DynamoModelEvents.cs


示例13: ApplyFunction

 public ApplyFunction(WorkspaceModel workspaceModel) : base(workspaceModel)
 {
     InPortData.Add(new PortData("func", "Function to apply."));
     OutPortData.Add(new PortData("func(args)", "Result of application."));
     AddInput();
     RegisterAllPorts();
 }
开发者ID:RobertiF,项目名称:Dynamo,代码行数:7,代码来源:Apply.cs


示例14: Initialize

        /// <summary>
        /// This method is called by code that intends to start a graph update.
        /// This method is called on the main thread where node collection in a 
        /// WorkspaceModel can be safely accessed.
        /// </summary>
        /// <param name="controller">Reference to an instance of EngineController 
        /// to assist in generating GraphSyncData object for the given set of nodes.
        /// </param>
        /// <param name="workspace">Reference to the WorkspaceModel from which a 
        /// set of updated nodes is computed. The EngineController generates the 
        /// resulting GraphSyncData from this list of updated nodes.</param>
        /// <returns>Returns true if there is any GraphSyncData, or false otherwise
        /// (in which case there will be no need to schedule UpdateGraphAsyncTask 
        /// for execution).</returns>
        /// 
        internal bool Initialize(EngineController controller, WorkspaceModel workspace)
        {
            try
            {
                engineController = controller;
                TargetedWorkspace = workspace;

                ModifiedNodes = ComputeModifiedNodes(workspace);
                graphSyncData = engineController.ComputeSyncData(workspace.Nodes, ModifiedNodes, verboseLogging);
                if (graphSyncData == null)
                    return false;

                // We clear dirty flags before executing the task. If we clear
                // flags after the execution of task, for example in
                // AsyncTask.Completed or in HandleTaskCompletionCore(), as both
                // are executed in the other thread, although some nodes are
                // modified and we request graph execution, but just before
                // computing sync data, the task completion handler jumps in
                // and clear dirty flags. Now graph sync data will be null and
                // graph is in wrong state.
                foreach (var nodeGuid in graphSyncData.NodeIDs)
                {
                    var node = workspace.Nodes.FirstOrDefault(n => n.GUID.Equals(nodeGuid));
                    if (node != null)
                        node.ClearDirtyFlag();
                }

                return true;
            }
            catch (Exception e)
            {
                System.Diagnostics.Debug.WriteLine("UpgradeGraphAsyncTask saw: " + e.ToString());
                return false;
            }
        }
开发者ID:dspeckhard,项目名称:Dynamo,代码行数:50,代码来源:UpdateGraphAsyncTask.cs


示例15: OnCurrentWorkspaceChanged

 public virtual void OnCurrentWorkspaceChanged(WorkspaceModel workspace)
 {
     if (CurrentWorkspaceChanged != null)
     {
         CurrentWorkspaceChanged(workspace);
     }
 }
开发者ID:whztt07,项目名称:Dynamo,代码行数:7,代码来源:DynamoModelEvents.cs


示例16: WebRequest

 public WebRequest(WorkspaceModel workspace)
     : base(workspace)
 {
     InPortData.Add(new PortData("url", "The url for the web request."));
     OutPortData.Add(new PortData("result", "The result of the web request."));
     RegisterAllPorts();
 }
开发者ID:RobertiF,项目名称:Dynamo,代码行数:7,代码来源:WebRequest.cs


示例17: FileSystemBrowser

        protected FileSystemBrowser(WorkspaceModel workspace, string tip)
            : base(workspace)
        {
            OutPortData[0].ToolTipString = tip;
            RegisterAllPorts();

            Value = "";
        }
开发者ID:RobertiF,项目名称:Dynamo,代码行数:8,代码来源:File.cs


示例18: TwoScopedInputs

            public TwoScopedInputs(WorkspaceModel workspaceModel) : base(workspaceModel)
            {
                InPortData.Add(new PortData("port1", "Port1 block"));
                InPortData.Add(new PortData("port2", "Port2 block"));
                OutPortData.Add(new PortData("result", "Result"));

                RegisterAllPorts();
            }
开发者ID:RobertiF,项目名称:Dynamo,代码行数:8,代码来源:ScopedNodeTest.cs


示例19: GetExcelWorksheetByName

 public GetExcelWorksheetByName(WorkspaceModel workspace)
     : base(workspace)
 {
     InPortData.Add(new PortData("workbook", "The excel workbook"));
     InPortData.Add(new PortData("name", "Name of the worksheet to get"));
     OutPortData.Add(new PortData("worksheet", "The worksheet with the given name"));
     RegisterAllPorts();
 }
开发者ID:RobertiF,项目名称:Dynamo,代码行数:8,代码来源:Excel.cs


示例20: ElementsOfFamilyType

        public ElementsOfFamilyType(WorkspaceModel workspaceModel)
            : base(workspaceModel)
        {
            InPortData.Add(new PortData("Family Type", "The Family Type."));
            OutPortData.Add(new PortData("Elements", "The list of elements matching the query."));

            RegisterAllPorts();
        }
开发者ID:RobertiF,项目名称:Dynamo,代码行数:8,代码来源:Elements.cs



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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