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_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);
                    }
                }
            }
        }
Example #3
0
        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
            {
            }
        }
 public static void RemoveAll(this ListBoxItemCollection items)
 {
     for (int i = items.Count - 1; i >= 0; i--)
     {
         items.RemoveAt(i);
     }
 }
Example #5
0
 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
     {
     }
 }
Example #6
0
 public MyPivotGridFilterHelper(PivotGridControl pivotGrid, ListBoxItemCollection output, ListBoxItemCollection outputDetail)
 {
     this.pivotGrid                = pivotGrid;
     this.output                   = output;
     this.outputDetail             = outputDetail;
     pivotGrid.FieldFilterChanged += pivotGrid_FieldFilterChanged;
 }
Example #7
0
        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);
                }
            });
        }
Example #8
0
        object ListBox_UpdateWindow(object obj)
        {
            maxW = 0;
            lbx  = new ListBox();
            lbis = new ListBoxItem[_colors.Length];
            Random random = new Random();

            for (int i = 0; i < _colors.Length; i++)
            {
                lbis[i] = new ListBoxItem();
                Rectangle rect = new Rectangle();
                int       wd   = _rectW + random.Next(100);
                if (wd > maxW)
                {
                    maxW = wd;
                }
                if (uniformW)
                {
                    rect.Width = _rectW;
                }
                else
                {
                    rect.Width = wd;
                }
                rect.Height   = _rectH;
                rect.Fill     = new SolidColorBrush(_colors[i]);
                lbis[i].Child = rect;
                lbx.Items.Add(lbis[i]);
            }
            lbx.VerticalOffset   = _vOffset;
            lbx.HorizontalOffset = _hOffset;
            lbx.SelectedIndex    = index;

            lbxItemColl       = lbx.Items;
            _getSelectedIndex = lbx.SelectedIndex;
            _getSelectedItem  = lbx.SelectedItem;

            mainWindow.Child = lbx;

            return(null);
        }
Example #9
0
 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, "");
     }
 }
Example #10
0
        /// <summary>
        /// Initializes a new instance of the <see cref="ListBox"/> class.
        /// </summary>
        public ListBox()
        {
            MouseScroll = true;
            MaxSelected = 0;
            Scroll      = 1;
            Size        = new Point(100, 100);
            Style       = "listbox";

            Items = new ListBoxItemCollection();
            Items.BeforeItemAdded    += Items_BeforeItemAdded;
            Items.BeforeItemsCleared += Items_BeforeItemsCleared;
            Items.ItemAdded          += Items_ItemAdded;
            Items.ItemRemoved        += Items_ItemRemoved;
            Items.ItemsSorted        += Items_ItemsSorted;

            Scrollbar      = new ScrollBar();
            Scrollbar.Dock = DockStyle.Right;
            Scrollbar.Size = new Point(25, 25);
            Elements.Add(Scrollbar);

            ClipFrame         = new Frame();
            ClipFrame.Dock    = DockStyle.Fill;
            ClipFrame.Scissor = true;
            Elements.Add(ClipFrame);

            _itemContainer          = new Frame();
            _itemContainer.AutoSize = AutoSize.Vertical;
            ClipFrame.Controls.Add(_itemContainer);

            _selected.BeforeItemAdded    += _selected_BeforeItemAdded;
            _selected.ItemAdded          += _selected_ItemAdded;
            _selected.ItemRemoved        += _selected_ItemRemoved;
            _selected.BeforeItemsCleared += _selected_BeforeItemsCleared;

            MouseWheel += ListBox_MouseWheel;
        }
Example #11
0
 public void GetUniqueValues(ITable itable_1, string string_2, ListBoxItemCollection listBoxItemCollection_0)
 {
     CommonHelper.GetUniqueValuesEx(itable_1, string_2, listBoxItemCollection_0);
 }