Версия TreeGrid для януса.
Inheritance: TreeGrid.TreeGrid
Exemplo n.º 1
0
#pragma warning restore 169

		public NavigationDummyForm([NotNull] IServiceProvider provider)
		{
			if (provider == null)
				throw new ArgumentNullException(nameof(provider));

			_provider = provider;

			this.AssignServices(provider);

			InitializeComponent();

			TabText = SR.Navigation.NavTree.DockName;
			Text = SR.Navigation.NavTree.DockName;

			_contextMenuStrip = new ContextMenuStrip();

			#region Инициализация грида

			_treeGrid = new JanusGrid
			{
				AllowDrop = true,
				ContextMenuStrip = _contextMenuStrip,
				Dock = DockStyle.Fill,
				Indent = Config.Instance.ForumDisplayConfig.GridIndent,
				FullRowSelect = true,
				HideSelection = false,
				MultiSelect = false
			};

			_treeGrid.Columns.AddRange(
				new[]
				{
					new ColumnHeader
						{
							Name = "Name",
							Text = SR.Navigation.NavTree.NameColumn
						},
					new ColumnHeader
						{
							Name = "Info",
							Text = SR.Navigation.NavTree.InfoColumn,
							TextAlign = HorizontalAlignment.Right
						}
				});

			_treeGrid.ColumnsWidth = Config.Instance.NavTreeColumnWidth;

			_treeGrid.AfterActivateNode += TreeGridAfterActivateNode;
			_treeGrid.ColumnWidthChanged += TreeGridColumnWidthChanged;
			_treeGrid.MouseDown += OnTreeGridMouseDown;
			_treeGrid.MouseMove += OnTreeGridMouseMove;
			_treeGrid.MouseUp += OnTreeGridMouseUp;
			_treeGrid.DragEnter += OnTreeGridDragEnter;
			_treeGrid.DragOver += OnTreeGridDragOver;
			//_treeGrid.DragDrop += OnTreeGridDragDrop;

			Controls.Add(_treeGrid);
			#endregion

			_menuGenerator = new StripMenuGenerator(_provider, _contextMenuStrip, "NavigationBox.ContextMenu");

			Features.Instance.AfterFeatureActivate += FeaturesAfterFeatureActivate;

			UpdateStyle();
			StyleConfig.StyleChange += StyleConfigStyleChange;

			_eventsSubscription = EventBrokerHelper.SubscribeEventHandlers(this, _provider);
		}
Exemplo n.º 2
0
        // ReSharper restore RedundantDefaultFieldInitializer

        public NavigationDummyForm([NotNull] IServiceProvider provider)
        {
            if (provider == null)
            {
                throw new ArgumentNullException("provider");
            }

            _provider = provider;

            this.AssignServices(provider);

            InitializeComponent();

            TabText = SR.Navigation.NavTree.DockName;
            Text    = SR.Navigation.NavTree.DockName;

            _contextMenuStrip = new ContextMenuStrip();

            #region Инициализация грида

            _treeGrid = new JanusGrid
            {
                AllowDrop        = true,
                ContextMenuStrip = _contextMenuStrip,
                Dock             = DockStyle.Fill,
                Indent           = Config.Instance.ForumDisplayConfig.GridIndent,
                FullRowSelect    = true,
                HideSelection    = false,
                MultiSelect      = false
            };

            _treeGrid.Columns.AddRange(
                new[]
            {
                new ColumnHeader
                {
                    Name = "Name",
                    Text = SR.Navigation.NavTree.NameColumn
                },
                new ColumnHeader
                {
                    Name      = "Info",
                    Text      = SR.Navigation.NavTree.InfoColumn,
                    TextAlign = HorizontalAlignment.Right
                }
            });

            _treeGrid.ColumnsWidth = Config.Instance.NavTreeColumnWidth;

            _treeGrid.AfterActivateNode  += TreeGridAfterActivateNode;
            _treeGrid.ColumnWidthChanged += TreeGridColumnWidthChanged;
            _treeGrid.MouseDown          += OnTreeGridMouseDown;
            _treeGrid.MouseMove          += OnTreeGridMouseMove;
            _treeGrid.MouseUp            += OnTreeGridMouseUp;
            _treeGrid.DragEnter          += OnTreeGridDragEnter;
            _treeGrid.DragOver           += OnTreeGridDragOver;
            //_treeGrid.DragDrop += OnTreeGridDragDrop;

            Controls.Add(_treeGrid);
            #endregion

            _menuGenerator = new StripMenuGenerator(_provider, _contextMenuStrip, "NavigationBox.ContextMenu");

            Features.Instance.AfterFeatureActivate += FeaturesAfterFeatureActivate;

            UpdateStyle();
            StyleConfig.StyleChange += StyleConfigStyleChange;

            _eventsSubscription = EventBrokerHelper.SubscribeEventHandlers(this, _provider);
        }