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


C# ObservableDictionary.Get方法代码示例

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


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

示例1: Engine

        public Engine( ObservableDictionary<string, D3D11HwndDescription> d3d11HwndDescriptions )
        {
            Console.WriteLine( "\nMojo initializing...\n" );

            try
            {

                D3D11.Initialize( out mDxgiFactory, out mD3D11Device );
                //Cuda.Initialize( mD3D11Device );
                //Thrust.Initialize();

                TileManager = new TileManager( new Interop.TileManager( mD3D11Device, mD3D11Device.ImmediateContext, Constants.ConstParameters ) );

                Tools = new ObservableDictionary<ViewerMode, ObservableDictionary<ToolMode, ITool>>
                        {
                            {
                                ViewerMode.TileManager2D,
                                new ObservableDictionary< ToolMode, ITool >
                                {
                                    { ToolMode.Null, new NullTool() },
                                    { ToolMode.AdjustSegmentation, new AdjustSegmentationTool( TileManager, this ) },
                                    { ToolMode.MergeSegmentation, new MergeSegmentationTool( TileManager, this ) },
                                    { ToolMode.DrawMergeSegmentation, new DrawMergeSegmentationTool( TileManager, this ) },
                                    { ToolMode.SplitSegmentation, new SplitSegmentationTool( TileManager, this ) }
                                }
                                }
                        };

                RenderingStrategies = new ObservableDictionary<ViewerMode, ObservableDictionary<ToolMode, IRenderingStrategy>>
                                      {
                                          {
                                              ViewerMode.TileManager2D,
                                              new ObservableDictionary< ToolMode, IRenderingStrategy >
                                              {
                                                  { ToolMode.Null, new NullRenderingStrategy( mD3D11Device, mD3D11Device.ImmediateContext ) },
                                                  { ToolMode.AdjustSegmentation, new AdjustSegmentationRenderingStrategy( mD3D11Device, mD3D11Device.ImmediateContext, TileManager ) },
                                                  { ToolMode.MergeSegmentation, new MergeSegmentationRenderingStrategy( mD3D11Device, mD3D11Device.ImmediateContext, TileManager ) },
                                                  { ToolMode.DrawMergeSegmentation, new DrawMergeSegmentationRenderingStrategy( mD3D11Device, mD3D11Device.ImmediateContext, TileManager ) },
                                                  { ToolMode.SplitSegmentation, new SplitSegmentationRenderingStrategy( mD3D11Device, mD3D11Device.ImmediateContext, TileManager ) }
                                              }
                                              }
                                      };

                Viewers = new ObservableDictionary<ViewerMode, Viewer>
                          {
                              {
                                  ViewerMode.TileManager2D,
                                  new Viewer
                                  {
                                      D3D11RenderingPane = new D3D11RenderingPane( mDxgiFactory,
                                                                                   mD3D11Device,
                                                                                   mD3D11Device.ImmediateContext,
                                                                                   d3d11HwndDescriptions.Get( "TileManager2D" ) )
                                                           {
                                                               RenderingStrategy = RenderingStrategies.Internal[ ViewerMode.TileManager2D ].Internal[ ToolMode.Null ]
                                                           },
                                      UserInputHandler = Tools.Internal[ ViewerMode.TileManager2D ].Internal[ ToolMode.Null ]
                                  }
                                  }
                          };
            }
            catch ( Exception e )
            {
                String errorMessage = "Error opening main window:\n\n" + e.Message + "\n\nYou might want to try one of the following:\n - Install the \"DirectX End-User Runtime\" (from the Microsoft website).\n - Install the latest graphics drivers for your graphics card.\n - Reinstall the latest Mojo release.";
                MessageBox.Show( errorMessage, "Initialization Error", MessageBoxButton.OK, MessageBoxImage.Error );
                Console.WriteLine( errorMessage );
                Application.Current.Shutdown( 1 );
            }
        }
开发者ID:Rhoana,项目名称:Mojo,代码行数:69,代码来源:Engine.cs


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