/// <summary>
		/// Class constructor.  Initializes various elements
		/// </summary>
		public ListViewColumnSorter() {
			// Initialize the sort order to 'none'
			_orderOfSort = SortOrder.None;

			// Initialize the CaseInsensitiveComparer object
			_objectCompare = new CaseInsensitiveComparer(CultureInfo.CurrentCulture);
		}
Ejemplo n.º 2
0
 /// <summary>
 ///     构造函数
 /// </summary>
 public LvwColumnSorter()
 {
     SortColumn = 0; // 默认按第一列排序
     Order = SortOrder.None; // 排序方式为不排序
     _objectCompare = new CaseInsensitiveComparer(); // 初始化CaseInsensitiveComparer类对象
     CompareMethod = SortMethod.StringCompare; //是否使用Size比较
 }
Ejemplo n.º 3
0
 public virtual int Compare( object x, object y )
 {
     ListItem a = (ListItem)x;
     ListItem b = (ListItem)y;
     CaseInsensitiveComparer c = new CaseInsensitiveComparer();
     return c.Compare(a.Text, b.Text);
 }
        public int Compare(object x, object y)
        {
            CultureInfo ci = new CultureInfo("sv");
            CaseInsensitiveComparer aComparer = null;
			aComparer = new CaseInsensitiveComparer(ci);
            return aComparer.Compare(x, y);
        }
Ejemplo n.º 5
0
        /// <summary>
        /// Class constructor.  Initializes various elements
        /// </summary>
        public ListViewColumnSorter()
        {
            // Initialize the CaseInsensitiveComparer object
            ObjectCompare = new CaseInsensitiveComparer();

            ListViewColumnSorter_LoadSettings();
        }
		public void TestCompare_Culture ()
		{
			CultureInfo originalCulture = Thread.CurrentThread.CurrentCulture;

			try {
				Thread.CurrentThread.CurrentCulture = new CultureInfo ("tr-TR");

				// the default ctor is initialized using Thread.CurrentCulture
				CaseInsensitiveComparer cic = new CaseInsensitiveComparer ();
				Assert.AreEqual (-1, cic.Compare ("I", "i"), "#A1");
				Assert.AreEqual (0, cic.Compare ("A", "a"), "#A2");

				// changing the current culture does not affect an already
				// initialized CaseInsensitiveComparer
				Thread.CurrentThread.CurrentCulture = new CultureInfo ("nl-BE");
				Assert.AreEqual (-1, cic.Compare ("I", "i"), "#B1");
				Assert.AreEqual (0, cic.Compare ("A", "a"), "#B2");

				// but it does affect new instances
				cic = new CaseInsensitiveComparer ();
				Assert.AreEqual (0, cic.Compare ("I", "i"), "#C1");
				Assert.AreEqual (0, cic.Compare ("A", "a"), "#C2");

				// if the culture is explicitly set, then the thread culture is
				// ignored
				cic = new CaseInsensitiveComparer (new CultureInfo ("tr-TR"));
				Assert.AreEqual (-1, cic.Compare ("I", "i"), "#D1");
				Assert.AreEqual (0, cic.Compare ("A", "a"), "#D2");
			} finally {
				// restore original culture
				Thread.CurrentThread.CurrentCulture = originalCulture;
			}
		}
Ejemplo n.º 7
0
 public ListViewColumnSorter()
 {
     ColumnToSort = 0;
       OrderOfSort = SortOrder.None;
       numCompare = false;
       ObjectCompare = new CaseInsensitiveComparer();
 }
 public ListViewColumnSorter(bool sortByDate)
 {
     this.sortByDate = sortByDate;
     ColumnToSort = 0;
     OrderOfSort = SortOrder.None;
     ObjectCompare = new CaseInsensitiveComparer();
 }
Ejemplo n.º 9
0
        public int Compare(object x, object y)
        {
            int ret;
            ExplorerListItem first = x as ExplorerListItem;
            ExplorerListItem second = y as ExplorerListItem;

            if (ColumnToSort == 3)
            {
                ret = DateTime.Compare(DateTime.Parse(first.SubItems[ColumnToSort].Text), DateTime.Parse(second.SubItems[ColumnToSort].Text));
            }
            else
            {
                CaseInsensitiveComparer comp = new CaseInsensitiveComparer();

                ret = comp.Compare(first.SubItems[ColumnToSort].Text, second.SubItems[ColumnToSort].Text);
            }

            if (SortingOrder == SortOrder.Ascending)
            {
                return ret;
            }
            else if(SortingOrder == SortOrder.Descending)
            {
                return (-ret);
            }
            else
            {
                return 0;
            }
        }
Ejemplo n.º 10
0
 public ColumnSorter()
 {
     _sortColumn = 0;
       _direction = SortOrder.None;
       _stringComparer = new CaseInsensitiveComparer();
       _numericComparer = new NumericStringComparer();
 }
