示例#1
0
 public ColumnSortInfo(ColumnSortInfo csi)
 {
     nIndex        = csi.nIndex;
     nSortPriority = csi.nSortPriority;
     bAscending    = csi.bAscending;
     DataType      = csi.DataType;
 }
示例#2
0
 public ColumnSortInfo(int Index, int SortPriority, bool Ascending, DatalistDataTypes dataType)
 {
     nIndex        = Index;
     nSortPriority = SortPriority;
     bAscending    = Ascending;
     DataType      = dataType;
 }
示例#3
0
 public void Add(string dispName, DatalistDataTypes valType, int width, ColumnType ColType, bool bAllowEdit)
 {
     Column ToAdd = new Column(dispName, valType, width, ColType, bAllowEdit);
     //lock (List.SyncRoot)
     {
         Add(ToAdd);
     }
 }
示例#4
0
        public void AddSortPriority(int nIndex, DatalistDataTypes dataType, int nSortPriority, bool bAscending)
        {
            if (nIndex >= 0 && nSortPriority >= 0 && AllowedToSort(dataType))
            {
                if (m_mapSortPriority.ContainsKey(nSortPriority))
                {
                    throw new InvalidOperationException("Column already in sort order mapping!");
                }

                m_mapSortPriority.Add(nSortPriority, new ColumnSortInfo(nIndex, nSortPriority, bAscending, dataType));
            }
        }
示例#5
0
        internal Column(string dispName, DatalistDataTypes valType, int width, ColumnType ColType, bool bAllowEdit)
        {
            m_Text      = dispName;
            m_ValueType = valType;
            m_Type      = ColType;

            m_bAllowUserEdit = bAllowEdit;
            m_bAscending     = false;
            //m_Selected = false;

            m_nIndex        = -1;
            m_nSortPriority = -1;

            m_StoredWidth = width;
            m_Width       = width;
        }
示例#6
0
        public Column()
        {
            m_Text      = "";
            m_ValueType = DatalistDataTypes.String;
            m_Parent    = null;
            m_Type      = ColumnType.TextNoWrap;

            m_bAllowUserEdit = false;
            m_bAscending     = false;

            //m_Selected = false;
            m_nIndex        = -1;
            m_nSortPriority = -1;

            m_StoredWidth = 100;
            m_Width       = 100;
        }
示例#7
0
 public void AddColumn(string dispName, DatalistDataTypes valType, int width, ColumnType ColType, bool bAllowEdit)
 {
     m_RowWnd.AddColumn(dispName, valType, width, ColType, bAllowEdit);
 }
示例#8
0
        private int CompareValues(bool bAscending, DatalistDataTypes dataType, object oValue1, object oValue2)
        {
            int nCompValue = 0;

            if (oValue1 == null && oValue2 == null)
            {
                nCompValue = 0;
            }
            else
            {
                if (oValue1 == null)
                {
                    nCompValue = -1;
                }
                else
                {
                    if (oValue2 == null)
                    {
                        nCompValue = 1;
                    }
                    else
                    {
                        switch (dataType)
                        {
                        case DatalistDataTypes.Boolean:
                            nCompValue = CompareObjects <bool>(oValue1, oValue2);
                            break;

                        case DatalistDataTypes.String:
                            nCompValue = CompareObjects <string>(oValue1, oValue2);
                            break;

                        case DatalistDataTypes.Short:
                            nCompValue = CompareObjects <short>(oValue1, oValue2);
                            break;

                        case DatalistDataTypes.Long:
                            nCompValue = CompareObjects <long>(oValue1, oValue2);
                            break;

                        case DatalistDataTypes.DateTime:
                            nCompValue = CompareObjects <DateTime>(oValue1, oValue2);
                            break;

                        case DatalistDataTypes.Int:
                            nCompValue = CompareObjects <int>(oValue1, oValue2);
                            break;

                        case DatalistDataTypes.Double:
                            nCompValue = CompareObjects <double>(oValue1, oValue2);
                            break;

                        case DatalistDataTypes.Float:
                            nCompValue = CompareObjects <float>(oValue1, oValue2);
                            break;

                        case DatalistDataTypes.Color:
                        case DatalistDataTypes.Object:
                        default:
                            throw new Exception("Could not sort column because sorting is not supported for the data type");
                        }
                    }
                }
            }

            return(bAscending ? -1 * nCompValue : nCompValue);
        }
示例#9
0
 internal static bool AllowedToSort(DatalistDataTypes dataType)
 {
     return(dataType != DatalistDataTypes.Color && dataType != DatalistDataTypes.Object);
 }
示例#10
0
 internal void AddColumn(string dispName, DatalistDataTypes valType, int width, ColumnType ColType, bool bAllowEdit)
 {
     m_Columns.Add(dispName, valType, width, ColType, bAllowEdit);
 }