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

C# LibraryServices类代码示例

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

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



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


示例16: Setup

 public override void Setup()
 {
     base.Setup();
     libraryServices = CurrentDynamoModel.LibraryServices;
 }
开发者ID:sh4nnongoh,项目名称:Dynamo,代码行数:5,代码来源:DSLibraryTest.cs


示例17: LoadAssembliesIntoDynamo

        private void LoadAssembliesIntoDynamo( DynamoLoader loader, ILogger logger, LibraryServices libraryServices)
        {
            var assemblies = LoadAssembliesInBinDirectory(logger);

            // filter the assemblies
            var zeroTouchAssemblies = new List<Assembly>();
            var nodeModelAssemblies = new List<Assembly>();

            foreach (var assem in assemblies)
            {
                if (loader.ContainsNodeModelSubType(assem))
                {
                    nodeModelAssemblies.Add(assem);
                }
                else
                {
                    zeroTouchAssemblies.Add(assem);
                }
            }

            // load the zero touch assemblies
            foreach (var zeroTouchAssem in zeroTouchAssemblies)
            {
                libraryServices.ImportLibrary(zeroTouchAssem.Location, logger);
            }

            // load the node model assemblies
            foreach (var nodeModelAssem in nodeModelAssemblies)
            {
                var nodes = loader.LoadNodesFromAssembly(nodeModelAssem);
                nodes.ForEach(x => LoadedTypes.Add(x));
            }
        }
开发者ID:whztt07,项目名称:Dynamo,代码行数:33,代码来源:Package.cs


示例18: DynamoModel


//.........这里部分代码省略.........
            var userDataFolder = pathManager.GetUserDataFolder(); //Get the default user data path
            if (Directory.Exists(userDataFolder) && !PreferenceSettings.CustomPackageFolders.Contains(userDataFolder))
            {
                PreferenceSettings.CustomPackageFolders.Add(userDataFolder);
            }

            pathManager.Preferences = PreferenceSettings;


            SearchModel = new NodeSearchModel();
            SearchModel.ItemProduced +=
                node => ExecuteCommand(new CreateNodeCommand(node, 0, 0, true, true));

            NodeFactory = new NodeFactory();
            NodeFactory.MessageLogged += LogMessage;

            CustomNodeManager = new CustomNodeManager(NodeFactory, MigrationManager);
            InitializeCustomNodeManager();

            extensionManager = new ExtensionManager();
            extensionManager.MessageLogged += LogMessage;
            var extensions = config.Extensions ?? LoadExtensions();

            Loader = new NodeModelAssemblyLoader();
            Loader.MessageLogged += LogMessage;

            // Create a core which is used for parsing code and loading libraries
            var libraryCore = new ProtoCore.Core(new Options());

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

            LibraryServices = new LibraryServices(libraryCore, pathManager, PreferenceSettings);
            LibraryServices.MessageLogged += LogMessage;
            LibraryServices.LibraryLoaded += LibraryLoaded;

            ResetEngineInternal();

            AddHomeWorkspace();

            AuthenticationManager = new AuthenticationManager(config.AuthProvider);

            UpdateManager = config.UpdateManager ?? new DefaultUpdateManager(null);

            // config.UpdateManager has to be cast to IHostUpdateManager in order to extract the HostVersion and HostName
            // see IHostUpdateManager summary for more details 
            var hostUpdateManager = config.UpdateManager as IHostUpdateManager;
          
            if (hostUpdateManager != null)
            {
                HostName = hostUpdateManager.HostName;
                HostVersion = hostUpdateManager.HostVersion == null ? null : hostUpdateManager.HostVersion.ToString();
            }
            else
            {
                HostName = string.Empty;
                HostVersion = null;
            }
            
            UpdateManager.Log += UpdateManager_Log;
            if (!IsTestMode && !IsHeadless)
            {
                DefaultUpdateManager.CheckForProductUpdate(UpdateManager);
            }
开发者ID:ksobon,项目名称:Dynamo,代码行数:66,代码来源:DynamoModel.cs


