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


C# LibraryServices类代码示例

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


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

示例1: 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

示例2: CodeBlockNodeModel

 public CodeBlockNodeModel(LibraryServices libraryServices)
 {
     ArgumentLacing = LacingStrategy.Disabled;
     this.libraryServices = libraryServices;
     this.libraryServices.LibraryLoaded += LibraryServicesOnLibraryLoaded;
     this.ElementResolver = new ElementResolver();
 }
开发者ID:rafatahmed,项目名称:Dynamo,代码行数:7,代码来源:CodeBlockNode.cs

示例3: CodeBlockNodeModel

 /// <summary>
 ///     Initilizes a new instance of the <see cref="CodeBlockNodeModel"/> class
 /// </summary>
 /// <param name="libraryServices"><see cref="LibraryServices"/> object to manage
 ///  builtin libraries as well as imported libraries</param>
 public CodeBlockNodeModel(LibraryServices libraryServices)
 {
     ArgumentLacing = LacingStrategy.Disabled;
     this.libraryServices = libraryServices;
     this.ElementResolver = new ElementResolver();
     ProcessCodeDirect();
 }
开发者ID:Conceptual-Design,项目名称:Dynamo,代码行数:12,代码来源:CodeBlockNode.cs

示例4: LoadWorkspaceFromJson

        /// <summary>
        /// Load a WorkspaceModel from json. If the WorkspaceModel is a HomeWorkspaceModel
        /// it will be set as the current workspace.
        /// </summary>
        /// <param name="json"></param>
        public static WorkspaceModel LoadWorkspaceFromJson(string json, LibraryServices libraryServices,
            EngineController engineController, DynamoScheduler scheduler, NodeFactory factory,
            bool isTestMode, bool verboseLogging, CustomNodeManager manager)
        {
            var settings = new JsonSerializerSettings
            {
                Error = (sender, args) =>
                {
                    args.ErrorContext.Handled = true;
                    Console.WriteLine(args.ErrorContext.Error);
                },
                ReferenceLoopHandling = ReferenceLoopHandling.Ignore,
                TypeNameHandling = TypeNameHandling.Auto,
                Formatting = Formatting.Indented,
                Converters = new List<JsonConverter>{
                        new ConnectorConverter(),
                        new AnnotationConverter(),
                        new WorkspaceConverter(engineController, scheduler, factory, isTestMode, verboseLogging),
                        new NodeModelConverter(manager, libraryServices),
                    },
                ReferenceResolverProvider = () => { return new IdReferenceResolver(); }
            };

            var result = ReplaceTypeDeclarations(json, true);
            var ws = JsonConvert.DeserializeObject<WorkspaceModel>(result, settings);

            return ws;
        }
开发者ID:Conceptual-Design,项目名称:Dynamo,代码行数:33,代码来源:Workspaces.cs

示例5: CodeBlockNodeModel

        public CodeBlockNodeModel(string userCode, Guid guid, double xPos, double yPos, LibraryServices libraryServices, ElementResolver resolver)
        {
            ArgumentLacing = LacingStrategy.Disabled;
            X = xPos;
            Y = yPos;
            this.libraryServices = libraryServices;
            this.ElementResolver = resolver;
            code = userCode;
            GUID = guid;
            ShouldFocus = false;

            ProcessCodeDirect();
        }
开发者ID:AutodeskFractal,项目名称:Dynamo,代码行数:13,代码来源:CodeBlockNode.cs

示例6: Init

        public override void Init()
        {
            base.Init();

            var options = new ProtoCore.Options();
            options.RootModulePathName = string.Empty;
            libraryServicesCore = new ProtoCore.Core(options);
            libraryServicesCore.Executives.Add(ProtoCore.Language.kAssociative,
                new ProtoAssociative.Executive(libraryServicesCore));
            libraryServicesCore.Executives.Add(ProtoCore.Language.kImperative,
                new ProtoImperative.Executive(libraryServicesCore));

            libraryServices = new LibraryServices(libraryServicesCore);
        }
开发者ID:whztt07,项目名称:Dynamo,代码行数:14,代码来源:DSEvaluationViewModelTest.cs

示例7: LoadPackagesIntoDynamo

        /// <summary>
        ///     Scan the PackagesDirectory for packages and attempt to load all of them.  Beware! Fails silently for duplicates.
        /// </summary>
        public void LoadPackagesIntoDynamo( IPreferences preferences, LibraryServices libraryServices )
        {
            this.ScanAllPackageDirectories( preferences );

            foreach (var pkg in LocalPackages)
            {
                DynamoPathManager.Instance.AddResolutionPath(pkg.BinaryDirectory);
            }

            foreach (var pkg in LocalPackages)
            {
                pkg.LoadIntoDynamo(loader, logger, libraryServices);
            }
        }
