Esempio n. 1
0
        /// <summary>
        /// Moves the selected columns to a new position <code>nPosition</code>.
        /// </summary>
        /// <param name="ctrl">The worksheet controller.</param>
        /// <param name="nPosition">The new position for the selected columns.</param>
        public static void SetSelectedColumnPosition(IWorksheetController ctrl, int nPosition)
        {
            if (ctrl.SelectedDataColumns.Count > 0)
            {
                if (ctrl.SelectedDataColumns.Count + nPosition > ctrl.DataTable.DataColumnCount)
                {
                    nPosition = Math.Max(0, ctrl.DataTable.DataColumnCount - ctrl.SelectedDataColumns.Count);
                }

                ctrl.DataTable.ChangeColumnPosition(ctrl.SelectedDataColumns, nPosition);
            }

            if (ctrl.SelectedPropertyColumns.Count > 0)
            {
                if (ctrl.SelectedPropertyColumns.Count + nPosition > ctrl.DataTable.PropertyColumnCount)
                {
                    nPosition = Math.Max(0, ctrl.DataTable.PropertyColumnCount - ctrl.SelectedDataColumns.Count);
                }

                ctrl.DataTable.PropertyColumns.ChangeColumnPosition(ctrl.SelectedPropertyColumns, nPosition);
            }

            ctrl.ClearAllSelections();

            ctrl.TableAreaInvalidate();
        }
Esempio n. 2
0
 /// <summary>
 /// Sets the group number of the selected column
 /// </summary>
 /// <param name="ctrl">The worksheet controller for the table.</param>
 public static void ShowSetColumnGroupNumberDialog(IWorksheetController ctrl)
 {
     if (ctrl.DataTable.ShowSetColumnGroupNumberDialog(ctrl.SelectedDataColumns, ctrl.SelectedPropertyColumns))
     {
         ctrl.ClearAllSelections();
         ctrl.TableAreaInvalidate();
     }
 }
Esempio n. 3
0
		/// <summary>
		/// Sets the group number of the selected column
		/// </summary>
		/// <param name="ctrl">The worksheet controller for the table.</param>
		public static void ShowSetColumnGroupNumberDialog(IWorksheetController ctrl)
		{
			if (ctrl.DataTable.ShowSetColumnGroupNumberDialog(ctrl.SelectedDataColumns, ctrl.SelectedPropertyColumns))
			{
				ctrl.ClearAllSelections();
				ctrl.TableAreaInvalidate();
			}
		}
Esempio n. 4
0
 /// <summary>
 /// Extracts the property values of the selected property columns.
 /// </summary>
 /// <param name="ctrl">The controller that controls the table.</param>
 public static void ExtractPropertyValues(IWorksheetController ctrl)
 {
     for (int i = 0; i < ctrl.SelectedPropertyColumns.Count; i++)
     {
         Altaxo.Data.DataColumn col = ctrl.DataTable.PropCols[ctrl.SelectedPropertyColumns[i]];
         ExtractPropertiesFromColumn(col, ctrl.DataTable.PropCols);
     }
     ctrl.ClearAllSelections();
 }
Esempio n. 5
0
        /// <summary>
        /// Insert a number of data rows into the controlled table.
        /// </summary>
        /// <param name="ctrl">The worksheet controller.</param>
        /// <param name="rowBeforeToInsert">Number of the row before which to insert the additional rows.</param>
        /// <param name="numberOfRows">Number of rows to insert.</param>
        public static void InsertDataRows(IWorksheetController ctrl, int rowBeforeToInsert, int numberOfRows)
        {
            if (numberOfRows <= 0 || rowBeforeToInsert < 0)
            {
                return;
            }

            ctrl.DataTable.DataColumns.InsertRows(rowBeforeToInsert, numberOfRows);
            ctrl.ClearAllSelections();
            ctrl.TableAreaInvalidate();
        }
