Ejemplo n.º 1
0
		private void OnSelectedPageChanging(object sender, DevExpress.XtraTab.TabPageChangingEventArgs pageArgs)
		{
			if (pageArgs.Page == xtraTabPageWidget && _widgetControl == null)
			{
				Cursor = Cursors.WaitCursor;
				Application.DoEvents();
				_widgetControl = new WidgetSettingsControl(_columnTitle.Widget);
				xtraTabPageWidget.Controls.Add(_widgetControl);
				_widgetControl.Dock = DockStyle.Fill;
				_widgetControl.LoadData();
				_widgetControl.StateChanged += (o, e) =>
				{
					if (e.IsChecked)
						_bannerControl?.ChangeState(false);
				};
				_widgetControl.ControlClicked += OnFormClick;
				Cursor = Cursors.Default;
			}
			else if (pageArgs.Page == xtraTabPageBanner && _bannerControl == null)
			{
				Cursor = Cursors.WaitCursor;
				Application.DoEvents();
				_bannerControl = new BannerSettingsControl(_columnTitle);
				xtraTabPageBanner.Controls.Add(_bannerControl);
				_bannerControl.Dock = DockStyle.Fill;
				_bannerControl.LoadData();
				_bannerControl.StateChanged += (o, e) =>
				{
					if (e.IsChecked)
						_widgetControl?.ChangeState(false);
				};
				_bannerControl.ControlClicked += OnFormClick;
				Cursor = Cursors.Default;
			}
		}
Ejemplo n.º 2
0
		private void OnSelectedPageChanging(object sender, TabPageChangingEventArgs pageArgs)
		{
			if (pageArgs.Page == xtraTabPageWidget && _widgetControl == null)
			{
				Cursor = Cursors.WaitCursor;
				Application.DoEvents();
				_widgetControl = new WidgetSettingsControl(_folder.Widget);
				_widgetControl.Dock = DockStyle.Fill;
				pnWidgetContainer.Controls.Add(_widgetControl);
				_widgetControl.LoadData();
				_widgetControl.StateChanged += (o, e) =>
				{
					if (e.IsChecked)
						_bannerControl?.ChangeState(false);
				};
				_widgetControl.ControlClicked += OnFormClick;
				pnApllyForAllWindowsWidget.Visible = _formParameters.Type == WindowPropertiesType.None;
				ckApllyForAllWindowsWidget.Checked = _formParameters.Type == WindowPropertiesType.None && _folder.Page.Library.Settings.ApplyWidgetForAllWindows;
				Cursor = Cursors.Default;
			}
			else if (pageArgs.Page == xtraTabPageBanner && _bannerControl == null)
			{
				Cursor = Cursors.WaitCursor;
				Application.DoEvents();
				_bannerControl = new BannerSettingsControl(_folder);
				_bannerControl.Dock = DockStyle.Fill;
				pnBannerContainer.Controls.Add(_bannerControl);
				_bannerControl.LoadData();
				_bannerControl.StateChanged += (o, e) =>
				{
					if (e.IsChecked)
						_widgetControl?.ChangeState(false);
				};
				_bannerControl.ControlClicked += OnFormClick;
				pnApllyForAllWindowsBanner.Visible = _formParameters.Type == WindowPropertiesType.None;
				ckApllyForAllWindowsBanner.Checked = _formParameters.Type == WindowPropertiesType.None && _folder.Page.Library.Settings.ApplyBannerForAllWindows;
				Cursor = Cursors.Default;
			}
		}