开发者ID:whztt07,项目名称:Dynamo,代码行数:17,代码来源:PackageLoader.cs

示例8: EngineController

        public EngineController(DynamoController controller)
        {
            libraryServices = LibraryServices.GetInstance();
            libraryServices.LibraryLoading += this.LibraryLoading;
            libraryServices.LibraryLoadFailed += this.LibraryLoadFailed;
            libraryServices.LibraryLoaded += this.LibraryLoaded;

            liveRunnerServices = new LiveRunnerServices(this);
            liveRunnerServices.ReloadAllLibraries(libraryServices.Libraries.ToList());

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

            this.controller = controller;
            this.controller.DynamoModel.NodeDeleted += NodeDeleted;
        }
开发者ID:heegwon,项目名称:Dynamo,代码行数:16,代码来源:EngineController.cs

示例9: EngineController

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

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

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

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

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

示例10: Setup

        public override void Setup()
        {
            base.Setup();

            libraryCore = new ProtoCore.Core(new Options { RootCustomPropertyFilterPathName = string.Empty });
            libraryCore.Compilers.Add(Language.kAssociative, new ProtoAssociative.Compiler(libraryCore));
            libraryCore.Compilers.Add(Language.kImperative, new ProtoImperative.Compiler(libraryCore));
            libraryCore.ParsingMode = ParseMode.AllowNonAssignment;

            var pathResolver = new TestPathResolver();
            pathResolver.AddPreloadLibraryPath("DSCoreNodes.dll");

            var pathManager = new PathManager(new PathManagerParams
            {
                PathResolver = pathResolver
            });

            libraryServices = new LibraryServices(libraryCore, pathManager);

            RegisterEvents();
        }
开发者ID:rafatahmed,项目名称:Dynamo,代码行数:21,代码来源:LibraryTests.cs

示例11: Setup

        public override void Setup()
        {
            base.Setup();

            libraryCore = new ProtoCore.Core(new Options());
            libraryCore.Compilers.Add(Language.Associative, new ProtoAssociative.Compiler(libraryCore));
            libraryCore.Compilers.Add(Language.Imperative, new ProtoImperative.Compiler(libraryCore));
            libraryCore.ParsingMode = ParseMode.AllowNonAssignment;

            var pathResolver = new TestPathResolver();
            pathResolver.AddPreloadLibraryPath("DSCoreNodes.dll");

            var pathManager = new PathManager(new PathManagerParams
            {
                PathResolver = pathResolver
            });

            var settings = new PreferenceSettings();

            libraryServices = new LibraryServices(libraryCore, pathManager, settings);

            RegisterEvents();
        }
开发者ID:Conceptual-Design,项目名称:Dynamo,代码行数:23,代码来源:LibraryTests.cs

示例12: LoadIntoDynamo

        public void LoadIntoDynamo( DynamoLoader loader, ILogger logger, LibraryServices libraryServices)
        {
            try
            {
                this.LoadAssembliesIntoDynamo(loader, logger, libraryServices);
                this.LoadCustomNodesIntoDynamo( loader );
                this.EnumerateAdditionalFiles();
                
                Loaded = true;
            }
            catch (Exception e)
            {
                logger.Log("Exception when attempting to load package " + this.Name + " from " + this.RootDirectory);
                logger.Log(e.GetType() + ": " + e.Message);
            }

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

示例13: CodeBlockNodeSearchElement

 public CodeBlockNodeSearchElement(TypeLoadData data, LibraryServices manager)
     : base(data)
 {
     libraryServices = manager;
 }
开发者ID:tauyoung,项目名称:Dynamo,代码行数:5,代码来源:CodeBlockNodeSearchElement.cs

示例14: CodeBlockNodeModel

 public CodeBlockNodeModel(string userCode, double xPos, double yPos, LibraryServices libraryServices)
     : this(userCode, Guid.NewGuid(), xPos, yPos, libraryServices) { }
开发者ID:RevitLution,项目名称:Dynamo,代码行数:2,代码来源:CodeBlockNode.cs

示例15: LibraryLoadFailed

 /// <summary>
 /// LibraryLoadFailed event handler.
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void LibraryLoadFailed(object sender, LibraryServices.LibraryLoadFailedEventArgs e)
 {
 }
开发者ID:heegwon,项目名称:Dynamo,代码行数:8,代码来源:EngineController.cs


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