예제 #1
0
        public ForumsAggregatesService([NotNull] IServiceProvider provider)
        {
            if (provider == null)
            {
                throw new ArgumentNullException("provider");
            }

            UpdateAggregates();

            _eventsSubscription = EventBrokerHelper.SubscribeEventHandlers(this, provider);
        }
        /// <summary>
        /// Activates part.
        /// </summary>
        public void Activate()
        {
            if (_isActivated)
            {
                return;
            }

            _eventHandlersSubscription = EventBrokerHelper.SubscribeEventHandlers(this, ServiceProvider);

            ActivateCore();

            _isActivated = true;
        }
예제 #3
0
        private ForumDummyForm(IServiceProvider provider)
        {
            _serviceManager = new ServiceManager(provider);
            _asyncOperation = AsyncHelper.CreateOperation();

            _serviceManager.Publish <IDefaultCommandService>(
                new DefaultCommandService("Janus.Forum.ReplyMessage"));

            this.AssignServices(provider);

            InitializeComponent();

            SetPositionViewMsgArea(Config.Instance.MsgPosition);
            CustomInitializeComponent();

            _eventsSubscription = EventBrokerHelper.SubscribeEventHandlers(this, _serviceManager);
        }
예제 #4
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);
        }