Ejemplo n.º 11
0
 //---------------------------------------------------------------------
 public ListViewColumnSorter()
 {
     ColumnToSort = 0;
     OrderOfSort = SortOrder.None;
     ObjectCompare = new CaseInsensitiveComparer();
     Order = SortOrder.Ascending;
 }
Ejemplo n.º 12
0
 public ListViewColumnSorter(int numericalColumn)
 {
     this.numericalColumn = numericalColumn;
     SortColumn = numericalColumn;
     Order = SortOrder.None;
     ObjectCompareAsText = new CaseInsensitiveComparer();
     ObjectCompareAsNumbers = new NumericalComparer();
 }
Ejemplo n.º 13
0
        /// <summary>
        /// Constructor
        /// </summary>
        public ListViewColumnSorter()
        {
            ColumnToSort = 0;

            OrderOfSort = System.Windows.Forms.SortOrder.None;

            ObjectCompare = new System.Collections.CaseInsensitiveComparer();
        }
Ejemplo n.º 14
0
 public ListViewColumnSorter()
 {
     ColumnOrder_ = new List<int>();
     OrderOfSort_ = new List<SortOrder>();
     ObjectCompare_ = new CaseInsensitiveComparer();
     NameOfDay_ = new List<bool>();
     LeadingZeros_ = new List<bool>();
 }
		public void TestCompare () {
			CaseInsensitiveComparer cic = new CaseInsensitiveComparer ();

			AssertEquals(cic.Compare ("WILD WEST", "Wild West"),0);
			AssertEquals(cic.Compare ("WILD WEST", "wild west"),0);
			Assert(cic.Compare ("Zeus", "Mars") > 0);
			Assert(cic.Compare ("Earth", "Venus") < 0);
		}
		public void TestCompare ()
		{
			CaseInsensitiveComparer cic = new CaseInsensitiveComparer ();

			Assert.AreEqual (0, cic.Compare ("WILD WEST", "Wild West"));
			Assert.AreEqual (0, cic.Compare ("WILD WEST", "wild west"));
			Assert.AreEqual (1, cic.Compare ("Zeus", "Mars"));
			Assert.AreEqual (-1, cic.Compare ("Earth", "Venus"));
		}
Ejemplo n.º 17
0
 /// <summary>
 /// 构造函数
 /// </summary>
 public ListViewColumnSorter()
 {
     // 默认按第一列排序
     ColumnToSort = 0;
     // 排序方式为不排序
     OrderOfSort = System.Windows.Forms.SortOrder.None;
     // 初始化CaseInsensitiveComparer类对象
     ObjectCompare = new System.Collections.CaseInsensitiveComparer();
 }
Ejemplo n.º 18
0
 /// <summary>
 /// Class constructor. Initializes various elements.
 /// </summary>
 public ListViewColumnSorter()
 {
     // Initialize the column to '0'.
     _ColumnToSort = 0;
     // Initialize the sort order to 'none'.
     _OrderOfSort = SortOrder.None;
     // Initialize the CaseInsensitiveComparer object.
     _ObjectCompare = new CaseInsensitiveComparer();
 }
Ejemplo n.º 19
0
 // Class constructor, initializes various elements
 public ListViewItemComparer()
 {
     // Initialize the column to '0'
     this.ColumnToSort = 0;
     // Initialize the sort order to 'none'
     this.OrderOfSort = SortOrder.None;
     // Initialize the CaseInsensitiveComparer object
     this.ObjectCompare = new CaseInsensitiveComparer();
 }
Ejemplo n.º 20
0
        public ListViewItemComparer(int column)
        {
            ColumnToSort = column;

            // Initialize the sort order to 'none'
            OrderOfSort = SortOrder.Descending;

            // Initialize the CaseInsensitiveComparer object
            ObjectCompare = new CaseInsensitiveComparer();
        }
Ejemplo n.º 21
0
		/// <summary>
		/// Class constructor.  Initializes various elements
		/// </summary>
		public GreenshotColumnSorter() {
			// Initialize the column to '0'
			ColumnToSort = 0;

			// Initialize the sort order to 'none'
			OrderOfSort = SortOrder.None;

			// Initialize the CaseInsensitiveComparer object
			ObjectCompare = new CaseInsensitiveComparer();
		}
Ejemplo n.º 22
0
        public ListViewColumnSorter()
        {
            ColumnToSort = 0;

            OrderOfSort = SortOrder.None;

            ObjectCompare = new CaseInsensitiveComparer();

            ElTipo = TipoComparacion.STRING;
        }