示例19: DynamoModel


//.........这里部分代码省略.........
                {
                    migrator = DynamoMigratorBase.MigrateBetweenDynamoVersions(pathManager, config.PathResolver);
                }
                catch (Exception e)
                {
                    Logger.Log(e.Message);
                }

                if (migrator != null)
                {
                    var isFirstRun = this.PreferenceSettings.IsFirstRun;
                    this.PreferenceSettings = migrator.PreferenceSettings;

                    // Preserve the preference settings for IsFirstRun as this needs to be set 
                    // only by UsageReportingManager
                    this.PreferenceSettings.IsFirstRun = isFirstRun;
                }
            }

            SearchModel = new NodeSearchModel();
            SearchModel.ItemProduced +=
                node => ExecuteCommand(new CreateNodeCommand(node, 0, 0, true, true));

            NodeFactory = new NodeFactory();
            NodeFactory.MessageLogged += LogMessage;

            CustomNodeManager = new CustomNodeManager(NodeFactory, MigrationManager);
            InitializeCustomNodeManager();

            extensionManager = new ExtensionManager();
            extensionManager.MessageLogged += LogMessage;
            var extensions = config.Extensions ?? ExtensionManager.ExtensionLoader.LoadDirectory(pathManager.ExtensionsDirectory);

            if (extensions.Any())
            {
                var startupParams = new StartupParams(config.AuthProvider,
                    pathManager, CustomNodeManager);

                foreach (var ext in extensions)
                {
                    ext.Startup(startupParams);
                    ext.Load(preferences, pathManager);
                    ext.RequestLoadNodeLibrary += LoadNodeLibrary;
                    ExtensionManager.Add(ext);
                }
            }

            Loader = new NodeModelAssemblyLoader();
            Loader.MessageLogged += LogMessage;

            DisposeLogic.IsShuttingDown = false;

            // Create a core which is used for parsing code and loading libraries
            var libraryCore =
                new ProtoCore.Core(new Options { RootCustomPropertyFilterPathName = string.Empty });

            libraryCore.Compilers.Add(Language.kAssociative, new Compiler(libraryCore));
            libraryCore.Compilers.Add(Language.kImperative, new ProtoImperative.Compiler(libraryCore));
            libraryCore.ParsingMode = ParseMode.AllowNonAssignment;

            LibraryServices = new LibraryServices(libraryCore, pathManager);
            LibraryServices.MessageLogged += LogMessage;
            LibraryServices.LibraryLoaded += LibraryLoaded;

            ResetEngineInternal();

            AddHomeWorkspace();

            AuthenticationManager = new AuthenticationManager(config.AuthProvider);

            UpdateManager = config.UpdateManager ?? new DefaultUpdateManager(null);
            UpdateManager.Log += UpdateManager_Log;
            if (!IsTestMode)
            {
                DefaultUpdateManager.CheckForProductUpdate(UpdateManager);
            }
            
            Logger.Log(string.Format("Dynamo -- Build {0}", 
                                        Assembly.GetExecutingAssembly().GetName().Version));

            InitializeNodeLibrary(preferences);

            LogWarningMessageEvents.LogWarningMessage += LogWarningMessage;

            StartBackupFilesTimer();

            TraceReconciliationProcessor = this; 
            
            foreach (var ext in ExtensionManager.Extensions)
            {
                try
                {
                    ext.Ready(new ReadyParams());
                }
                catch (Exception ex)
                {
                    Logger.Log(ex.Message);
                }
            }
        }
开发者ID:junmendoza,项目名称:Dynamo,代码行数:101,代码来源:DynamoModel.cs


示例20: LibraryLoaded

 private void LibraryLoaded(object sender, LibraryServices.LibraryLoadedEventArgs e)
 {
     // Mark all nodes as dirty so that AST for the whole graph will be
     // regenerated.
     MarkNodesAsModifiedAndRequestRun(Nodes);
 }
开发者ID:joespiff,项目名称:Dynamo,代码行数:6,代码来源:HomeWorkspaceModel.cs



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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