126 lines
3.3 KiB
C#
126 lines
3.3 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Text;
|
|
using VEPROMS.CSLA.Library;
|
|
|
|
namespace Volian.Controls.Library
|
|
{
|
|
class TemporaryFormat
|
|
{
|
|
private static string[] _TabFormats = new string[] {
|
|
"<seq>",// 0 //STANDARD
|
|
" <number> ",// 1 //HIGH
|
|
"[<number>] ",// 2 //IMMEDIATE
|
|
"o ",// 3 //AND
|
|
"o ",// 4 //OR
|
|
"CAUTION ",// 5 //CAUTION
|
|
"NOTE ",// 6 //NOTE
|
|
"",// 7 //TABLE
|
|
" <number>* ",// 8 //CONTINUOUS
|
|
"",// 9 //AERTABLE
|
|
"o ",// 10 //EQUIPMENTLIST
|
|
"",// 11 //TITLE
|
|
"",// 12 //PAGENUMBER
|
|
"o ",// 13 //EQUIPMENTWBLANK
|
|
"",// 14 //PROCNUMBER
|
|
"",// 15 //REVNUMBER
|
|
"",// 16 //ACCPAGES
|
|
"",// 17 //LOSSOFAC
|
|
"o ",// 18 //EXPLICITAND
|
|
"CAUTION ",// 19 //CAUTION1
|
|
"CAUTION ",// 20 //CAUTION2
|
|
"NOTE ",// 21 //NOTE1
|
|
"NOTE ",// 22 //NOTE2
|
|
"",// 23 //PARAGRAPH
|
|
"",// 24 //DEFAULT
|
|
"NOTE ",// 25 //NOTE3
|
|
"CAUTION ",// 26 //CAUTION3
|
|
"NOTE ",// 27 //NOTE4
|
|
"CAUTION ",// 28 //CAUTION4
|
|
"o ",// 29 //EQUIPMENTOPT
|
|
"o ",// 30 //EQUIPMENTOPTWBLANK
|
|
"NOTE ",// 31 //NOTE5
|
|
"",// 32 //BORDERLESSAERTABLE
|
|
"",// 33 //BORDERLESSTABLE
|
|
"o ",// 34 //IMPLICITOR
|
|
"",// 35 //FIGURE
|
|
"",// 36 //AERFIGURE
|
|
"",// 37 //BORDERLESSFIGURE
|
|
"",// 38 //BORDERLESSAERFIGURE
|
|
"",// 39 //RNOTYPE
|
|
" <number>! ",// 40 //HIGH5
|
|
"",// 41 //TITLEWITHTEXTRIGHT
|
|
"",// 42 //TITLEWITHTEXTBELOW
|
|
"",// 43 //CONTACSEQUENTIAL
|
|
"o ",// 44 //CONTACAND
|
|
"o ",// 45 //CONTACOR
|
|
"" // 46 //CONTACPARAGRAPH
|
|
};
|
|
private static string[] SeqTabFormat = new string[] {
|
|
"<number>. ",
|
|
"<alpha>. ",
|
|
"<number>) ",
|
|
"<alpha>) "
|
|
};
|
|
public static string TabFormat(StepItem myDisplayItem)
|
|
{
|
|
string format = string.Empty;
|
|
if (myDisplayItem.MyItem != null)
|
|
{
|
|
int typ = (int)myDisplayItem.MyItem.MyContent.Type;
|
|
if (typ >= 20000)
|
|
{
|
|
if (myDisplayItem.RNOLevel > 0 && IsRNO(myDisplayItem.MyItem)) return "";
|
|
// Step 1: Get TabFormat from Format
|
|
format = _TabFormats[typ % 10000];
|
|
if (format == "<seq>")
|
|
{
|
|
format = SeqTabFormat[myDisplayItem.SeqLevel % SeqTabFormat.Length];
|
|
}
|
|
}
|
|
}
|
|
return format;
|
|
}
|
|
public static string TabFormat(ItemInfo item, int seqLevel)
|
|
{
|
|
string format = string.Empty;
|
|
if (item != null)
|
|
{
|
|
if (IsRNO(item)) return "";
|
|
if ((item.MyContent.Type / 10000) == 2)
|
|
{
|
|
// Step 1: Get TabFormat from Format
|
|
format = _TabFormats[((int)item.MyContent.Type) % 10000];
|
|
if (format == "<seq>")
|
|
{
|
|
format = SeqTabFormat[seqLevel];
|
|
}
|
|
}
|
|
}
|
|
return format;
|
|
}
|
|
// TODO: Move these to ItemExt.cs as properties
|
|
public static bool IsHigh(ItemInfo item)
|
|
{
|
|
// check to see if ActiveParent is a section
|
|
if(item.MyContent.Type / 10000 != 2)return false;
|
|
ItemInfo parent = (ItemInfo)item.ActiveParent;
|
|
if ((parent.MyContent.Type / 10000) == 1)
|
|
return true;
|
|
return false;
|
|
}
|
|
public static bool IsSequential(ItemInfo item)
|
|
{
|
|
//if (IsHigh(item)) return true;
|
|
if (((item.MyContent.Type / 10000) == 2) && ((((int)item.MyContent.Type) % 10000) == 0)) return true;
|
|
return false;
|
|
}
|
|
public static bool IsRNO(ItemInfo item)
|
|
{
|
|
if(item != null)
|
|
return ((item.ItemPartCount > 0) && (item.ItemParts[0].PartType == E_FromType.RNO));
|
|
return false;
|
|
}
|
|
}
|
|
}
|