Exemple #1
0
        /// <summary>
        /// Exports the property columns into Ascii. Each property column is exported into one row (line).
        /// </summary>
        /// <param name="strwr">A stream writer to write the ascii data to.</param>
        /// <param name="columnCollection">The column collection to export.</param>
        /// <param name="nDataColumns">The number of data columns of the table -> is the number of elements in each property column that must be exported.</param>
        /// <param name="options">The Ascii export options.</param>
        protected static void ExportPropertyColumns(StreamWriter strwr, Altaxo.Data.DataColumnCollection columnCollection, int nDataColumns, AsciiExportOptions options)
        {
            int nPropColumns = columnCollection.ColumnCount;

            for (int i = 0; i < nPropColumns; i++)
            {
                string columnName = options.ConvertToSaveString(columnCollection.GetColumnName(i));
                columnName += "=";
                bool isTextColumn = columnCollection[i] is Data.TextColumn;

                for (int j = 0; j < nDataColumns; j++)
                {
                    if (!columnCollection[i].IsElementEmpty(j))
                    {
                        string data = options.DataItemToString(columnCollection[i], j);
                        if (options.ExportPropertiesWithName && !isTextColumn && !data.Contains("="))
                        {
                            strwr.Write(columnName);
                        }

                        strwr.Write(data);
                    }
                    if ((j + 1) < nDataColumns)
                    {
                        strwr.Write(options.SeparatorChar);
                    }
                    else
                    {
                        strwr.WriteLine();
                    }
                }
            }
        }
Exemple #2
0
		/// <summary>
		/// Exports the property columns into Ascii. Each property column is exported into one row (line).
		/// </summary>
		/// <param name="strwr">A stream writer to write the ascii data to.</param>
		/// <param name="columnCollection">The column collection to export.</param>
		/// <param name="nDataColumns">The number of data columns of the table -> is the number of elements in each property column that must be exported.</param>
		/// <param name="options">The Ascii export options.</param>
		static protected void ExportPropertyColumns(StreamWriter strwr, Altaxo.Data.DataColumnCollection columnCollection, int nDataColumns, AsciiExportOptions options)
		{
			int nPropColumns = columnCollection.ColumnCount;

			for (int i = 0; i < nPropColumns; i++)
			{
				string columnName = options.ConvertToSaveString(columnCollection.GetColumnName(i));
				columnName += "=";
				bool isTextColumn = columnCollection[i] is Data.TextColumn;

				for (int j = 0; j < nDataColumns; j++)
				{
					if (!columnCollection[i].IsElementEmpty(j))
					{
						string data = options.DataItemToString(columnCollection[i], j);
						if (options.ExportPropertiesWithName && !isTextColumn && !data.Contains("="))
							strwr.Write(columnName);

						strwr.Write(data);
					}
					if ((j + 1) < nDataColumns)
						strwr.Write(options.SeparatorChar);
					else
						strwr.WriteLine();
				}
			}
		}
Exemple #3
0
		/// <summary>
		/// Exports the data column names of a table into a single line of ascii.
		/// </summary>
		/// <param name="strwr">A stream writer to write the ascii data to.</param>
		/// <param name="table">The data table whichs data column names should be exported.</param>
		/// <param name="options">The options controlling the export process.</param>
		static protected void ExportDataColumnNames(StreamWriter strwr, Altaxo.Data.DataTable table, AsciiExportOptions options)
		{
			int nColumns = table.DataColumns.ColumnCount;
			for (int i = 0; i < nColumns; i++)
			{
				strwr.Write(options.ConvertToSaveString(table.DataColumns.GetColumnName(i)));

				if ((i + 1) < nColumns)
					strwr.Write(options.SeparatorChar);
				else
					strwr.WriteLine();
			}
		}
Exemple #4
0
        /// <summary>
        /// Exports the data column names of a table into a single line of ascii.
        /// </summary>
        /// <param name="strwr">A stream writer to write the ascii data to.</param>
        /// <param name="table">The data table whichs data column names should be exported.</param>
        /// <param name="options">The options controlling the export process.</param>
        protected static void ExportDataColumnNames(StreamWriter strwr, Altaxo.Data.DataTable table, AsciiExportOptions options)
        {
            int nColumns = table.DataColumns.ColumnCount;

            for (int i = 0; i < nColumns; i++)
            {
                strwr.Write(options.ConvertToSaveString(table.DataColumns.GetColumnName(i)));

                if ((i + 1) < nColumns)
                {
                    strwr.Write(options.SeparatorChar);
                }
                else
                {
                    strwr.WriteLine();
                }
            }
        }