void WriteFieldFilter(PivotGridField field) { object[] values = field.FilterValues.Values; if (values.Length == 0) { return; } output.Add("=============="); output.Add(String.Format("Field '{0}'. {1} values:", field.FieldName, field.FilterValues.FilterType)); foreach (object value in values) { output.Add(String.Format("[ {0} ]", value)); } }
private void method_3(ILayer ilayer_1, ListBoxItemCollection listBoxItemCollection_0) { listBoxItemCollection_0.Clear(); ITable table = this.method_2(); if (table != null) { string str = ""; string str2 = ""; if ((table as IDataset).Workspace.Type == esriWorkspaceType.esriLocalDatabaseWorkspace) { str = "["; str2 = "]"; } IFields fields = table.Fields; for (int i = 0; i < fields.FieldCount; i++) { IField field = fields.get_Field(i); if ((field.Type != esriFieldType.esriFieldTypeGeometry) && (field.Type != esriFieldType.esriFieldTypeBlob)) { listBoxItemCollection_0.Add(str + field.Name + str2); } } } }
public void GetUniqueValues(ILayer ilayer_1, string string_1, ListBoxItemCollection listBoxItemCollection_0) { try { string str; ITable table = this.method_2(); if ((string_1[0] == '\'') || (string_1[0] == '[')) { str = string_1.Substring(1, string_1.Length - 2); } else { str = string_1; } ICursor cursor = table.Search(null, false); IDataStatistics statistics = new DataStatisticsClass { Field = str, Cursor = cursor }; IEnumerator uniqueValues = statistics.UniqueValues; uniqueValues.Reset(); int index = cursor.Fields.FindField(str); esriFieldType type = cursor.Fields.get_Field(index).Type; while (uniqueValues.MoveNext()) { listBoxItemCollection_0.Add(this.ConvertFieldValueToString(type, uniqueValues.Current)); } } catch (Exception exception) { MessageBox.Show(exception.Message); } }
private void method_18(ITable itable_1, ListBoxItemCollection listBoxItemCollection_0) { listBoxItemCollection_0.Clear(); string str = ""; string str2 = ""; try { if ((itable_1 as IDataset).Workspace.Type == esriWorkspaceType.esriLocalDatabaseWorkspace) { str = "["; str2 = "]"; } IFields fields = itable_1.Fields; for (int i = 0; i < fields.FieldCount; i++) { IField field = fields.get_Field(i); if ((((field.Type == esriFieldType.esriFieldTypeInteger) || (field.Type == esriFieldType.esriFieldTypeSingle)) || (field.Type == esriFieldType.esriFieldTypeDouble)) || (field.Type == esriFieldType.esriFieldTypeSmallInteger)) { listBoxItemCollection_0.Add(str + field.Name + str2); } } } catch { } }
private void method_3(ITable itable_1, ListBoxItemCollection listBoxItemCollection_0) { listBoxItemCollection_0.Clear(); string str = ""; string str2 = ""; try { if ((itable_1 as IDataset).Workspace.Type == esriWorkspaceType.esriLocalDatabaseWorkspace) { IWorkspace workspace = (itable_1 as IDataset).Workspace; if ((workspace.PathName != null) && (Path.GetExtension(workspace.PathName).ToLower() == ".mdb")) { str = "["; str2 = "]"; } } IFields fields = itable_1.Fields; for (int i = 0; i < fields.FieldCount; i++) { IField field = fields.get_Field(i); if ((field.Type != esriFieldType.esriFieldTypeGeometry) && (field.Type != esriFieldType.esriFieldTypeBlob)) { listBoxItemCollection_0.Add(str + field.Name + str2); } } } catch { } }
private void GenerateColumnPropertiesFromType <T>() where T : class { const BindingFlags PROPERTYFILTER = BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly | BindingFlags.Static; ListBoxItemCollection items = this._frmGridBuilder.LstGridProperties.Items; typeof(T).GetProperties(PROPERTYFILTER).ForEach(p => { if (!items.Contains(p.Name)) { items.Add(p.Name); } }); }
void WriteFieldFilterDetail(PivotGridField field) { outputDetail.Add("=============="); outputDetail.Add(String.Format("Field '{0}'. Included values:", field.FieldName)); foreach (object value in field.FilterValues.ValuesIncluded) { outputDetail.Add(String.Format("[ {0} ]", value)); } outputDetail.Add(String.Format("Field '{0}'. Excluded values:", field.FieldName)); foreach (object value in field.FilterValues.ValuesExcluded) { outputDetail.Add(String.Format("[ {0} ]", value)); } }
public void GetUniqueValues(ITable itable_1, string string_2, ListBoxItemCollection listBoxItemCollection_0) { try { string str; if ((string_2[0] == '\'') || (string_2[0] == '[')) { str = string_2.Substring(1, string_2.Length - 2); } else { str = string_2; } IQueryFilter queryFilter = new QueryFilterClass { WhereClause = "1=1" }; (queryFilter as IQueryFilterDefinition).PostfixClause = "Order by " + str; ICursor cursor = itable_1.Search(queryFilter, false); IDataStatistics statistics = new DataStatisticsClass { Field = str, Cursor = cursor }; IEnumerator uniqueValues = statistics.UniqueValues; uniqueValues.Reset(); int index = cursor.Fields.FindField(str); esriFieldType type = cursor.Fields.get_Field(index).Type; while (uniqueValues.MoveNext()) { listBoxItemCollection_0.Add(this.ConvertFieldValueToString(type, uniqueValues.Current)); } } catch (Exception exception) { Logger.Current.Error("", exception, ""); } }