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

C# Models.DynamoModel类代码示例

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

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



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

示例1: ExecuteCommand

        public void ExecuteCommand(DynamoModel.RecordableCommand command, string uniqueId, string extensionName)
        {
            // log that the command is being executed
            if (dynamoModel.DebugSettings.VerboseLogging)
            {
                dynamoModel.Logger.Log("Command: " + command);
            }
            
            var extnDetails = string.Format(
                "ExtensionCommandExecutive ( UniqueId: {0}, Name: {1}, commandTypeName: {2} )",
                uniqueId, extensionName, command.GetType().Name);
            
            Log(LogMessage.Info(extnDetails));

            try
            {
                // run the command
                dynamoModel.ExecuteCommand(command);
            }
            catch (Exception e)
            {
                // clean up or show failure messages
                Log(LogMessage.Error(string.Format("{0}, from {1}", e.Message, extnDetails)));
            }
            
        }
开发者ID:ankushraizada,项目名称:Dynamo,代码行数:26,代码来源:ExtensionCommandExecutive.cs


示例2: AbstractMutator

 protected AbstractMutator(Random rand)
 {
     this.Rand = rand;
     this.Controller = dynSettings.Controller;
     this.DynamoViewModel = Controller.DynamoViewModel;
     this.DynamoModel = Controller.DynamoModel;
 }
开发者ID:heegwon,项目名称:Dynamo,代码行数:7,代码来源:AbstractMutator.cs


示例3: DoPackageFileOperationsAndZip

        private static string DoPackageFileOperationsAndZip(DynamoModel dynamoModel, Package pkg, List<string> files, PackageUploadHandle uploadHandle)
        {
            uploadHandle.UploadState = PackageUploadHandle.State.Copying;

            DirectoryInfo rootDir, dyfDir, binDir, extraDir;
            FormPackageDirectory(dynamoModel.Loader.PackageLoader.RootPackagesDirectory, pkg.Name, out rootDir, out  dyfDir, out binDir, out extraDir); // shouldn't do anything for pkg versions
            pkg.RootDirectory = rootDir.FullName;
            WritePackageHeader(pkg.Header, rootDir);
            CopyFilesIntoPackageDirectory(files, dyfDir, binDir, extraDir);
            RemoveDyfFiles(files, dyfDir); 
            RemapCustomNodeFilePaths(dynamoModel.CustomNodeManager, files, dyfDir.FullName);

            uploadHandle.UploadState = PackageUploadHandle.State.Compressing;

            string zipPath;
            FileInfo info;

            try
            {
                zipPath = Greg.Utility.FileUtilities.Zip(rootDir.FullName);
                info = new FileInfo(zipPath);
            }
            catch
            {
                // give nicer error
                throw new Exception("Could not compress file.  Is the file in use?");
            }
            
            if (info.Length > 15 * 1000000) throw new Exception("The package is too large!  The package must be less than 15 MB!");

            return zipPath;
        }
开发者ID:whztt07,项目名称:Dynamo,代码行数:32,代码来源:PackageUploadBuilder.cs


示例4: Extract

        public bool Extract(DynamoModel dynamoModel, string installDirectory, out Package pkg)
        {
            this.DownloadState = State.Installing;

            // unzip, place files
            var unzipPath = Greg.Utility.FileUtilities.UnZip(DownloadPath);
            if (!Directory.Exists(unzipPath))
            {
                throw new Exception(Properties.Resources.PackageEmpty);
            }

            if (String.IsNullOrEmpty(installDirectory))
                installDirectory = dynamoModel.PathManager.DefaultPackagesDirectory;

            var installedPath = BuildInstallDirectoryString(installDirectory);
            Directory.CreateDirectory(installedPath);

            // Now create all of the directories
            foreach (string dirPath in Directory.GetDirectories(unzipPath, "*", SearchOption.AllDirectories))
                Directory.CreateDirectory(dirPath.Replace(unzipPath, installedPath));

            // Copy all the files
            foreach (string newPath in Directory.GetFiles(unzipPath, "*.*", SearchOption.AllDirectories))
                File.Copy(newPath, newPath.Replace(unzipPath, installedPath));

            // provide handle to installed package 
            pkg = new Package(installedPath, Header.name, VersionName, Header.license);

            return true;
        }
