/// <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);
		}
 /// <summary>
 ///     构造函数
 /// </summary>
 public LvwColumnSorter()
 {
     SortColumn = 0; // 默认按第一列排序
     Order = SortOrder.None; // 排序方式为不排序
     _objectCompare = new CaseInsensitiveComparer(); // 初始化CaseInsensitiveComparer类对象
     CompareMethod = SortMethod.StringCompare; //是否使用Size比较
 }
 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);
        }
Beispiel #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;
			}
		}
 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();
 }
        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;
            }
        }
 public ColumnSorter()
 {
     _sortColumn = 0;
       _direction = SortOrder.None;
       _stringComparer = new CaseInsensitiveComparer();
       _numericComparer = new NumericStringComparer();
 }
 //---------------------------------------------------------------------
 public ListViewColumnSorter()
 {
     ColumnToSort = 0;
     OrderOfSort = SortOrder.None;
     ObjectCompare = new CaseInsensitiveComparer();
     Order = SortOrder.Ascending;
 }
 public ListViewColumnSorter(int numericalColumn)
 {
     this.numericalColumn = numericalColumn;
     SortColumn = numericalColumn;
     Order = SortOrder.None;
     ObjectCompareAsText = new CaseInsensitiveComparer();
     ObjectCompareAsNumbers = new NumericalComparer();
 }
        /// <summary>
        /// Constructor
        /// </summary>
        public ListViewColumnSorter()
        {
            ColumnToSort = 0;

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

            ObjectCompare = new System.Collections.CaseInsensitiveComparer();
        }
 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"));
		}
Beispiel #17
0
 /// <summary>
 /// 构造函数
 /// </summary>
 public ListViewColumnSorter()
 {
     // 默认按第一列排序
     ColumnToSort = 0;
     // 排序方式为不排序
     OrderOfSort = System.Windows.Forms.SortOrder.None;
     // 初始化CaseInsensitiveComparer类对象
     ObjectCompare = new System.Collections.CaseInsensitiveComparer();
 }
 /// <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();
 }
 // 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();
 }
        public ListViewItemComparer(int column)
        {
            ColumnToSort = column;

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

            // Initialize the CaseInsensitiveComparer object
            ObjectCompare = new CaseInsensitiveComparer();
        }
		/// <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();
		}
        public ListViewColumnSorter()
        {
            ColumnToSort = 0;

            OrderOfSort = SortOrder.None;

            ObjectCompare = new CaseInsensitiveComparer();

            ElTipo = TipoComparacion.STRING;
        }
Beispiel #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);
		}
Beispiel #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);
        }
Beispiel #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);
        }
Beispiel #26
0
        /// <summary>
        /// ¹¹Ô캯Êý
        /// </summary>
        public ListViewColumnSorter()
        {
            // ĬÈÏ°´µÚÒ»ÁÐÅÅÐò
            ColumnToSort = 0;

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

            // ³õʼ»¯CaseInsensitiveComparerÀà¶ÔÏó
            ObjectCompare = new System.Collections.CaseInsensitiveComparer();
        }
Beispiel #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();
        }
Beispiel #28
0
        /// <summary>
        /// 构造函数
        /// </summary>
        public ListViewColumnSorter()
        {
            // 默认按第一列排序
            ColumnToSort = 0;

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

            // 初始化CaseInsensitiveComparer类对象
            ObjectCompare = new System.Collections.CaseInsensitiveComparer();
        }
        //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();
        }
        /// <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();
        }
        /// <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;
        }