Esempio n. 6
0
        /// <summary>
        /// Moves the selected rows to a new position <code>nPosition</code>.
        /// </summary>
        /// <param name="ctrl">The worksheet controller.</param>
        /// <param name="nPosition">The new position for the selected rows.</param>
        public static void SetSelectedRowPosition(IWorksheetController ctrl, int nPosition)
        {
            if (ctrl.SelectedDataRows.Count > 0)
            {
                ctrl.DataTable.DataColumns.ChangeRowPosition(ctrl.SelectedDataRows, nPosition);
            }

            ctrl.ClearAllSelections();

            ctrl.TableAreaInvalidate();
        }
Esempio n. 7
0
		/// <summary>
		/// Moves the selected rows to a new position <code>nPosition</code>.
		/// </summary>
		/// <param name="ctrl">The worksheet controller.</param>
		/// <param name="nPosition">The new position for the selected rows.</param>
		public static void SetSelectedRowPosition(IWorksheetController ctrl, int nPosition)
		{
			if (ctrl.SelectedDataRows.Count > 0)
			{
				ctrl.DataTable.DataColumns.ChangeRowPosition(ctrl.SelectedDataRows, nPosition);
			}

			ctrl.ClearAllSelections();

			ctrl.TableAreaInvalidate();
		}
Esempio n. 8
0
		/// <summary>
		/// Insert a number of data rows into the controlled table.
		/// </summary>
		/// <param name="ctrl">The worksheet controller.</param>
		/// <param name="rowBeforeToInsert">Number of the row before which to insert the additional rows.</param>
		/// <param name="numberOfRows">Number of rows to insert.</param>
		public static void InsertDataRows(IWorksheetController ctrl, int rowBeforeToInsert, int numberOfRows)
		{
			if (numberOfRows <= 0 || rowBeforeToInsert < 0)
				return;

			ctrl.DataTable.DataColumns.InsertRows(rowBeforeToInsert, numberOfRows);
			ctrl.ClearAllSelections();
			ctrl.TableAreaInvalidate();
		}
Esempio n. 9
0
		/// <summary>
		/// Extracts the property values of the selected property columns.
		/// </summary>
		/// <param name="ctrl">The controller that controls the table.</param>
		public static void ExtractPropertyValues(IWorksheetController ctrl)
		{
			for (int i = 0; i < ctrl.SelectedPropertyColumns.Count; i++)
			{
				Altaxo.Data.DataColumn col = ctrl.DataTable.PropCols[ctrl.SelectedPropertyColumns[i]];
				ExtractPropertiesFromColumn(col, ctrl.DataTable.PropCols);
			}
			ctrl.ClearAllSelections();
		}
Esempio n. 10
0
		/// <summary>
		/// Moves the selected columns to a new position <code>nPosition</code>.
		/// </summary>
		/// <param name="ctrl">The worksheet controller.</param>
		/// <param name="nPosition">The new position for the selected columns.</param>
		public static void SetSelectedColumnPosition(IWorksheetController ctrl, int nPosition)
		{
			if (ctrl.SelectedDataColumns.Count > 0)
			{
				if (ctrl.SelectedDataColumns.Count + nPosition > ctrl.DataTable.DataColumnCount)
					nPosition = Math.Max(0, ctrl.DataTable.DataColumnCount - ctrl.SelectedDataColumns.Count);

				ctrl.DataTable.ChangeColumnPosition(ctrl.SelectedDataColumns, nPosition);
			}

			if (ctrl.SelectedPropertyColumns.Count > 0)
			{
				if (ctrl.SelectedPropertyColumns.Count + nPosition > ctrl.DataTable.PropertyColumnCount)
					nPosition = Math.Max(0, ctrl.DataTable.PropertyColumnCount - ctrl.SelectedDataColumns.Count);

				ctrl.DataTable.PropertyColumns.ChangeColumnPosition(ctrl.SelectedPropertyColumns, nPosition);
			}

			ctrl.ClearAllSelections();

			ctrl.TableAreaInvalidate();
		}