Ejemplo n.º 23
0
		public void Clear ()
		{
			if (m_InternalHashTable != null)
				m_InternalHashTable.Clear ();
			
			CaseInsensitiveHashCodeProvider	HashCodeProvider= new CaseInsensitiveHashCodeProvider (CultureInfo.InvariantCulture);
			CaseInsensitiveComparer			Comparer		= new CaseInsensitiveComparer (CultureInfo.InvariantCulture);

			m_InternalHashTable		= new Hashtable (HashCodeProvider, Comparer);
		}
Ejemplo n.º 24
0
        /// <summary>
        /// Initializes a new instance of the <see cref="ListViewColumnSorter"/> class.
        /// </summary>
        public ListViewColumnSorter()
        {
            // Initialize the column to '0'
            SortColumn = 0;

            // Initialize the sort order to 'none'
            Order = SortOrder.None;

            // Initialize the CaseInsensitiveComparer object
            objectCompare = new CaseInsensitiveComparer(Thread.CurrentThread.CurrentCulture);
        }
Ejemplo n.º 25
0
        private int CompareProcess(object a, object b)
        {
            CaseInsensitiveComparer c = new CaseInsensitiveComparer();

            if (Ascending)
            {
                return c.Compare(a, b);
            }

            return c.Compare(b, a);
        }
Ejemplo n.º 26
0
        /// <summary>
        /// ¹¹Ô캯Êý
        /// </summary>
        public ListViewColumnSorter()
        {
            // ĬÈÏ°´µÚÒ»ÁÐÅÅÐò
            ColumnToSort = 0;

            // ÅÅÐò·½Ê½Îª²»ÅÅÐò
            OrderOfSort = System.Windows.Forms.SortOrder.None;

            // ³õʼ»¯CaseInsensitiveComparerÀà¶ÔÏó
            ObjectCompare = new System.Collections.CaseInsensitiveComparer();
        }
Ejemplo n.º 27
0
        /// <summary>
        /// Class constructor.  Initializes various elements
        /// </summary>
        public ListViewColumnSorter()
        {
            // Initialize the column to '0'
            ColumnToSort = 0;

            // Initialize the sort order to 'none'
            OrderOfSort = System.Windows.Forms.SortOrder.None;

            // Initialize the CaseInsensitiveComparer object
            ObjectCompare = new CaseInsensitiveComparer();
        }
Ejemplo n.º 28
0
        /// <summary>
        /// 构造函数
        /// </summary>
        public ListViewColumnSorter()
        {
            // 默认按第一列排序
            ColumnToSort = 0;

            // 排序方式为不排序
            OrderOfSort = System.Windows.Forms.SortOrder.None;

            // 初始化CaseInsensitiveComparer类对象
            ObjectCompare = new System.Collections.CaseInsensitiveComparer();
        }
Ejemplo n.º 29
0
        //class constructor.  Initializes various elements
        public AlertsListViewSorter()
        {
            //Initialize the column to '0'
            ColumnToSort = 1;

            //Initialize the sort order to 'none'
            OrderOfSort = SortOrder.Ascending;

            //Initialize the CaseInsensitiveComparer object
            ObjectCompare = new CaseInsensitiveComparer();
        }
        /// <summary>
        /// Constructeur de classe.  Initializes various elements
        /// </summary>
        public ListViewColumnSorter()
        {
            // Initialise la colonne sur '0'
            ColumnToSort = 0;

            // Initialise l'ordre de tri sur 'aucun'
            OrderOfSort = SortOrder.None;

            // Initialise l'objet CaseInsensitiveComparer
            ObjectCompare = new CaseInsensitiveComparer();
        }
Ejemplo n.º 31
0
        /// <summary>
        /// Class constructor.  Initializes various elements
        /// </summary>
        public ListViewColumnSorter()
        {
            // Initialize the column to '0'
            SortColumn = 0;

            // Initialize the sort order to 'none'
            Order = SortOrder.None;

            // Initialize the CaseInsensitiveComparer object
            ObjectCompare = new CaseInsensitiveComparer();
        }
        /**/
        /// <summary>
        /// 指定排序的方式
        /// </summary>
        private SortOrder OrderOfSort;

        #endregion Fields

        #region Constructors

        /**/
        /// <summary>
        /// 构造函数
        /// </summary>
        public ListViewColumnSorter()
        {
            // 默认按第一列排序
            ColumnToSort = 0;

            // 排序方式为不排序
            OrderOfSort = SortOrder.None;

            // 初始化CaseInsensitiveComparer类对象
            ObjectCompare = new CaseInsensitiveComparer();
        }
Ejemplo n.º 33
0
        /// <summary>
        /// Class constructor.  Initializes various elements
        /// </summary>
        public ListViewColumnSorter()
        {
            // Initialize the column to '0'
            _columnToSort = 0;

            // Initialize the sort order to 'none'
            _orderOfSort = SortOrder.None;

            // Initialize the CaseInsensitiveComparer object
            _objectCompare = new CaseInsensitiveComparer();

            _numeric = false;
        }