开发者ID:ankushraizada,项目名称:Dynamo,代码行数:30,代码来源:PackageDownloadHandle.cs


示例5: Start

        //Service start
        public static void Start(DynamoModel dynamoModel)
        {
            InstrumentationLogger.dynamoModel = dynamoModel;

            if (IsAnalyticsEnabled)
            {
                string appVersion = dynamoModel.AppVersion;

                var mc = new MeasurementConfiguration(ANALYTICS_PROPERTY,
                    "Dynamo", appVersion);
                mc.AnonymizeIp = true;

                sessionID = Guid.NewGuid().ToString();
                loggerImpl = new Log("Dynamo", userID, sessionID);
            
                AutoMeasurement.Start(mc);
                client = AutoMeasurement.Client;

                if (IS_VERBOSE_DIAGNOSTICS)
                    AutoMeasurement.DebugWriter = d => Debug.WriteLine(d);

                started = true;
            }


            // The following starts the heartbeat, do not remove this 
            // because of the unreferenced "heartbeat" variable.

// ReSharper disable UnusedVariable
            var heartbeat = Heartbeat.GetInstance(dynamoModel);
// ReSharper restore UnusedVariable

        }
开发者ID:ankushraizada,项目名称:Dynamo,代码行数:34,代码来源:Logger.cs


示例6: CustomNodeManager

 /// <summary>
 ///     Class Constructor
 /// </summary>
 /// <param name="dynamoModel"></param>
 /// <param name="searchPath">The path to search for definitions</param>
 public CustomNodeManager(DynamoModel dynamoModel, string searchPath)
 {
     this.dynamoModel = dynamoModel;
     SearchPath = new ObservableCollection<string> { searchPath };
     NodeInfos = new ObservableDictionary<Guid, CustomNodeInfo>();
     AddDirectoryToSearchPath(DynamoPathManager.Instance.CommonDefinitions);
 }
开发者ID:RobertiF,项目名称:Dynamo,代码行数:12,代码来源:CustomNodeManager.cs


示例7: CefCommands

 public CefCommands(PackageLoader loader, DynamoModel model)
 {
     this.ProductName = !string.IsNullOrEmpty(model.HostName) ? model.HostName : "Dynamo"; 
     this.Loader = loader;
     this.Model = model;
     this.Client = new DynamoPackagesUIClient();
 }
开发者ID:DynamoDS,项目名称:Dynamo,代码行数:7,代码来源:CefCommands.cs


示例8: Start

        //Service start
        public static void Start(DynamoModel dynamoModel)
        {
            string appVersion = Process.GetCurrentProcess().ProcessName + "-"
                                + UpdateManager.UpdateManager.Instance.ProductVersion.ToString();


            CSharpAnalytics.MeasurementConfiguration mc = new MeasurementConfiguration(ANALYTICS_PROPERTY,
                "Dynamo", appVersion);

            sessionID = Guid.NewGuid().ToString();
            loggerImpl = new Log("Dynamo", userID, sessionID);

            
            CSharpAnalytics.AutoMeasurement.Start(mc);
            client = AutoMeasurement.Client;

            if (IS_VERBOSE_DIAGNOSTICS)
            {
                AutoMeasurement.DebugWriter = d => Debug.WriteLine(d);
            }

            started = true;

            // The following starts the heartbeat, do not remove this 
            // because of the unreferenced "heartbeat" variable.

// ReSharper disable UnusedVariable
            var heartbeat = Heartbeat.GetInstance(dynamoModel);
// ReSharper restore UnusedVariable

        }
开发者ID:whztt07,项目名称:Dynamo,代码行数:32,代码来源:Logger.cs


