當前位置: 首頁>>代碼示例>>C#>>正文


C# ExportProvider.GetExport方法代碼示例

本文整理匯總了C#中System.ComponentModel.Composition.Hosting.ExportProvider.GetExport方法的典型用法代碼示例。如果您正苦於以下問題:C# ExportProvider.GetExport方法的具體用法?C# ExportProvider.GetExport怎麽用?C# ExportProvider.GetExport使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在System.ComponentModel.Composition.Hosting.ExportProvider的用法示例。


在下文中一共展示了ExportProvider.GetExport方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: ExampleForm

		public ExampleForm(ExportProvider exportProvider)
		{
            _shaderFragments = exportProvider.GetExport<ShaderFragmentArchive.Archive>().Value;
            _nodeCreator = exportProvider.GetExport<NodeEditorCore.IShaderFragmentNodeCreator>().Value;
            _modelConversion = exportProvider.GetExport<NodeEditorCore.IModelConversion>().Value;

			InitializeComponent();

            _hyperGraphModel = new HyperGraph.GraphModel();
            _hyperGraphModel.CompatibilityStrategy = _nodeCreator.CreateCompatibilityStrategy();

            _graphAdapter = new HyperGraph.GraphControl();
            _graphAdapter.Attach(graphControl);
            _graphAdapter.HighlightCompatible = true;
            _graphAdapter.LargeGridStep = 160F;
            _graphAdapter.LargeStepGridColor = System.Drawing.Color.FromArgb(((int)(((byte)(90)))), ((int)(((byte)(90)))), ((int)(((byte)(90)))));
            _graphAdapter.ShowLabels = false;
            _graphAdapter.SmallGridStep = 20F;
            _graphAdapter.SmallStepGridColor = System.Drawing.Color.FromArgb(((int)(((byte)(80)))), ((int)(((byte)(80)))), ((int)(((byte)(80)))));

            _graphAdapter.Model = _hyperGraphModel;
            _graphAdapter.Selection = new GraphSelection();
            _graphAdapter.Selection.SelectionChanged += OnFocusChanged;

            graphControl.MouseEnter += OnGraphMouseEnter;
            graphControl.Paint += graphControl_Paint;

            _tabGroupTextureNode = new RibbonTabGroup(_ribbon, (uint)RibbonMarkupCommands.cmdTabGroupTextureNode);

            _showLabels = new RibbonLib.Controls.RibbonCheckBox(_ribbon, (uint)RibbonMarkupCommands.cmdShowLabels);
            _showLabels.ExecuteEvent += new EventHandler<ExecuteEventArgs>(OnShowLabelsChanged);

            _generateTestScript = new RibbonLib.Controls.RibbonButton(_ribbon, (uint)RibbonMarkupCommands.cmdButtonTestScript);
            _generateTestScript.ExecuteEvent += new EventHandler<ExecuteEventArgs>(OnGenerateTestScript);

            _saveAsButton = new RibbonLib.Controls.RibbonButton(_ribbon, (uint)RibbonMarkupCommands.cmdSaveAs);
            _saveAsButton.ExecuteEvent += new EventHandler<ExecuteEventArgs>(OnSaveAs);

            _loadButton = new RibbonLib.Controls.RibbonButton(_ribbon, (uint)RibbonMarkupCommands.cmdLoad);
            _loadButton.ExecuteEvent += new EventHandler<ExecuteEventArgs>(OnLoad);

            var fragmentTreeModel = exportProvider.GetExport<NodeEditorCore.ShaderFragmentArchiveModel>().Value;
            _fragmentTree.Model = new Aga.Controls.Tree.SortedTreeModel(fragmentTreeModel);
            _fragmentTree.ItemDrag += new ItemDragEventHandler(OnFragmentTreeItemDrag);
            _fragmentTree.NodeMouseDoubleClick += new EventHandler<Aga.Controls.Tree.TreeNodeAdvMouseEventArgs>(OnFragmentTreeItemDoubleClick);

            // _materialParametersGrid.SelectedObject = new DictionaryPropertyGridAdapter(_document.PreviewMaterialState);

            try
            {
                LoadFile("defaultload.sh");
            }
            catch(System.Exception) {}
		}
開發者ID:coreafive,項目名稱:XLE,代碼行數:54,代碼來源:ExampleForm.cs


注:本文中的System.ComponentModel.Composition.Hosting.ExportProvider.GetExport方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。