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


C# DynamoModel.GetPackageManagerExtension方法代码示例

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


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

示例1: DynamoViewModel

        protected DynamoViewModel(StartConfiguration startConfiguration)
        {
            this.ShowLogin = startConfiguration.ShowLogin;

            // initialize core data structures
            this.model = startConfiguration.DynamoModel;
            this.model.CommandStarting += OnModelCommandStarting;
            this.model.CommandCompleted += OnModelCommandCompleted;

            UsageReportingManager.Instance.InitializeCore(this);
            this.WatchHandler = startConfiguration.WatchHandler;
            var pmExtension = model.GetPackageManagerExtension();
            this.PackageManagerClientViewModel = new PackageManagerClientViewModel(this, pmExtension.PackageManagerClient);
            this.SearchViewModel = new SearchViewModel(this);

            // Start page should not show up during test mode.
            this.ShowStartPage = !DynamoModel.IsTestMode;

            this.BrandingResourceProvider = startConfiguration.BrandingResourceProvider ?? new DefaultBrandingResourceProvider();

            // commands should be initialized before adding any WorkspaceViewModel
            InitializeDelegateCommands();

            //add the initial workspace and register for future 
            //updates to the workspaces collection
            var homespaceViewModel = new HomeWorkspaceViewModel(model.CurrentWorkspace as HomeWorkspaceModel, this);
            workspaces.Add(homespaceViewModel);
            currentWorkspaceViewModel = homespaceViewModel;

            model.WorkspaceAdded += WorkspaceAdded;
            model.WorkspaceRemoved += WorkspaceRemoved;

            SubscribeModelCleaningUpEvent();
            SubscribeModelUiEvents();
            SubscribeModelChangedHandlers();
            SubscribeUpdateManagerHandlers();

            InitializeAutomationSettings(startConfiguration.CommandFilePath);

            SubscribeLoggerHandlers();

            DynamoSelection.Instance.Selection.CollectionChanged += SelectionOnCollectionChanged;

            InitializeRecentFiles();

            UsageReportingManager.Instance.PropertyChanged += CollectInfoManager_PropertyChanged;

            WatchIsResizable = false;

            SubscribeDispatcherHandlers();

            RenderPackageFactoryViewModel = new RenderPackageFactoryViewModel(Model.PreferenceSettings);
            RenderPackageFactoryViewModel.PropertyChanged += RenderPackageFactoryViewModel_PropertyChanged;

            BackgroundPreviewViewModel = startConfiguration.Watch3DViewModel;
            BackgroundPreviewViewModel.PropertyChanged += Watch3DViewModelPropertyChanged;
            RegisterWatch3DViewModel(BackgroundPreviewViewModel, RenderPackageFactoryViewModel.Factory);
        }
开发者ID:norbertzsiros,项目名称:Dynamo,代码行数:58,代码来源:DynamoViewModel.cs

示例2: DynamoViewModel

        protected DynamoViewModel(StartConfiguration startConfiguration)
        {
            this.ShowLogin = startConfiguration.ShowLogin;

            // initialize core data structures
            this.model = startConfiguration.DynamoModel;
            this.model.CommandStarting += OnModelCommandStarting;
            this.model.CommandCompleted += OnModelCommandCompleted;

            UsageReportingManager.Instance.InitializeCore(this);
            this.WatchHandler = startConfiguration.WatchHandler;
            var pmExtension = model.GetPackageManagerExtension();
            this.PackageManagerClientViewModel = new PackageManagerClientViewModel(this, pmExtension.PackageManagerClient);
            this.SearchViewModel = new SearchViewModel(this);

            // Start page should not show up during test mode.
            this.ShowStartPage = !DynamoModel.IsTestMode;

            this.BrandingResourceProvider = startConfiguration.BrandingResourceProvider ?? new DefaultBrandingResourceProvider();

            //add the initial workspace and register for future 
            //updates to the workspaces collection
            var homespaceViewModel = new HomeWorkspaceViewModel(model.CurrentWorkspace as HomeWorkspaceModel, this);
            workspaces.Add(homespaceViewModel);
            currentWorkspaceViewModel = homespaceViewModel;

            model.WorkspaceAdded += WorkspaceAdded;
            model.WorkspaceRemoved += WorkspaceRemoved;

            SubscribeModelCleaningUpEvent();
            SubscribeModelUiEvents();
            SubscribeModelChangedHandlers();
            SubscribeUpdateManagerHandlers();

            InitializeAutomationSettings(startConfiguration.CommandFilePath);

            InitializeDelegateCommands();

            SubscribeLoggerHandlers();

            DynamoSelection.Instance.Selection.CollectionChanged += SelectionOnCollectionChanged;

            InitializeRecentFiles();

            UsageReportingManager.Instance.PropertyChanged += CollectInfoManager_PropertyChanged;

            WatchIsResizable = false;

            SubscribeDispatcherHandlers();

            RenderPackageFactoryViewModel = new RenderPackageFactoryViewModel(Model.PreferenceSettings);
            RenderPackageFactoryViewModel.PropertyChanged += RenderPackageFactoryViewModel_PropertyChanged;
            
            var backgroundPreviewParams = new Watch3DViewModelStartupParams(Model, this, Resources.BackgroundPreviewName);

            // TODO: http://adsk-oss.myjetbrains.com/youtrack/issue/MAGN-8736
            Watch3DViewModelBase watch3DViewModel;
            try
            {
                watch3DViewModel = HelixWatch3DViewModel.Start(backgroundPreviewParams);
            }
            catch (Exception ex)
            {
                Model.Logger.Log(ex.Message);
                Model.Logger.Log("Failed to create Watch3DViewModel. Creating base view model.");

                watch3DViewModel = Watch3DViewModelBase.Start(backgroundPreviewParams);
            }

            BackgroundPreviewViewModel = watch3DViewModel;
            Watch3DViewModels.Add(watch3DViewModel);
            watch3DViewModel.PropertyChanged += Watch3DViewModelPropertyChanged;
        }
开发者ID:joespiff,项目名称:Dynamo,代码行数:73,代码来源:DynamoViewModel.cs


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