示例9: EngineController

        public EngineController(DynamoModel dynamoModel, string geometryFactoryFileName)
        {
            this.dynamoModel = dynamoModel;

            // Create a core which is used for parsing code and loading libraries
            libraryCore = new ProtoCore.Core(new Options()
            {
                RootCustomPropertyFilterPathName = string.Empty
            });
            libraryCore.Executives.Add(Language.kAssociative,new ProtoAssociative.Executive(libraryCore));
            libraryCore.Executives.Add(Language.kImperative, new ProtoImperative.Executive(libraryCore));
            libraryCore.ParsingMode = ParseMode.AllowNonAssignment;

            libraryServices = new LibraryServices(libraryCore);
            libraryServices.LibraryLoading += this.LibraryLoading;
            libraryServices.LibraryLoadFailed += this.LibraryLoadFailed;
            libraryServices.LibraryLoaded += this.LibraryLoaded;

            liveRunnerServices = new LiveRunnerServices(dynamoModel, this, geometryFactoryFileName);
            liveRunnerServices.ReloadAllLibraries(libraryServices.ImportedLibraries);

            codeCompletionServices = new CodeCompletionServices(LiveRunnerCore);

            astBuilder = new AstBuilder(dynamoModel, this);
            syncDataManager = new SyncDataManager();

            dynamoModel.NodeDeleted += NodeDeleted;
        }
开发者ID:whztt07,项目名称:Dynamo,代码行数:28,代码来源:EngineController.cs


示例10: PackageManagerViewModel

        /// <summary>
        /// Constructor
        /// </summary>
        /// <param name="dynamoViewModel"></param>
        /// <param name="model"></param>
        /// <param name="address"></param>
        public PackageManagerViewModel(PackageLoader loader, DynamoModel model, string address)
        {
            PkgMgrCommands = new PackageManagerCommands(loader, model);

            var path = this.GetType().Assembly.Location;
            var config = ConfigurationManager.OpenExeConfiguration(path);
            this.Address = PACKAGE_MANAGER_URL + "/#/" + address;
        }
开发者ID:DynamoDS,项目名称:Dynamo,代码行数:14,代码来源:PackageManagerViewModel.cs


示例11: ConvertNodesToCode

        public static string ConvertNodesToCode(DynamoModel dynamoModel, IEnumerable<NodeModel> nodeList)
        {
            var astBuilder = new AstBuilder(dynamoModel, null);
            var astNodes = astBuilder.CompileToAstNodes(nodeList, false);

            string code = GraphToDSCompiler.GraphUtilities.ASTListToCode(astNodes);
            return code;
        }
开发者ID:jbenoit44,项目名称:Dynamo,代码行数:8,代码来源:NodeToCode.cs


示例12: ConvertNodesToCode

        public static string ConvertNodesToCode(DynamoModel dynamoModel, IEnumerable<NodeModel> nodeList)
        {
            var astBuilder = new AstBuilder(dynamoModel, null);
            var astNodes = astBuilder.CompileToAstNodes(nodeList, false);

            var codeGen = new ProtoCore.CodeGenDS(astNodes);
            return codeGen.GenerateCode();
        }
开发者ID:whztt07,项目名称:Dynamo,代码行数:8,代码来源:NodeToCode.cs


示例13: Watch3DViewModelStartupParams

 public Watch3DViewModelStartupParams(DynamoModel model)
 {
     Model = model;
     Scheduler = model.Scheduler;
     Logger = model.Logger;
     Preferences = model.PreferenceSettings;
     EngineControllerManager = model;
 }
开发者ID:YanmengLi,项目名称:Dynamo,代码行数:8,代码来源:DefaultWatch3DViewModel.cs


示例14: OnModelCommandCompleted

        void OnModelCommandCompleted(DynamoModel.RecordableCommand command)
        {
            var name = command.GetType().Name;
            switch (name)
            {
                case "OpenFileCommand":
                    this.AddToRecentFiles((command as DynamoModel.OpenFileCommand).XmlFilePath);
                    this.VisualizationManager.UnPause();
                    break;

                case "MutateTestCommand":
                    var mutatorDriver = new Dynamo.TestInfrastructure.MutatorDriver(this);
                    mutatorDriver.RunMutationTests();
                    break;

                case "SelectInRegionCommand":
                    var selectC = command as DynamoModel.SelectInRegionCommand;
                    CurrentSpaceViewModel.SelectInRegion(selectC.Region, selectC.IsCrossSelection);
                    break;

                case "DragSelectionCommand":
                    var dragC = command as DynamoModel.DragSelectionCommand;

                    if (DynamoModel.DragSelectionCommand.Operation.BeginDrag == dragC.DragOperation)
                        CurrentSpaceViewModel.BeginDragSelection(dragC.MouseCursor);
                    else
                        CurrentSpaceViewModel.EndDragSelection(dragC.MouseCursor);
                    break;

                case "DeleteModelCommand":
                case "CreateNodeCommand":
                case "CreateNoteCommand":
                case "UndoRedoCommand":
                case "ModelEventCommand":
                case "UpdateModelValueCommand":
                case "ConvertNodesToCodeCommand":
                    UndoCommand.RaiseCanExecuteChanged();
                    RedoCommand.RaiseCanExecuteChanged();
                    break;

                case "SwitchTabCommand":
                    if (command.IsInPlaybackMode)
                        RaisePropertyChanged("CurrentWorkspaceIndex");
                    break;

                case "RunCancelCommand":
                case "ForceRunCancelCommand":
                case "SelectModelCommand":
                case "MakeConnectionCommand":
                case "CreateCustomNodeCommand":
                    // for this commands there is no need
                    // to do anything after execution
                    break;

                default:
                    throw new InvalidOperationException("Unhandled command name");
            }
        }
