示例#1
0
 public string this[ERevDataItems idx]
 {
     get
     {
         if ((int)idx == 0)
         {
             throw new IndexOutOfRangeException();
         }
         return(Cols[(int)idx]);
     }
 }
示例#2
0
        public string this[ERevDataItems idx]
        {
            get
            {
                if (idx == 0)
                {
                    throw new IndexOutOfRangeException();
                }
                return(_revDataItems[(int)idx]);
            }
            set
            {
                if (idx == 0)
                {
                    throw new IndexOutOfRangeException();
                }

                _revDataItems[(int)idx] = value;
            }
        }
示例#3
0
//		public static void ListRevInfo4(SortedList<RevDataKey, RevDataItems> revInfo)
//		{
//			if (revInfo == null) return;
//
//			int i = 1;
//
//			logMsgLn2("ri count", revInfo.Count);
//
//			foreach (KeyValuePair<RevDataKey, RevDataItems> riKvp in revInfo)
//			{
//				logMsg2(nl);
//				logMsgLn2("revision info", "---| " + i + " |---");
//
//				string columnTitle = "";
//				string columnValue = "";
//
//
//				foreach (KeyValuePair<int, RevCol> rcKvp in RevCols)
//				{
//					if (rcKvp.Key >= MAX_FIELDS) break;
//
//					switch (rcKvp.Value.Source)
//					{
//					case DERIVED:
//						{
//							int a = (int) (ERevDataDerived) rcKvp.Value.Index;
//							columnTitle = RevColumns.Columns[a];
//							columnValue = "undefined";
//							break;
//						}
//					case KEY:
//						{
//							ERevDataKey a = (ERevDataKey) rcKvp.Value.Index;
//							columnTitle = RevDataKey.Columns[a];
//							columnValue = riKvp.Key[a];
//
//							break;
//						}
//					case DATA:
//						{
//							ERevDataItems a = (ERevDataItems) rcKvp.Value.Index;
//							columnTitle = RevDataItems.Columns[a];
//							columnValue = riKvp.Value[a];
//							break;
//						}
//					}
//
//					logMsgLn2(columnTitle, columnValue);
//				}
//				i++;
//			}
//		}

        public static void ListRevInfo5(SortedList <RevDataKey, RevDataItems> revInfo)
        {
            //k0  //k1  //k2  //k3  //k4
            int[] paddingk = new [] { 0, 0, 0, 16, 9 };
            //vis //alt  //title //basis  //desc
            int[] paddingv = new [] { 20, 4, 16, 10, 0 };

            if (revInfo == null)
            {
                return;
            }

            int i = 1;

            // header
            logMsg2("ri count| " + revInfo.Count);
            logMsg2(nl);
            logMsg2("                        key                              key     key     key          key               key            item                item        item              item          item");
            logMsg2(nl);
            logMsg2("----  -- item --   ---- sort code --------------------  -alt    -type  - disc -  ---- delta -------  -- sheet --  ---- visibility ------  -rev -  ---- block -------  -- basis ---  -- description --------");
            logMsg2(nl);
            logMsg2("----  -- num ---   -----------------------------------  -num-   -code  - code -  ---- title -------  -- number -  ----------------------  -num--  ---- title -------  ------------  -----------------------");
            logMsg2(nl);

            foreach (KeyValuePair <RevDataKey, RevDataItems> riKvp in revInfo)
            {
                int pv = 0;
                int pk = 0;

                StringBuilder sb  = new StringBuilder();
                StringBuilder sbk = new StringBuilder();

                sb.Append("item --| ").Append($"{i:D3}").Append("|-- ");
                sbk.Append("item  ");

                string SortOrderKey = GetSortOrderCode(
                    riKvp.Key[ERevDataKey.REV_KEY_ALTID],
                    riKvp.Key[ERevDataKey.REV_KEY_TYPE_CODE],
                    riKvp.Key[ERevDataKey.REV_KEY_DISCIPLINE_CODE],
                    riKvp.Key[ERevDataKey.REV_KEY_SHEETNUM]
                    );

                sb.Append(" :: ").Append(SortOrderKey);
                sbk.Append("sort key  ");


                foreach (KeyValuePair <int, RevCol> rcKvp in RevCols)
                {
                    if (rcKvp.Key >= MAX_FIELDS)
                    {
                        break;
                    }

                    sb.Append(" :: ");

                    switch (rcKvp.Value.Source)
                    {
                    case DERIVED:
                    {
                        int a = (int)(ERevDataDerived)rcKvp.Value.Index;

                        sb.Append("undefined");
                        break;
                    }

                    case KEY:
                    {
                        ERevDataKey a = (ERevDataKey)rcKvp.Value.Index;

                        sb.Append(riKvp.Key[a].PadRight(paddingk[pk++]));

                        break;
                    }

                    case DATA:
                    {
                        ERevDataItems a = (ERevDataItems)rcKvp.Value.Index;

                        sb.Append(riKvp.Value[a].PadRight(paddingv[pv++]));
                        break;
                    }
                    }
                }

                logMsg2(sb.ToString() + nl);
                i++;
            }
        }