/// <summary> /// returns a npgsql db type for column type /// </summary> /// <param name="ct"></param> /// <returns></returns> public static NpgsqlDbType ColumnDataTypeToNpgsqlDbType(ColumnDataType ct) { switch (ct) { case ColumnDataType.Integer: return(NpgsqlDbType.Integer); case ColumnDataType.Long: return(NpgsqlDbType.Bigint); case ColumnDataType.Number: return(NpgsqlDbType.Numeric); case ColumnDataType.Date: return(NpgsqlDbType.Timestamp); //"timestamp without time zone"; case ColumnDataType.Bool: return(NpgsqlDbType.Boolean); case ColumnDataType.String: return(NpgsqlDbType.Text); default: throw new Exception($"Unknown NpgsqlDbType data type: {ct}"); } }
void OnColumnsChanged(Column column, ColumnDataType type) { if (type == ColumnDataType.Visibility) { m_View.Rebuild(); } }
/// <summary> /// returns db sql type for column data type /// </summary> /// <param name="ct"></param> /// <returns></returns> protected internal static string ColumnDataTypeToDbType(ColumnDataType ct) { switch (ct) { case ColumnDataType.Integer: return("integer"); case ColumnDataType.Long: return("bigint"); case ColumnDataType.Number: return("numeric"); case ColumnDataType.Date: return("timestamp without time zone"); case ColumnDataType.Bool: return("boolean"); case ColumnDataType.String: return("text"); case ColumnDataType.Geom: return("geometry"); default: throw new Exception($"Unknown column data type: {ct}"); } }
public void AddColumn(string columnName, ColumnDataType dataType, string headerName = null, int displayPrecision = 2) { DataColumn column = Data.AddColumn(columnName, dataType, headerName); ColumnFormattingOptions.Add(columnName, GetDefaultDisplaySettings(column, displayPrecision)); }
/// <param name="columnName">Column Name</param> /// <param name="headerName">If left empty, table will convert Column Name from space or underscore delimited to Capitalized words</param> /// <returns>The column that was added</returns> public static DataColumn AddColumn(this DataTable table, string columnName, ColumnDataType dataType, string headerName = null) { Type type; switch (dataType) { case ColumnDataType.Text: type = typeof(string); break; case ColumnDataType.Number: type = typeof(double); break; default: throw new InvalidEnumArgumentException(); } DataColumn column = CreateDataColumn(columnName, type, headerName); table.Columns.Add(column); return(column); }
/// <summary> /// Fills in the Field Names combo box /// </summary> private void FillSelectionComboboxes() { cbxFieldName.Items.Clear(); List <string> fieldNames = new List <string>(); //if (dashboardHelper.IsUsingEpiProject) //{ // foreach (Field f in this.View.Fields) // { // if (f is DateTimeField || f is DateField /* || f is NumberField*/) // { // fieldNames.Add(f.Name); // } // } //} //else //{ ColumnDataType columnDataType = ColumnDataType.DateTime | ColumnDataType.UserDefined; fieldNames = dashboardHelper.GetFieldsAsList(columnDataType); //} fieldNames.Sort(); cbxFieldName.DataSource = fieldNames; if (InEditMode) { cbxFieldName.SelectedItem = FormatRule.SourceColumnName; } }
private Control GenerateQueryInputSelector(ColumnDataType dataType) { switch (dataType) { case ColumnDataType.UniqueIdentifier: return(MakeInputOptions(new List <Operator> { Operator.Equals, Operator.Contains })); case ColumnDataType.Int: case ColumnDataType.Decimal: return(MakeInputOptions(new List <Operator> { Operator.Equals, Operator.Between, Operator.LessOrEqTo, Operator.GreaterOrEqTo })); case ColumnDataType.String: return(MakeInputOptions(new List <Operator> { Operator.Equals, Operator.Contains })); case ColumnDataType.Bool: return(MakeInputOptions(new List <Operator> { Operator.TrueOrFalse })); case ColumnDataType.DateTime: return(MakeInputOptions(new List <Operator> { Operator.Equals, Operator.Between, Operator.LessOrEqTo, Operator.GreaterOrEqTo })); } return(null); }
/// <summary> /// Gets the field value from the buffer. /// </summary> protected object GetFieldValue(ColumnDataType dataType, int dataSize, byte[] buffer, ref int index) { switch (dataType) { case ColumnDataType.Integer: return(GetInt32(buffer, ref index)); case ColumnDataType.Double: return(GetDouble(buffer, ref index)); case ColumnDataType.Boolean: return(GetBool(buffer, ref index)); case ColumnDataType.DateTime: return(GetTime(buffer, ref index)); case ColumnDataType.String: string s = dataSize > 0 ? Encoding.UTF8.GetString(buffer, index, dataSize) : ""; index += dataSize; return(s); default: return(null); } }
public string BuildTableSchemaJson(string tableName, Type structure) { var tableStructure = "{ \"name\" : \"{0}\", \"columns\" : [{1}] }"; var tableColumnTemplate = "\"name\" : \"{0}\", \"dataType\" : \"{1}\""; IList <Column> columns = new List <Column>(); foreach (var prop in structure.GetProperties()) { ColumnDataType type = ColumnDataType.@string; if (prop.PropertyType == typeof(bool)) { type = ColumnDataType.@bool; } else if (prop.PropertyType == typeof(int)) { type = ColumnDataType.Int64; } else if (prop.PropertyType == typeof(double)) { type = ColumnDataType.Double; } else if (prop.PropertyType == typeof(DateTime)) { type = ColumnDataType.DateTime; } columns.Add(new Column(prop.Name, type)); } var result = tableStructure.Replace("{0}", tableName); var jsonColumns = columns.Select(column => "{" + string.Format(tableColumnTemplate, column.Name, column.DataType) + "}").ToList(); return(result.Replace("{1}", string.Join(",", jsonColumns))); }
private bool ColumnSmallerThan(string columnValue, string comparedValue, ColumnDataType dataType) { switch (dataType) { case ColumnDataType.String: return(string.Compare(columnValue, comparedValue) < 0); case ColumnDataType.Long: return(long.Parse(columnValue) < long.Parse(comparedValue)); case ColumnDataType.Float: return(float.Parse(columnValue) < float.Parse(comparedValue)); case ColumnDataType.Double: return(double.Parse(columnValue) < double.Parse(comparedValue)); case ColumnDataType.Short: case ColumnDataType.Byte: case ColumnDataType.Int: return(int.Parse(columnValue) < int.Parse(comparedValue)); case ColumnDataType.Decimal: return(decimal.Parse(columnValue) < decimal.Parse(comparedValue)); case ColumnDataType.DateTime: return(DateTime.Parse(columnValue) < DateTime.Parse(comparedValue)); default: return(false); } }
private bool ColumnNotEquals(string columnValue, string comparedValue, ColumnDataType dataType) { switch (dataType) { case ColumnDataType.String: return(!columnValue.Equals(comparedValue)); case ColumnDataType.Long: return(long.Parse(columnValue) != long.Parse(comparedValue)); case ColumnDataType.Float: return(float.Parse(columnValue) != float.Parse(comparedValue)); case ColumnDataType.Double: return(double.Parse(columnValue) != double.Parse(comparedValue)); case ColumnDataType.Short: case ColumnDataType.Byte: case ColumnDataType.Int: return(int.Parse(columnValue) != int.Parse(comparedValue)); case ColumnDataType.Decimal: return(decimal.Parse(columnValue) != decimal.Parse(comparedValue)); case ColumnDataType.DateTime: return(DateTime.Parse(columnValue) != DateTime.Parse(comparedValue)); case ColumnDataType.Bool: return(bool.Parse(columnValue) != bool.Parse(comparedValue)); default: return(false); } }
/// <summary> /// Gets a data filter from the buffer. /// </summary> public static DataFilter GetDataFilter(Type itemType, byte[] buffer, ref int index) { DataFilter filter = new DataFilter(itemType) { Limit = GetInt32(buffer, ref index), Offset = GetInt32(buffer, ref index), OriginBegin = GetBool(buffer, ref index) }; int conditionCount = GetInt32(buffer, ref index); for (int i = 0; i < conditionCount; i++) { string columnName = GetString(buffer, ref index); FilterOperator filterOperator = (FilterOperator)GetByte(buffer, ref index); ColumnDataType dataType = (ColumnDataType)GetByte(buffer, ref index); IList args = null; switch (dataType) { case ColumnDataType.Integer: case ColumnDataType.Boolean: args = GetIntArray(buffer, ref index); break; case ColumnDataType.Double: args = GetDoubleArray(buffer, ref index); break; } filter.AddCondition(columnName, filterOperator, args); } return(filter); }
public string ToColumnXPOLenght() { if (string.IsNullOrEmpty(ColumnDataType)) { return(""); } if (ColumnDataType.IndexOf("(") != -1 && ColumnDataType.IndexOf(")") != -1) { int l1 = ColumnDataType.IndexOf("(") + 1; int l2 = ColumnDataType.IndexOf(")"); string lenght = ColumnDataType.Substring(l1, l2 - l1); if (ColumnDataType.IndexOf("varchar") != -1) { int len = 0; if (int.TryParse(lenght, out len)) { return("[Size(" + len + ")]"); } } //else if (ColumnDataType.IndexOf("number") != -1 || ColumnDataType.IndexOf("decimal") != -1) //{ // int len = 0; // string[] lens = lenght.Split(','); // if (lens != null && lens.Length > 1) // { // return ", Precision = " + lens[0] + ", Scale = " + lens[1]; // } //} } return(""); }
private void FillComboBoxes() { cbxDataKey.SelectionChanged -= new SelectionChangedEventHandler(keys_SelectionChanged); cbxDataKey.Items.Clear(); cbxDataKey.SelectionChanged += new SelectionChangedEventHandler(keys_SelectionChanged); cbxValue.SelectionChanged -= new SelectionChangedEventHandler(keys_SelectionChanged); cbxValue.Items.Clear(); cbxValue.SelectionChanged += new SelectionChangedEventHandler(keys_SelectionChanged); ColumnDataType columnDataType = ColumnDataType.Boolean | ColumnDataType.DateTime | ColumnDataType.Numeric | ColumnDataType.Text | ColumnDataType.UserDefined; List <string> fields = dashboardHelper.GetFieldsAsList(columnDataType); // dashboardHelper.GetFormFields(); columnDataType = ColumnDataType.Numeric; List <string> numericFields = dashboardHelper.GetFieldsAsList(columnDataType); //dashboardHelper.GetNumericFormFields(); foreach (string field in fields) { cbxDataKey.Items.Add(field); } foreach (string field in numericFields) { cbxValue.Items.Add(field); } cbxValue.Items.Insert(0, "{Record Count}"); }
private void CreateDataTable () { TemplateDataTable = new DataTable(); var propetys = this.GetType().GetFields().Where(x => x.FieldType == typeof(ExcelPropety)).ToList(); foreach (var p in propetys) { ExcelPropety excelPropety = (ExcelPropety)p.GetValue(this); ColumnDataType dateType = excelPropety.DataType; switch (dateType) { case ColumnDataType.Bool: TemplateDataTable.Columns.Add(p.Name, typeof(bool)); break; case ColumnDataType.Date: TemplateDataTable.Columns.Add(p.Name, typeof(string)); break; case ColumnDataType.Number: TemplateDataTable.Columns.Add(p.Name, typeof(int)); break; case ColumnDataType.Text: TemplateDataTable.Columns.Add(p.Name, typeof(string)); break; case ColumnDataType.Float: TemplateDataTable.Columns.Add(p.Name, typeof(decimal)); break; default: TemplateDataTable.Columns.Add(p.Name, typeof(string)); break; } } }
private static IDatabaseView GetMockView(Identifier viewName) { var testColumnType = new ColumnDataType( "integer", DataType.Integer, "INTEGER", typeof(int), false, 10, Option <INumericPrecision> .None, Option <Identifier> .None ); var columns = new[] { new DatabaseColumn("test_column_1", testColumnType, false, Option <string> .None, Option <IAutoIncrement> .None), new DatabaseColumn("test_column_2", testColumnType, false, Option <string> .None, Option <IAutoIncrement> .None) }; var viewMock = new Mock <IDatabaseView>(); viewMock.SetupGet(v => v.Name).Returns(viewName); viewMock.Setup(v => v.Columns).Returns(columns); return(viewMock.Object); }
public Column(string code, string name, ColumnDataType dataType, int width, bool hidden = false) { Code = code; Name = name; DataType = dataType; Width = width; Hidden = hidden; }
double[][] m_NormalizedValues; // before apply to the solver column has to be normalized public ColumnData(bool isOutput = false) { if (isOutput) { m_ParamType = ParameterType.Output; } m_ColType = ColumnDataType.Numeric; }
public void TestCreateColumnNameAndDatatype(string name, ColumnDataType dataType) { Column column = new Column(name, dataType); Assert.AreEqual(name, column.ColumnName); Assert.AreEqual(dataType, column.DataType); Assert.AreEqual(null, column.Table); }
static string GetDebugInfo(ColumnDataType datatype, object o1, object o2) { return("datatype=" + datatype.ToString() + ",o1=" + (o1 == null ? "<null>" : o1.GetType().ToString()) + ",o2=" + (o2 == null ? "<null>" : o2.GetType().ToString())); }
private void btnOK_Click(object sender, EventArgs e) { if (string.IsNullOrEmpty(txtDestinationField.Text)) { MsgBox.ShowError("Destination field is blank."); this.DialogResult = DialogResult.None; return; } if (cbxFieldType.SelectedIndex == 1 && cbxFieldType.Text == "Numeric") { foreach (DataRow row in RecodeTable.Rows) { string textValue = row["Representation"].ToString(); double value; bool success = double.TryParse(textValue, out value); if (!success && !string.IsNullOrEmpty(textValue)) { MsgBox.ShowError("The destination field type has been defined as numeric, but the destination values are not valid numbers."); this.DialogResult = DialogResult.None; return; } } } if (!editMode) { ColumnDataType columnDataType = ColumnDataType.Boolean | ColumnDataType.Numeric | ColumnDataType.Text; foreach (string s in dashboardHelper.GetFieldsAsList(columnDataType)) { if (txtDestinationField.Text.ToLowerInvariant().Equals(s.ToLowerInvariant())) { MsgBox.ShowError("Destination field name already exists as a column in this data set. Please use another name."); this.DialogResult = DialogResult.None; return; } } foreach (IDashboardRule rule in dashboardHelper.Rules) { if (rule is DataAssignmentRule) { DataAssignmentRule assignmentRule = rule as DataAssignmentRule; if (txtDestinationField.Text.ToLowerInvariant().Equals(assignmentRule.DestinationColumnName.ToLowerInvariant())) { MsgBox.ShowError("Destination field name already exists as a defined field with recoded values. Please use another field name."); this.DialogResult = DialogResult.None; return; } } } } string friendlyRule = "Recode the values in " + sourceColumnName + " to " + txtDestinationField.Text + ""; string sourceColumnType = dashboardHelper.GetColumnType(sourceColumnName); RecodeRule = new Rule_Recode(this.DashboardHelper, friendlyRule, sourceColumnName, sourceColumnType, txtDestinationField.Text, DestinationFieldType, RecodeTable, txtElseValue.Text, checkboxMaintainSortOrder.Checked, checkboxUseWildcards.Checked); }
//Column with fixed value public SchemaMapper_Column(string name, ColumnDataType datatype, string fixedValue) { Name = name; FixedValue = fixedValue; IsExpression = false; Expression = ""; DataType = datatype; MappedColumns = new List <string>(); }
// private DataGridSearch dataGridSearch; public DataGridColumnAttribute(string displayName) { _visible = true; _orderable = false; _displayName = displayName; _dataFormat = ColumnDataFormat.Default; _dataType = ColumnDataType.Text; _useInSummary = false; }
/// <summary> /// Called whenever a column has changed. /// </summary> /// <param name="column">The column that has changed.</param> /// <param name="type">The data that has changed.</param> void OnColumnChanged(Column column, ColumnDataType type) { // Do not dirty the layout if the user is resizing columns interactively if (m_DragResizing || !RequiresLayoutUpdate(type)) { return; } Dirty(); }
public TableColumnViewModel(string header, string columnType) { _header = header; string typeString = columnType.ToLower(); ColumnDataType columnValueType = ColumnDataType.String; TypeStringToColumnTypeDict.TryGetValue(typeString, out columnValueType); _valueType = columnValueType; }
//Column with expression public SchemaMapper_Column(string name, ColumnDataType datatype, bool isexpression, string expression) { Name = name; FixedValue = ""; IsExpression = isexpression; Expression = expression; DataType = datatype; MappedColumns = new List <string>(); }
public void Deserialize(Runtime.Serialization.IO.CompactReader reader) { _columnName = reader.ReadObject() as string; _columnType = (ColumnType)reader.ReadInt32(); _dataType = (ColumnDataType)reader.ReadInt32(); _aggregateFunctionType = (AggregateFunctionType)reader.ReadInt32(); _isFilled = reader.ReadBoolean(); _isHidden = reader.ReadBoolean(); }
/// <summary> /// Fills the combo boxes on this dialog /// </summary> private void FillSelectionComboBoxes() { cbxParam1.DataSource = null; cbxParam2.DataSource = null; cbxParam3.DataSource = null; if (cbxAssignmentType.SelectedIndex >= 0 && cbxAssignmentType.SelectedIndex <= 4) { ColumnDataType columnDataType = ColumnDataType.DateTime | ColumnDataType.UserDefined; List <string> fieldNames1 = dashboardHelper.GetFieldsAsList(columnDataType); List <string> fieldNames2 = dashboardHelper.GetFieldsAsList(columnDataType); cbxParam1.DataSource = fieldNames1; cbxParam2.DataSource = fieldNames2; } else if (cbxAssignmentType.SelectedIndex == 5 || cbxAssignmentType.SelectedIndex == 7) { ColumnDataType columnDataType = ColumnDataType.Numeric | ColumnDataType.UserDefined; List <string> fieldNames = dashboardHelper.GetFieldsAsList(columnDataType); cbxParam1.DataSource = fieldNames; } else if (cbxAssignmentType.SelectedIndex == 6 || cbxAssignmentType.SelectedIndex == 8 || cbxAssignmentType.SelectedIndex == 9 || cbxAssignmentType.SelectedIndex == 10) { ColumnDataType columnDataType = ColumnDataType.Text | ColumnDataType.UserDefined; List <string> fieldNames = dashboardHelper.GetFieldsAsList(columnDataType); cbxParam1.DataSource = fieldNames; } if (editMode) { txtDestinationField.Enabled = false; } else { txtDestinationField.Enabled = true; } cbxParam1.SelectedIndex = -1; cbxParam2.SelectedIndex = -1; cbxParam3.SelectedIndex = -1; if (AssignRule != null && AssignRule.AssignmentParameters != null) { if (AssignRule.AssignmentParameters.Count > 0) { cbxParam1.Text = AssignRule.AssignmentParameters[0]; } if (AssignRule.AssignmentParameters.Count > 1) { cbxParam2.Text = AssignRule.AssignmentParameters[1]; } if (AssignRule.AssignmentParameters.Count > 2) { cbxParam3.Text = AssignRule.AssignmentParameters[2]; } } }
/// <summary> /// Fills the combo boxes on this dialog /// </summary> private void FillComboBoxes() { txtDestinationField.Text = string.Empty; cbxSourceField.Items.Clear(); cbxFieldType.Items.Clear(); List <string> fieldNames = new List <string>(); if (dashboardHelper.IsUsingEpiProject) { //foreach (Fields f in this.EwavView.Fields) //{ // if (f is NumberField || f is TableBasedDropDownField || f is CheckBoxField || f is YesNoField) // { // fieldNames.Add(f.Name); // } //} //foreach (EpiDashboard.Rules.IDashboardRule rule in dashboardHelper.Rules) //{ // if (rule is EpiDashboard.Rules.DataAssignmentRule) // { // EpiDashboard.Rules.DataAssignmentRule assignmentRule = rule as EpiDashboard.Rules.DataAssignmentRule; // if (assignmentRule.VariableType.Equals(EpiDashboard.Rules.DashboardVariableType.Numeric)) // { // fieldNames.Add(assignmentRule.DestinationColumnName); // } // } //} ColumnDataType columnDataType = ColumnDataType.Boolean | ColumnDataType.Numeric | ColumnDataType.Text | ColumnDataType.DateTime | ColumnDataType.UserDefined; fieldNames = dashboardHelper.GetFieldsAsList(columnDataType); } else { ColumnDataType columnDataType = ColumnDataType.Boolean | ColumnDataType.Numeric | ColumnDataType.Text | ColumnDataType.DateTime | ColumnDataType.UserDefined; fieldNames = dashboardHelper.GetFieldsAsList(columnDataType); } fieldNames.Sort(); cbxSourceField.DataSource = fieldNames; cbxFieldType.Items.Add("Text"); cbxFieldType.Items.Add("Numeric"); cbxFieldType.Items.Add("Yes/No"); cbxFieldType.SelectedIndex = 0; if (editMode) { txtDestinationField.Enabled = false; } else { txtDestinationField.Enabled = true; } }
private DataGridColumn(string fieldName, ColumnDataFormat dataFormat, ColumnDataType dataType) { _fieldName = fieldName; DisplayName = fieldName; // fieldName== displayName by default DataFormat = dataFormat; DataType = dataType; UseInSummary = false; Visible = true; ShowInDataExport = true; Orderable = false; }
public static DataTemplate TemplateForColumn(MainWindow wnd, int idx, ColumnDataType type) { string template; if (type == ColumnDataType.RichText) { template = RichTextColumn.Replace("#COLUMNINDEX", idx.ToString()); MemoryStream stream = new MemoryStream(); StreamWriter writer = new StreamWriter(stream); writer.Write(template); writer.Flush(); stream.Seek(0, SeekOrigin.Begin); return (DataTemplate)XamlReader.Load(stream); } return null; }
public ColumnData(string name, string value, ColumnDataType type) { this.Name = name; this.Value = value; this.Type = type; }
public DataGridColumnAttribute() { _visible = true; _dataFormat = ColumnDataFormat.Default; _dataType = ColumnDataType.Text; }
object AddValue(ColumnDataType datatype, object o1, object o2) { if (o1 == null && o2 == null) return null; if (o1 == null) return o2; if (o2 == null) return o1; if (datatype == ColumnDataType.Auto) { if (o1 is Int64) return (Int64)o1 + (Int64)o2; if (o1 is Int32) return (Int32)o1 + (Int32)o2; if (o1 is double) { #if NO if (o2 is long) { return (double)o1 + Convert.ToDouble(o2); } return (double)o1 + (double)o2; #endif return (double)o1 + Convert.ToDouble(o2); } if (o1 is decimal) return (decimal)o1 + (decimal)o2; if (o1 is string) return (string)o1 + (string)o2; throw new Exception("无法支持的 Auto 类型累加 o1 type=" + o1.GetType().ToString() + ", o2 type=" + o2.GetType().ToString()); } if (datatype == ColumnDataType.Number) { if (o1 is Int64) return (Int64)o1 + (Int64)o2; if (o1 is Int32) return (Int32)o1 + (Int32)o2; if (o1 is double) return (double)o1 + (double)o2; if (o1 is decimal) return (decimal)o1 + (decimal)o2; if (o1 is string) // 2015/7/16 { Int64 v1 = 0; Int64 v2 = 0; Int64.TryParse(o1 as string, out v1); Int64.TryParse(o2 as string, out v2); return (v1 + v2).ToString(); } throw new Exception("无法支持的 Number 类型累加 o1 type=" + o1.GetType().ToString() + ", o2 type=" + o2.GetType().ToString()); } if (datatype == ColumnDataType.String) { if (o1 is string) return (string)o1 + (string)o2; throw new Exception("无法支持的 String 类型累加 o1 type=" + o1.GetType().ToString() + ", o2 type=" + o2.GetType().ToString()); } if (datatype == ColumnDataType.Price) // 100倍金额整数 { return (Int64)o1 + (Int64)o2; } if (datatype == ColumnDataType.PriceDouble) // double,用来表示金额。也就是最多只有两位小数部分 -- 注意,有累计误差问题,以后建议废止 { return (double)o1 + (double)o2; } if (datatype == ColumnDataType.PriceDecimal) // decimal,用来表示金额。 { return (decimal)o1 + (decimal)o2; } if (datatype == ColumnDataType.Currency) { #if NO // 这一句容易发现列 数据类型 的错误 return PriceUtil.JoinPriceString((string)o1, (string)o2); #endif return PriceUtil.Add((string)o1, (string)o2); #if NO // 这一句更健壮一些 return PriceUtil.JoinPriceString(Convert.ToString(o1), Convert.ToString(o2)); #endif } throw new Exception("无法支持的 " + datatype.ToString() + " 类型累加 o1 type=" + o1.GetType().ToString() + ", o2 type=" + o2.GetType().ToString()); }
public Column(string name, ColumnDataType dataType) { this.Name = name; this.DataType = dataType; }
private void AddColumnToDocument(string columnName, ColumnDataType columnType) { int id = Document.ColumnDefinitions.Count; OutlinerColumnDefinition definition = new OutlinerColumnDefinition(columnName, columnType); Document.ColumnDefinitions.Add(definition); OutlinerDocument.WalkRecursively(Document.FakeRootNode, delegate(OutlinerNote note, out bool shouldWalkSubItems, out bool shouldContinue) { note.CreateMissingColumns(); shouldContinue = true; shouldWalkSubItems = true; }); AddColumnBinding(definition, id); AdjustColumnSizes(); OutlinerTree.HeaderVisible = (__OutlinerTreeColumns.Count > 1) ? Visibility.Visible : Visibility.Collapsed; }
public OutlinerColumnDefinition(string name, ColumnDataType dataType) { __Name = name; __Width = DEFAULT_COLUMN_WIDTH; __DataType = dataType; }