コード例 #1
0
        public static void ShowDecomposeByColumnContentDialog(this DataTable srcTable, IAscendingIntegerCollection selectedDataRows, IAscendingIntegerCollection selectedDataColumns)
        {
            DataTableMultipleColumnProxy    proxy   = null;
            DecomposeByColumnContentOptions options = null;

            try
            {
                proxy = new DataTableMultipleColumnProxy(DecomposeByColumnContentDataAndOptions.ColumnsParticipatingIdentifier, srcTable, selectedDataRows, selectedDataColumns);
                proxy.EnsureExistenceOfIdentifier(DecomposeByColumnContentDataAndOptions.ColumnWithCyclingVariableIdentifier, 1);

                options = new DecomposeByColumnContentOptions();
            }
            catch (Exception ex)
            {
                Current.Gui.ErrorMessageBox(string.Format("{0}\r\nDetails:\r\n{1}", ex.Message, ex.ToString()), "Error in preparation of 'Decompose by column content'");
                return;
            }

            var dataAndOptions = new DecomposeByColumnContentDataAndOptions(proxy, options);

            // in order to show the column names etc in the dialog, it is neccessary to set the source
            if (true == Current.Gui.ShowDialog(ref dataAndOptions, "Choose options", false))
            {
                var destTable = new DataTable();
                proxy   = dataAndOptions.Data;
                options = dataAndOptions.Options;

                string error = null;
                try
                {
                    error = DecomposeByColumnContent(dataAndOptions.Data, dataAndOptions.Options, destTable);
                }
                catch (Exception ex)
                {
                    error = ex.ToString();
                }
                if (null != error)
                {
                    Current.Gui.ErrorMessageBox(error);
                }

                destTable.Name = srcTable.Name + "_Decomposed";

                // Create a DataSource
                var dataSource = new DecomposeByColumnContentDataSource(proxy, options, new Altaxo.Data.DataSourceImportOptions());
                destTable.DataSource = dataSource;

                Current.Project.DataTableCollection.Add(destTable);
                Current.IProjectService.ShowDocumentView(destTable);
            }
        }
コード例 #2
0
		public static void ShowDecomposeByColumnContentDialog(this DataTable srcTable, IAscendingIntegerCollection selectedDataRows, IAscendingIntegerCollection selectedDataColumns)
		{
			DataTableMultipleColumnProxy proxy = null;
			DecomposeByColumnContentOptions options = null;

			try
			{
				proxy = new DataTableMultipleColumnProxy(DecomposeByColumnContentDataAndOptions.ColumnsParticipatingIdentifier, srcTable, selectedDataRows, selectedDataColumns);
				proxy.EnsureExistenceOfIdentifier(DecomposeByColumnContentDataAndOptions.ColumnWithCyclingVariableIdentifier, 1);

				options = new DecomposeByColumnContentOptions();
			}
			catch (Exception ex)
			{
				Current.Gui.ErrorMessageBox(string.Format("{0}\r\nDetails:\r\n{1}", ex.Message, ex.ToString()), "Error in preparation of 'Decompose by column content'");
				return;
			}

			var dataAndOptions = new DecomposeByColumnContentDataAndOptions(proxy, options);

			// in order to show the column names etc in the dialog, it is neccessary to set the source
			if (true == Current.Gui.ShowDialog(ref dataAndOptions, "Choose options", false))
			{
				var destTable = new DataTable();
				proxy = dataAndOptions.Data;
				options = dataAndOptions.Options;

				string error = null;
				try
				{
					error = DecomposeByColumnContent(dataAndOptions.Data, dataAndOptions.Options, destTable);
				}
				catch (Exception ex)
				{
					error = ex.ToString();
				}
				if (null != error)
					Current.Gui.ErrorMessageBox(error);

				destTable.Name = srcTable.Name + "_Decomposed";

				// Create a DataSource
				var dataSource = new DecomposeByColumnContentDataSource(proxy, options, new Altaxo.Data.DataSourceImportOptions());
				destTable.DataSource = dataSource;

				Current.Project.DataTableCollection.Add(destTable);
				Current.ProjectService.ShowDocumentView(destTable);
			}
		}
コード例 #3
0
		/// <summary>
		/// Initializes a new instance of the <see cref="DecomposeByColumnContentDataSource"/> class.
		/// </summary>
		/// <param name="from">Another instance to copy from.</param>
		public DecomposeByColumnContentDataSource(DecomposeByColumnContentDataSource from)
		{
			CopyFrom(from);
		}
コード例 #4
0
 /// <summary>
 /// Initializes a new instance of the <see cref="DecomposeByColumnContentDataSource"/> class.
 /// </summary>
 /// <param name="from">Another instance to copy from.</param>
 public DecomposeByColumnContentDataSource(DecomposeByColumnContentDataSource from)
 {
     CopyFrom(from);
 }