public void SetUp()
        {
            mocks = new MockRepository();
            contextMenuBuilderProvider = mocks.StrictMock <IContextMenuBuilderProvider>();
            mocks.ReplayAll();

            chartLegendView = new ChartLegendView(contextMenuBuilderProvider);

            var treeViewControl    = TypeUtils.GetField <TreeViewControl>(chartLegendView, "treeViewControl");
            var treeNodeInfoLookup = TypeUtils.GetField <Dictionary <Type, TreeNodeInfo> >(treeViewControl, "tagTypeTreeNodeInfoLookup");

            info = treeNodeInfoLookup[typeof(ChartDataContext)];
        }
        public override void Setup()
        {
            mocks = new MockRepository();
            contextMenuBuilderProvider = mocks.Stub <IContextMenuBuilderProvider>();
            mocks.ReplayAll();

            mapLegendView = new MapLegendView(contextMenuBuilderProvider);

            var treeViewControl    = TypeUtils.GetField <TreeViewControl>(mapLegendView, "treeViewControl");
            var treeNodeInfoLookup = TypeUtils.GetField <Dictionary <Type, TreeNodeInfo> >(treeViewControl, "tagTypeTreeNodeInfoLookup");

            info = treeNodeInfoLookup[typeof(MapDataCollectionContext)];
        }
Beispiel #3
0
        /// <summary>
        /// Creates a new instance of <see cref="MapLegendView"/>.
        /// </summary>
        /// <param name="contextMenuBuilderProvider">The <see cref="IContextMenuBuilderProvider"/> to create context menus.</param>
        /// <exception cref="ArgumentNullException">Thrown when <paramref name="contextMenuBuilderProvider"/> is <c>null</c>.</exception>
        public MapLegendView(IContextMenuBuilderProvider contextMenuBuilderProvider)
        {
            if (contextMenuBuilderProvider == null)
            {
                throw new ArgumentNullException(nameof(contextMenuBuilderProvider),
                                                $@"Cannot create a {nameof(MapLegendView)} when the context menu builder provider is null.");
            }

            this.contextMenuBuilderProvider = contextMenuBuilderProvider;
            InitializeComponent();

            RegisterTreeNodeInfos();

            treeViewControl.SelectedDataChanged += TreeViewControlSelectedDataChanged;
        }
Beispiel #4
0
 public void SetUp()
 {
     mocks = new MockRepository();
     contextMenuBuilderProvider = mocks.StrictMock <IContextMenuBuilderProvider>();
     mocks.ReplayAll();
 }