예제 #1
0
        /// <summary>
        /// Displays a collection of features in the dialog
        /// </summary>
        /// <param name="features"></param>
        private void DisplayFeatures(FeatureCollection features)
        {
            try
            {
                this._listView.BeginUpdate();
                this._listView.Items.Clear();

                if (features == null)
                {
                    // if there are no items, reset the width of the headers to just something livable
                    foreach (ColumnHeader h in this._listView.Columns)
                    {
                        h.Width = 100;
                    }
                }
                else
                {
                    // otherwise add each feature into the listview
                    foreach (Feature f in features)
                    {
                        FeatureListViewItem item = new FeatureListViewItem(f);
                        this._listView.Items.Add(item);
                    }

                    // and finally auto adjust the headers
                    foreach (ColumnHeader h in this._listView.Columns)
                    {
                        h.Width = -2;
                    }
                }
            }
            catch (System.Exception systemException)
            {
                System.Diagnostics.Trace.WriteLine(systemException);
            }
            finally
            {
                this._listView.EndUpdate();
            }
        }
예제 #2
0
		/// <summary>
		/// Displays a collection of features in the dialog
		/// </summary>
		/// <param name="features"></param>
		private void DisplayFeatures(FeatureCollection features)
		{
			try
			{
				this._listView.BeginUpdate();
				this._listView.Items.Clear();

				if (features == null)
				{
					// if there are no items, reset the width of the headers to just something livable
					foreach(ColumnHeader h in this._listView.Columns)
						h.Width = 100;
				}
				else
				{
					// otherwise add each feature into the listview
					foreach(Feature f in features)
					{
						FeatureListViewItem item = new FeatureListViewItem(f);
						this._listView.Items.Add(item);
					}

					// and finally auto adjust the headers
					foreach(ColumnHeader h in this._listView.Columns)
						h.Width = -2;
				}
			}
			catch(System.Exception systemException)
			{
				System.Diagnostics.Trace.WriteLine(systemException);
			}
			finally
			{
				this._listView.EndUpdate();
			}
		}