private void EditFolderWidget()
		{
			using (var form = new FormWindow(DataSource, new WidgetFormParams()))
			{
				if (form.ShowDialog(MainController.Instance.MainForm) != DialogResult.OK) return;
				SetupView();
				UpdateGridSize();
				DataChanged?.Invoke(this, EventArgs.Empty);
			}
		}
Пример #2
0
		private void repositoryItemButtonEditWindowOperations_ButtonClick(object sender, DevExpress.XtraEditors.Controls.ButtonPressedEventArgs e)
		{
			var folder = gridView.GetFocusedRow() as LibraryFolder;
			if (folder == null) return;
			switch (e.Button.Index)
			{
				case 0:
					{
						var newRowHandle = gridView.FocusedRowHandle - 1;
						_page.Folders.UpItem(folder, item => item.ColumnOrder == ColumnOrder);
						LoadData();
						gridView.FocusedRowHandle = newRowHandle >= 0 ? newRowHandle : 0;
						FolderChanged?.Invoke(this, EventArgs.Empty);
					}
					break;
				case 1:
					{
						var newRowHandle = gridView.FocusedRowHandle + 1;
						_page.Folders.DownItem(folder, item => item.ColumnOrder == ColumnOrder);
						LoadData();
						gridView.FocusedRowHandle = newRowHandle < gridView.RowCount ? newRowHandle : gridView.RowCount - 1;
						FolderChanged?.Invoke(this, EventArgs.Empty);
					}
					break;
				case 2:
					FolderMovedLeft?.Invoke(this, EventArgs.Empty);
					break;
				case 3:
					FolderMovedRight?.Invoke(this, EventArgs.Empty);
					break;
				case 4:
					using (var form = new FormWindow(folder, new BaseEditFormParams()))
					{
						if (form.ShowDialog() != DialogResult.OK) return;
						gridView.RefreshData();
						FolderChanged?.Invoke(this, EventArgs.Empty);
					}
					break;
				case 5:
					if (MainController.Instance.PopupMessages.ShowWarningQuestion("Are you sure want to delete selected window?") != DialogResult.Yes) return;
					_page.Folders.RemoveItem(folder, item => item.ColumnOrder == ColumnOrder);
					LoadData();
					FolderChanged?.Invoke(this, EventArgs.Empty);
					break;
			}
		}
		private void EditFolderSettings()
		{
			using (var form = new FormWindow(DataSource, new TitleFormParams()))
			{
				if (form.ShowDialog(MainController.Instance.MainForm) != DialogResult.OK) return;
				UpdateFont();
				SetupView();
				UpdateContent(true);
				DataChanged?.Invoke(this, EventArgs.Empty);
			}
		}