开发者ID:whztt07,项目名称:Dynamo,代码行数:58,代码来源:DynamoCommands.cs


示例15: PublishCommands

 public PublishCommands(PackageLoader loader, DynamoModel model) 
 {
     fileCompressor = new MutatingFileCompressor();
     //customNodeDefinitions = new List<CustomNodeDefinition>();
     //Dependencies = new List<PackageDependency>();
     //Assemblies = new List<PackageAssembly>();
     //PackageAssemblyNodes = new List<TypeLoadData>();
     //FilesToUpload = new List<string>();
 }
开发者ID:Benglin,项目名称:Dynamo,代码行数:9,代码来源:PublishCommands.cs


示例16: ExecutionSession

 /// <summary>
 /// Constructs a new execution session.
 /// </summary>
 public ExecutionSession(Scheduler.UpdateGraphAsyncTask updateTask, DynamoModel model, string geometryFactoryPath)
 {
     CurrentWorkspacePath = updateTask.TargetedWorkspace.FileName;
     pathManager = model.PathManager;
     parameters[ParameterKeys.GeometryFactory] = geometryFactoryPath;
     parameters[ParameterKeys.MajorVersion] = pathManager.MajorFileVersion;
     parameters[ParameterKeys.MinorVersion] = pathManager.MinorFileVersion;
     parameters[ParameterKeys.NumberFormat] = model.PreferenceSettings.NumberFormat;
 }
开发者ID:sh4nnongoh,项目名称:Dynamo,代码行数:12,代码来源:ExecutionSession.cs


示例17: ExecuteCommand

        public void ExecuteCommand(DynamoModel.RecordableCommand command)
        {
            if (null != this.automationSettings)
                this.automationSettings.RecordCommand(command);

            if (Model.DebugSettings.VerboseLogging)
                model.Logger.Log("Command: " + command);

            this.model.ExecuteCommand(command);
        }
开发者ID:whztt07,项目名称:Dynamo,代码行数:10,代码来源:DynamoCommands.cs


示例18: GetInstance

        public static Heartbeat GetInstance(DynamoModel dynModel)
        {
            lock (typeof(Heartbeat))
            {
                if (instance == null)
                    instance = new Heartbeat(dynModel);
            }

            return instance;
        }
开发者ID:whztt07,项目名称:Dynamo,代码行数:10,代码来源:Heartbeat.cs


示例19: PackageLoader

        public PackageLoader(DynamoModel dynamoModel, string overridePackageDirectory)
        {
            this.dynamoModel = dynamoModel;

            this.RootPackagesDirectory = overridePackageDirectory;
            if (!Directory.Exists(this.RootPackagesDirectory))
            {
                Directory.CreateDirectory(this.RootPackagesDirectory);
            }
        }
开发者ID:RobertiF,项目名称:Dynamo,代码行数:10,代码来源:PackageLoader.cs


示例20: CustomNodeWorkspaceModel

        public CustomNodeWorkspaceModel(DynamoModel dynamoModel, 
            String name, String category, string description, IEnumerable<NodeModel> e, IEnumerable<ConnectorModel> c, double x, double y)
            : base(dynamoModel, name, e, c, x, y)
        {
            WatchChanges = true;
            HasUnsavedChanges = false;
            Category = category;
            Description = description;

            PropertyChanged += OnPropertyChanged;
        }
开发者ID:RobertiF,项目名称:Dynamo,代码行数:11,代码来源:CustomNodeWorkspaceModel.cs



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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