示例#1
0
        public static ListColumns CreateResearchListColumns()
        {
            var result = new ListColumns();

            result.AddColumn(LSID.LSID_Title, DataType.dtString, 300, true, true);
            result.AddColumn(LSID.LSID_Priority, DataType.dtString, 90, true);
            result.AddColumn(LSID.LSID_Status, DataType.dtString, 90, true);
            result.AddColumn(LSID.LSID_StartDate, DataType.dtString, 90, true);
            result.AddColumn(LSID.LSID_StopDate, DataType.dtString, 90, true);
            result.AddColumn(LSID.LSID_Percent, DataType.dtInteger, 90, true);
            result.AddColumn(LSID.LSID_Changed, DataType.dtDateTime, 150, true);

            result.ResetDefaults();
            return(result);
        }
示例#2
0
        public string[] CreateFields()
        {
            ListColumns listColumns = (ListColumns)ListColumns;

            string[] fields = new string[listColumns.Count + 1]; // +empty item
            fields[0] = "";

            for (int idx = 0; idx < listColumns.Count; idx++)
            {
                var cs = listColumns[idx];
                fields[idx + 1] = GetColumnName(cs.Id);
            }

            return(fields);
        }
示例#3
0
        public static ListColumns CreateLocationListColumns()
        {
            var result = new ListColumns();

            NumberFormatInfo nfi = new NumberFormatInfo();

            nfi.NumberDecimalSeparator = ".";

            result.AddColumn(LSID.LSID_Title, DataType.dtString, 300, true, true);
            result.AddColumn(LSID.LSID_Latitude, DataType.dtFloat, 120, true, false, "0.000000", nfi);
            result.AddColumn(LSID.LSID_Longitude, DataType.dtFloat, 120, true, false, "0.000000", nfi);
            result.AddColumn(LSID.LSID_Changed, DataType.dtDateTime, 150, true);

            result.ResetDefaults();
            return(result);
        }
示例#4
0
        public override void UpdateColumns(IListView listView)
        {
            ColumnsMap_Clear();
            AddColumn(listView, "№", 50, false, 0, 0);

            NameFormat  defNameFormat = GlobalOptions.Instance.DefNameFormat;
            ListColumns columns       = (ListColumns)this.ListColumns;

            int num = columns.Count;

            for (int i = 0; i < num; i++)
            {
                ListColumn columnProps = columns.OrderedColumns[i];
                if (!columnProps.CurActive)
                {
                    continue;
                }

                const bool asz      = false;
                byte       bColType = columnProps.Id;
                if (bColType == (byte)PersonColumnType.ctName && defNameFormat != NameFormat.nfFNP)
                {
                    switch (defNameFormat)
                    {
                    case NameFormat.nfF_N_P:
                        AddColumn(listView, LangMan.LS(LSID.LSID_Surname), 150, asz, bColType, 0);
                        AddColumn(listView, LangMan.LS(LSID.LSID_Name), 100, asz, bColType, 1);
                        AddColumn(listView, LangMan.LS(LSID.LSID_Patronymic), 150, asz, bColType, 2);
                        break;

                    case NameFormat.nfF_NP:
                        AddColumn(listView, LangMan.LS(LSID.LSID_Surname), 150, asz, bColType, 0);
                        AddColumn(listView, LangMan.LS(LSID.LSID_Name) + "," + LangMan.LS(LSID.LSID_Patronymic), 150, asz, bColType, 1);
                        break;
                    }
                }
                else
                {
                    AddColumn(listView, LangMan.LS(columnProps.ColName), columnProps.CurWidth, false, bColType, 0);
                }
            }
        }
示例#5
0
        public void CopyTo(IListColumns target)
        {
            ListColumns targetColumns = target as ListColumns;

            if (targetColumns == null)
            {
                throw new ArgumentNullException("target");
            }

            int num = fColumns.Count;

            for (int i = 0; i < num; i++)
            {
                var srcCol = fColumns[i];
                var tgtCol = targetColumns.fColumns[i];

                tgtCol.Order     = srcCol.Order;
                tgtCol.CurActive = srcCol.CurActive;
                tgtCol.CurWidth  = srcCol.CurWidth;
            }

            targetColumns.UpdateOrders();
        }