using System; using System.IO; using System.Text; using System.Collections; using System.Windows.Forms; using System.Runtime.Serialization.Formatters.Binary; // read in struct using System.Xml; using System.Xml.Serialization; public class fmtDefineAndEnums { // values for AccessableTypes public static ushort ADDING_CAUTION = 1; public static ushort ADDING_NOTE = 2; public static ushort ADDING_RNO = 4; public static ushort ADDING_SUB = 8; public static ushort ADDING_TABLE = 16; public static ushort ADDING_NEXT = 32; public static ushort ADDING_PREV = 64; /* Fonts: index into fonts[NFONTS] array */ public static uint ELITE = 0; public static uint PICA = 1; public static uint LN_PRN = 2; public static uint CONDENSE = 3; public static uint SANSERIF = 4; public static uint PICA12 = 5; public static uint PROPORTIONAL = 6; public static uint PROPT12 = 7; public static uint HVLPT18 = 8; public static uint HVLPT25 = 9; public static uint SPECIALCHARS = 10; public static uint PT14 = 11; public static uint SANSERIF14 = 12; public static uint SANSERIF17 = 13; public static uint HVLPT12 = 14; public static uint NARRATOR = 15; public static uint MEDUPUNIVERS = 16; public static uint LGUPMED16 = 17; public static uint PROPT10 = 18; public static uint LG1275HP4SI = 19; public static uint HVLPT10 = 20; public static uint HVLPT8 = 21; public static uint HVLPT14 = 22; public static uint SANSERIF25 = 23; public static uint EYECHART = 24; public static uint TIMES11 = 25; public static uint SANSCOND = 26; /* text styles */ public static uint UNDERLINE = 64; public static uint BOLD = 128; public static uint LANDSCAPE = 256; public static uint ITALICS = 512; public static uint BOXED = 1024; public static uint BOXELEMENT = 0x00000800; public static uint TBCENTERED = 4096; public static uint RTCHECKOFF = 8192; public static uint LTCHECKOFF = 16384; public static uint BIGSCRIPT = 32768; public static uint HLTEXTHL = 65536; public static uint RTCHECKOFFWITHASTERISK = 131072; /* 0x00020000L */ public static uint DB_UNDERLINE = 262144; public static uint COLDOTS = 524288; /* 0x00080000L */ public static uint MMBOLD = 1048576; public static uint RIGHTJUSTIFY = 2097152; public static uint SUBSCRIPT = 4194304; public static uint SUPERSCRIPT = 8388608; public static uint PAGELISTITEM = 16777216; /* 0x01000000L */ public static uint PRINTONTOPOFLINE = 33554432; /* 0x02000000L */ public static uint HORZCENTER = 67108864; /* 0x04000000L */ public static uint CIRCLESTRING2 = 0x08000000; public static uint ALIGNWITHUP1 = 0x10000000; public static uint ALIGNWSECNUM = 0x20000000; public static uint MATCHCOLUMNMODE = 0x40000000; public static uint KEEPRNOSUBSTYLE = 0x80000000; /* Replace Words Defines */ public static ushort REPLACESIZE = 60; // Arrays size for ReplaceWords, **ReplaceWith, // and ReplaceFlags public static uint REPLEVERYTHING = 0x0000007F; // Turns on the Replace function for // all classes of structure types /*Highest 4 bits are OFF by Default*/ /*REPLBKGD also OFF by default*/ /*REPLHLSSETPNT also OFF by default*/ /*REPLDIFFUNIT also OFF by default*/ /*REPLTOC also OFF by default*/ /*REPLPLACKEEP also OFF by default*/ public static uint REPLHIGH = 0x0001; //Do ReplaceWords in HIGH LEVEL STEPS public static uint REPLRNO = 0x0002; //Do ReplaceWords in RNOS public static uint REPLCAUTION = 0x0004; //Do ReplaceWords in CAUTIONS public static uint REPLNOTE = 0x0008; //Do ReplaceWords in NOTES public static uint REPLTABLE = 0x0010; //Do ReplaceWords in TABLES public static uint REPLSUBSTEP = 0x0020; //Do ReplaceWords in SUBSTEPS public static uint REPLATTACH = 0x0040; //Do ReplaceWords in ATTACHMENTS public static uint REPLBKGD = 0x0080; //Do ReplaceWords in BACKGROUNDS public static uint REPLDIFFUNIT = 0x0100; //Do ReplaceWords ONLY for different UNIT # public static uint REPLTOC = 0x0200; //Do in auto table-of-contents public static uint REPLSTATTREE = 0x0400; public static uint REPLHLSSETPNT = 0x0800; //Do ReplaceWords in HighLevelStep SETPoiNTs /*These bits are used for classes which **are normally OFF, currently these **are SETPOINTS and TRANSITIONS*/ public static uint REPLTRAN = 0x1000; //Do ReplaceWords in TRANSITIONS public static uint REPLSETPOINT = 0x2000; //Do ReplaceWords in SETPOINTS /* Case Sensitivity Flags - default is off (Case Sensitive Replace)*/ public static uint REPLCASEINSENS = 0x0000C000; //Do ReplaceWords for all words that //match, regardless of case, and //replace with the ReplaceWith string //as is /* Setting either of the following flags individually replaces the ReplaceWord ** occurrance with the original matched text surrounded by any special ** characters in the ReplaceWith string*/ public static uint REPLCASEINSENSFIRST = 0x4000; //Do ReplaceWords for all words that // exactly match the ReplaceWord, except // the case of the first character may // be different public static uint REPLCASEINSENSALL = 0x8000; //Do ReplaceWords for all words that //match the ReplaceWord, regardless of //case public static uint REPLPARTIALS = 0x10000; // Do replace even on partial matches public static uint REPLPLACKEEP = 0x20000; // Do replace in PlaceKeepers public static uint REPLINSECTITLE = 0x40000; // replace words in section titles /* ** Max number of substep type groups allowed to be made. ** for use with TypeGroups */ public static short MAXTYPEGROUPS = 10; public static short ENDGROUP = 99; public static short MAXENHANCEDTYPES = 20; public static short MAXTRANS = 15; /* Max # of format defined transitions */ public static short MAXSECLEVELS = 10; public static short MAXMATCHPROCNUM = 10; public static short MAXBOXES = 24; public static short NUMBOXCHARS = 12; public static short MAXTABS = 20; } [Serializable] public struct FormatFlags { public ushort XtraFlag_0; public ushort XtraFlag_1; public ushort XtraFlag_2; public ushort XtraFlag_3; public ushort XtraFlag_4; public ushort XtraFlag_5; public ushort XtraFlag_6; public ushort XtraFlag_7; public ushort XtraFlag_8; public ushort XtraFlag_9; public ushort XtraFlag_10; public ushort XtraFlag_11; public ushort XtraFlag_12; public ushort XtraFlag_13; public ushort XtraFlag_14; public ushort XtraFlag_15; public ushort XtraFlag_16; public ushort XtraFlag_17; public ushort VEAIRFlag; // VEAIRFlag public ushort PurchaseOptions; // PurchaseOption } [Serializable] //public struct MaxRNOColumns public struct ColunmShortValues { public short OneColumn; public short TwoColumn; public short ThreeColumn; } [Serializable] public struct EditPrintShortValues { public short Edit; public short Print; } [Serializable] public struct AlternateRNOWidth { public short FirstColumn; public short SecondColumn; } [Serializable] public struct EditPrintStr { // public string ForEdit; // public string ForPrint; public Txt ForEdit; public Txt ForPrint; } [Serializable] public struct SeqTab { // Array of 9 substep levels (0-8) // starting ASCII location for sequential substep tabs //(0 = numbers, ` = lower case letters, @ = upper case letters) // The sequence is recycled beyond the defined ones. // public byte []SeqStart = new byte[9]; public byte SeqStart; // LeftJustSeqTab // - left justify the tab derived from SeqTab // (pad tab on the right side with blanks) // public short []LeftJustSeqTab = new short[9]; public short LeftJustSeqTab; // SeqTab - the ". ", ") ", etc. that follows the sequential // substep number/letter // public string []SeqSubStpTabFmt = new string[9]; // public string SeqSubStpTabFmt; // sequential substep tab format public Txt SeqSubStpTabFmt; // sequential substep tab format // // PreSeqTab - text to pre-append to the substep's SeqTab // // ex: "(" or "[" // // [9] levels of seqtab // // [2] modes: [0] = edit screen, [1] = printed page // public string [,]PreSeqSubStp = new string[9,2]; // public EditPrintStr []PreSeqSubStepTab = new EditPrintStr[9]; public EditPrintStr PreSeqSubStepTab; // // PostSeqTab - (ATA format only) // // - append this text to end of the substep's SeqTab // // [9] levels of seqtab // // [2] modes: [0] = edit screen, [1] = printed page // public string [,]PostSeqSubStp = new string[9,2]; // public EditPrintStr []PostSeqSubStepTab = new EditPrintStr[9]; public EditPrintStr PostSeqSubStepTab; } [Serializable] public struct WidSTable { public EditPrintShortValues OneColumn; public EditPrintShortValues TwoColumns; public EditPrintShortValues ThreeColumns; } [Serializable] public struct fmtTab { public uint TbStyle; // TBStyle (font type) - font public bool AlignWithParent; // AlignWithParentTab public EditPrintStr TabFmt; // TBIdent [0]-screen [1]-Print public EditPrintStr RNOTabFmt; // RNOTBIdent // public string AltPrintTabFmt; // AltPrintTBIdent public Txt AltPrintTabFmt; // AltPrintTBIdent } //[Serializable] public struct NCStr { // [XmlElement] public Txt ForEdit; public Txt ForPrint; } //[Serializable] //public struct ChkOffItem //{ //[XmlElement] // public string []Item; //} //public struct VerId //{ // [System.Xml.Serialization.XmlAttribute] // public string Text; //} public struct ChkOffSytle { [System.Xml.Serialization.XmlAttribute] public uint Style; } public struct Txt { // [System.Xml.Serialization.XmlAttribute] [XmlAttribute] public string Text; } [Serializable] public struct fmtChkOff { static int MAXCHECKOFFS = 18; public int maxcheckoffs { get { return MAXCHECKOFFS;} } static int MAXCHKHEADINGS = 5; public int MaxCheckoffHeadings { get {return MAXCHKHEADINGS;} } // RightCheckOffBox // [0]AER // [1]RNO // [2]Commitment for Braidwood // [3] (no supporting code) tied to value of TwoCheckOffspublic // public short [] CheckoffBoxPosition;// = new int[4]; public short AERCheckoffBoxPosition; public short RNOCheckoffBoxPosition; public short CommitmentMarkPosition; public short UserSelectedCheckoffPosition; // RightCheckOffChars public byte [] ChkOffScreenNotation;// = new byte[MAXCHECKOFFS]; //CheckOffWidAdjust public byte []WidthAdjustment;// = new byte[MAXCHECKOFFS]; // CheckOffHeadStyle -font // public uint []ChkOffHeaderStyle;// = new uint[MAXCHKHEADINGS]; public ChkOffSytle []ChkOffHeaderStyle; // UseCheckoffIn public int UseCheckOffsInTheseSections; //CheckOffAdjustment (not sure why we need this) public byte PosAdjustment; //RightCheckOffPrompts // [XmlElement] // public string [] ChkOffMenuItems;// = new string[MAXCHECKOFFS]; // [XmlArrayAttribute("MenuItems")] // public ChkOffItem ChkOffMenuItems; public Txt []ChkOffMenuItems; //CheckOffHeadings [XmlArrayAttribute("Headings")] // public string [] ChkOffHeadings;// = new string[MAXCHKHEADINGS]; // public ChkOffItem []ChkOffHeadings; public Txt []ChkOffHeadings; } [Serializable] public struct fmtChgBar { public short ChgBarType; // ChangeBarMessage public short FixedChangeColumn; public byte FixAERChangeColumn; public uint ChgBarStyle; // ChangeBarStyle (this is set to font) // public string ChgBar; // SpecialChangeBar or default to vertical line draw char public Txt ChgBar; // SpecialChangeBar or default to vertical line draw char } [Serializable] public struct fmtBox { static int NUMBOXCHARS = 12; public int NumBoxChars { get {return NUMBOXCHARS;} } public enum BoxPiece {BXURC, BXHorz, BXULC, BXVert, BXMLS, BXMRS, BXLRC, BXLLC, BXMID, BXLHorz, BXUMID, BXLMID} public short BoxStart; //BXStart public short BoxEnd; // BXEnd public short BoxTextStart; //BXTxtStart public short BoxTextWidth; //BXTxtWidth public short BoxHeight; //BXHeight public short BoxTabPos; //BXTabPos public uint BoxStyle; //BXStyle - font public byte BoxTextRowAdj; //BXTxtRowAdj // public string []BoxChar;// = new string[NUMBOXCHARS]; // BXChar - index with // // BoxPiece value // BXChar - index with BoxPiece value public Txt []BoxChar;// = new string[NUMBOXCHARS]; } // Current Format design has one of these for each step type [Serializable] public struct fmtStep { public uint TextStyle; // STStyle (fonts) public ushort Color; // Att (color on screen) public short BlankLinesAfter; // STExtralines (# of blank lines after this piece) public short BxInfoIdx; // STBoxindex; public short TabIndex; // STTabsindex public short PrintPosAdjust; // PrintPosAdjust public ushort AccessableTypes; // AcTable public short BlankLineAfterGroupOf; // EveryNLines (blank line after group of x items) public bool UpperCaseTrans; // AlwaysUpperCase (upper case transitions) public bool PageBreakAtTypeChange; // PageBreakAtTypechange public bool AlignWithParentTab; //AlignWithParentTab public short ChkOffGroups; //RtCheckOffGroups public short WidthOverride; // StepTypeWidthOverride (overide default width) public byte []VertPos;// = new Byte[15]; // VertPos (used for valves and checklist formats) public short ColOverride; // StepTypeColOverride (override default col positon) // public string SeparatorText; // Sep (used for OR step types for example) public Txt SeparatorText; // Sep (used for OR step types for example) // public string PrefixText; // StepPrefix public Txt PrefixText; // StepPrefix // public string SuffixText; // StepSuppfix public Txt SuffixText; // StepSuppfix // UnderlineTheseChar - print will underline these // characters along with the normal characters // public string UnderlineThese; public Txt UnderlineThese; } [Serializable] public struct RplWord { // Used to specify which step types are affected // by ReplaceWords and ReplaceWith. public uint ReplaceFlag; // List of words/phrases to replace // public string ReplaceWord; public Txt ReplaceWord; // List of replacement words/phrases // public string ReplaceWith; public Txt ReplaceWith; } [Serializable] public struct TrnsDef // used to override default transition definitions { public byte TransType; // the true transition type of format defined transitions // public string TransFmt; // format string for this transition type // public string TransMenu; // Menu string for this transition type public Txt TransFmt; // format string for this transition type public Txt TransMenu; // Menu string for this transition type } [Serializable] public struct SectLevSettings { // Position of the sub (meta) section number on printed page public byte SecNumPositionAdj; // Sub (meta) Section Title position on printed page public byte SecTitlePositionAdj; // Override ColS and assign HLS a column position based on meta // section level. Overrides automatic indentation supplied by // the TieTabToLevel logic public byte ColSByLevel; // Adjust the placement of meta sections in the table of contents public byte TofCPositionAdj; // Adjust the WidS value (print mode) based on the step level public byte WidSAdjByLevel; } [Serializable] public struct PrcDescript { // Mask to determine which procedures print procedure descriptor text // public string MatchProcNumber; public Txt MatchProcNumber; // Procedure descriptor text for procs matching the cooresponding // MatchProcNumber mask. This is then put into the page list via the // token // public string ProcDescriptor; public Txt ProcDescriptor; // 2nd procedure descriptor text put into the page list via the // public string ProcDescriptor2; public Txt ProcDescriptor2; } [Serializable] // public struct CautNoteTypesOverride public struct MenuItem { public short TextTypeValue; // Caution or Note type // public string TextType; // menu entry corresponding to text type public Txt TextType; // menu entry corresponding to text type } [Serializable] public struct AutoTableOfContents { // Auto Table of Contents formatting public byte SecNumPos; // position of section number on TOC page public byte SecTitlePos; // position of section title on TOC page public byte SecTitleLen; // max length of section title (before it is wrapped) public byte PageNumPos; // position of page number of the corresponding section public byte SpaceChar; // charcter used from end of title to page number (ex "...") public byte LineSpacing; // number of blank lines between TOC entries public byte Font; // Font to used } [Serializable] public class FmtFileVars : fmtDefineAndEnums { public string Title; // format title public int MaxNumBoxes { get {return MAXBOXES;} } public int MaxTabs { get {return MAXTABS;} } static int NUMStepTextTypes = 47; public int NumStepSubStepTypes { get {return NUMStepTextTypes;} } // Arrays size for ReplaceWords, **ReplaceWith, and ReplaceFlags public int MaxReplaceItems { get { return REPLACESIZE;} } public int MaxSectionLevels { get { return MAXSECLEVELS;} } public int MaxTypeGroups { get {return MAXTYPEGROUPS;} } public int MaxEnhancedTypes { get {return MAXENHANCEDTYPES;} } // Max # of format defined transitions public int MaxTrans { get {return MAXTRANS;} } enum StepTextTYPES { STANDARD, HIGH, IMMEDIATE, AND, OR, CAUTION, NOTE, TABLE, CONTINUOUS, AERTABLE, EQUIPMENTLIST, TITLE, PAGENUMBER, EQUIPMENTWBLANK, PROCNUMBER, REVNUMBER, ACCPAGES, LOSSOFAC, EXPLICITAND, CAUTION1, CAUTION2, NOTE1, NOTE2, PARAGRAPH, DEFAULT, NOTE3, CAUTION3, NOTE4, CAUTION4, EQUIPMENTOPT, EQUIPMENTOPTWBLANK, NOTE5, BORDERLESSAERTABLE, BORDERLESSTABLE, IMPLICITOR, FIGURE, AERFIGURE, BORDERLESSFIGURE, BORDERLESSAERFIGURE, RNOTYPE, HIGH5, TITLEWITHTEXTRIGHT, TITLEWITHTEXTBELOW, CONTACSEQUENTIAL, CONTACAND, CONTACOR, CONTACPARAGRAPH } // a.k.a. STRUCTDEFTYPES in 16bit code // public ushort []XtraFlag = new ushort[18]; // XtraFlag[0-17] // public ushort VEAIRFlag; // VEAIRFlag // public ushort PurchaseOptions; // PurchaseOption public FormatFlags FmtFlags; // XtraFlag[0-17], VEAIRFlag, PurchaseOption public bool Emode; // default edit mode (0=insert, 1=overstrike) public short TopRow; // Top Row On Sreen - this is always set to Zero in p_refresh() public bool DoPrintDriverAdjustments; // DoPrnDrvrAdjust public uint TopOfPageThingStyle; // TopOfPageThingStyle public short TopOfPageThingCol; // TopOfPageThingCol public uint ModifiedTextSytle; // ModifiedText public uint SeparatorStyle; // SeparatorStyle /* SeparatorLocation - Location of separator: ** 0 - left, 1 - right, ** 2+ - positions in the middle */ public short SeparatorLocation; public short LastLineToStartStep; // LastLineToStartStep public bool LineDrawingOption; // LineDrawingOption - always set to one (true) public short HLSTextStartPos; // ColS public short HLSTextStartPosScrnAdj; // ColSScreenAdj public short RNOTextStartPosScrnAdj; // ScrnSdjRNOText public short CautNoteTextStart; // ColT public short DefaultHLSTextPos; // ColAbs - If not tab, set ptr->Column to this value public short CautNoteTextWidth; // WidT public short NumColumns; // Pmode - number of columns - ActualPMode public short DefaultNumRNOColumns; //MaxRNO - this should be defined at a section level // MaxRNOTable[3] // Number of RNO columns for sigle, two, and tree column step section formats // public short []MaxRNOTable = new short[3]; public ColunmShortValues MaxRNOTable; // ColRTable // - starting position of RNO column this should be defined at a section level // public short []StartRNOPosition = new short[3]; public ColunmShortValues StartRNOPosition; // // WidSTable - width of HLS [0] - edit [1] - print // public short [,]HLSwidth = new short[3,2]; // Array of 3 - for each column mode // public WidsSTable []HLSwidth = new EditPrintShortValues[3]; public WidSTable HLSwidth; // ColRScreen - adjustment to starting of RNO column on screen public ColunmShortValues StartRNOPosScrnAdj; //AdjRNOCol - adjust position of RNO column public short RNOPositionAdj; // Change Bar Type and Format settings public fmtChgBar ChangeBarSettings; // Number representing the font used in the Summary Of Changes report public uint ChangeSummaryStyle; // TitleLength - Max length of title before it is split public short TitleWidthBeforeSplitting; //CoverTitleLenth - Max length of title before it is split public short CoverPgTitleWidthBeforeSplit; public fmtChkOff CheckOffSettings; // check off settings // EndMessagePos - this should be defined at a section level // overrides the default (calculated) center position of // the procedure step section's End Message but only if // a Non-Proportional Font is being used for the End Message public short EndMessageCenterPos; // Array of 9 substep levels (0-8) // starting ASCII location for sequential substep tabs //(0 = numbers, ` = lower case letters, @ = upper case letters) // The sequence is recycled beyond the defined ones. // public byte []SeqStart = new byte[9]; // Starting ASCII location for High Level Steps // This will override the use default use of numbers for // the High Level Step Tab (ex. setting to @ = upper case letters) public byte HighSeqStart; // Character used in the ReplaceWith string to start // an indent for text on following lines (IP2, PACA, PAC, SCE formats) public byte IndentToken; // Column for step header use in Vogtle for the immediate action // step type public short ImmStepHdrCol; // Style for the header public uint ImmStepHdrStyle; // if NOT zero: // [0] will be the width of the first RNO column, // [1] the width of the second. // - KEW OP format // public short []RNOWidthAlt = new short[2]; public AlternateRNOWidth RNOWidthAlt; // High Level Step Width OVerRiDe: // when not zero, specify the width of the HLSs, // overriding the value of WidSTable // - KEW OP format public short HLSWidthOVRD; // Set to the column format (1,2,3) for which PageList items // in the range -99 to -1 will be printed with the section // - either on the line at which the section begins, // or if the section is being continued from a previous page, // at the row given by the absolute value of PGrow. public short SecColHdrforActPmode; // Style variables to be applied to section headers and numbering // that are enabled by the ShowSectionTitles flag public uint SectionNumberingStyle; // Style variables to be applied to section headers and numbering //that are enabled by the ShowSectionTitles flag public uint SectionHeaderStyle; // Style variables to be applied to section headers and numbering // that are enabled by the ShowSectionTitles flag public short SectionNumPos; public byte SectionNumJust; public short SectionHeaderPos; public byte SectionHeaderJust; public short SectionTitleLength; // Indicates which substep types will NOT be influenced by the // print flag DontPaginateOnFirstSubStep3X. // Each bit position maps to the substep menu position where // 0x01 is sequential, 0x02 is the AND, 0x04 is the OR, etc. public short SubPaginationWght; // Adjust the column position by this much of the substeps to the // right of the TITLEWITHTEXTRIGHT substep type public short TextTitleAdjustment; // // Automatic Table of Contents format settings public AutoTableOfContents AutoTOC; // style used with VertPos - used for valve lineups and checklists formats public uint VertStyle; // column position of centered table on printed page public byte []TableCenterPos = new byte[3]; // LeftJustSeqTab // - left justify the tab derived from SeqTab // (pad tab on the right side with blanks) // public short []LeftJustSeqTab = new short[9]; // Specify the number of HLS's that will appear on the HLS choice menu. // Ex. if set to 2, only the first two HLS menu choices will appear public byte NumberOfHighLevelSteps; // show only this many sub step types in the sub step menu public short NumberOfSubStepTypes; // set to the "Old to New Conversion" setting (ex: A1) of the Continuous // Action Summary section set up in the Doc Style format file public uint AutoContActSummarySection; // IdentB - default bullet // public string DefaultBullet; public Txt DefaultBullet; // SeqTab - the ". ", ") ", etc. that follows the sequential // substep number/letter // public string []SeqSubStpTabFmt = new string[9]; // procedure descriptor text (use in PageList) public PrcDescript []ProcDescriptors = new PrcDescript[10]; // For version id text, DRAFT, APPROVED, TEMPORARY, etc. // Used for pagelist token // public string []VersionIdText = new string[5]; // public VerId []VersionIDText = new VerId[5]; public Txt []VersionIDText = new Txt[5]; // String to apprear before and after the procedure title in a transition. // ex. quotes around the title // public string DelimiterForTransitionTitle; public Txt DelimiterForTransitionTitle; // In transitions, delimit step number from substep letter, (ex 2.a vs 2a) // public string StepSubstepDelimeter; public Txt StepSubstepDelimeter; // Used in Through Transitions: 3a through 3c. // others: 3a. Thru 3c, 3a THROUGH 3c // public string ThroughString; public Txt ThroughString; // char in proc number to flag suffix should be used // - WPB, WPBA formats // public string ProcedureSuffixFlags; public Txt ProcedureSuffixFlags; // text that will appear next to procedure number // used by in Page List // - WPB, WPBA formats // public string []ProcedureSuffix = new string[10]; public Txt []ProcedureSuffix = new Txt[10]; // Text that appears at the top of the first page of the procedure steps // public string TopOfPageThing; public Txt TopOfPageThing; // // PreSeqTab - text to pre-append to the substep's SeqTab // // ex: "(" or "[" // // [9] levels of seqtab // // [2] modes: [0] = edit screen, [1] = printed page // public string [,]PreSeqSubStp = new string[9,2]; // public EditPrintStr []PreSeqSubStepTab = new EditPrintStr[9]; // // // PostSeqTab - (ATA format only) // // - append this text to end of the substep's SeqTab // // [9] levels of seqtab // // [2] modes: [0] = edit screen, [1] = printed page // public string [,]PostSeqSubStp = new string[9,2]; // public EditPrintStr []PostSeqSubStepTab = new EditPrintStr[9]; // Printed below the last RNO in each step // ex: "---------------------------" // public string RNOSepString; public Txt RNOSepString; // Terminate underline if matches one of defined strings // public string []UnderlineTerminate = new string[10]; public Txt []UnderlineTerminate = new Txt[10]; // printed before and after a group of Immediate actionsteps // public string []ImmStepHdr = new string[2]; public Txt []ImmStepHdr = new Txt[2]; // override menu of HLS types (descriptions only) // public string []AlternateStepTypes = new string[5]; public Txt []AlternateStepTypes = new Txt[5]; // override menu of substep types (descriptions) // public string []AlternateSubTypes = new string[16]; public Txt []AlternateSubTypes = new Txt[16]; // // Holds the string "OBSERVE NOTE|CAUTION PRIOR TO STEP X" // public string [,]ObserveNCString = new string[4,2]; // public EditPrintStr []ObserveNCString = new EditPrintStr[4]; public NCStr []ObserveNCString = new NCStr[4]; // public string PSInfFile; // Proc Specific Information file public Txt PSInfFile; // Proc Specific Information file // String to appear on the line following the high Level step text // public string HLStpSeparatorString; public Txt HLStpSeparatorString; // String to appear on the line following the high level RNO step text // public string HLRNOStpSeparatorString; public Txt HLRNOStpSeparatorString; // Used to tell the pagination logic how far up the lines array to process // while looking for a place to break. The default will divide the max lines // out by "2" to get the lower limit value. // public string LowerLimitDivisor; public Txt LowerLimitDivisor; // used with Enhance Documents, this will be used for the step number when // the user manually creates a new high level Enhanced Document step. // public string NonLinkedStepNumber; public Txt NonLinkedStepNumber; // used with Enhanced Documents, this will be used for the caution or note // tab when the user manually creates a new Enhanced Caution or Note // public string NonLinkedCautNoteNumber; public Txt NonLinkedCautNoteNumber; // Name of directory for BG documents that print in duplex // - Point Beach // public string DuplexBGDirectory; public Txt DuplexBGDirectory; // Name of directory for Dev Documents that print in duplex // - Point Beach // public string DuplexDDDirectory; public Txt DuplexDDDirectory; // used with Enhanced Deviations, this will be used // when the user does not link to an ERG step. // public string NonLinkedRNONumber; public Txt NonLinkedRNONumber; // // Format variables based on STRUCTDEFTYPES (step types) public fmtStep []StepDefinitions = new fmtStep[NUMStepTextTypes]; // // // Define Note/Caution boxes public fmtBox []BoxInfo = new fmtBox[MAXBOXES]; // // // Define Step/substep tabs public fmtTab []TabInfo = new fmtTab[MAXTABS]; // // Define override of default Note/Caution type menu // public CautNoteTypesOverride []CautNoteMenuOverride = new CautNoteTypesOverride[10]; public MenuItem []CautNoteMenuOverride = new MenuItem[10]; // SeqTab definitions (substep tabs) public SeqTab []SeqTabInfo = new SeqTab[9]; // // Define Replace Words list public RplWord []ReplaceWordList = new RplWord[REPLACESIZE]; // // // Override of default transition definitions public TrnsDef []TransDefs = new TrnsDef[MAXTRANS]; // // // Section related format settings public SectLevSettings []SectionLevelSettings = new SectLevSettings[MAXSECLEVELS]; } namespace procedureformat { public class fmtFormat { /// /// The FMT file variable settings /// private BinaryReader brFmt; private string fmtName; private byte []AllStrings; public fmtFormat(string nm) { fmtName = nm; LoadFMTFile(nm); } private string GetStringFromAllStrings(int idx) { StringBuilder sb = new StringBuilder(); while (AllStrings[idx] != 0) { sb.Append(Convert.ToChar(AllStrings[idx])); idx++; } // return sb.ToString(); return GetXMLElementText(sb.ToString()); } private string GetXMLElementText(string instr) { string rtnstr; XmlTextWriter xmlWriter; StringWriter strWriter = new StringWriter(); xmlWriter = new XmlTextWriter(strWriter); xmlWriter.WriteString(instr); xmlWriter.Flush(); xmlWriter.Close(); rtnstr = strWriter.ToString(); // Replace the single quote because ODBC fails if it's in a string. // The single quote represents the beg/end of a string when the string // is sent to ODBC. // *** COMMENT OUT FOR NOW - NOT SURE IF WE NEED TO DO THIS //rtnstr = rtnstr.Replace("\'","'"); return rtnstr; } private string GetAsciiStringUntilNull(BinaryReader br) { StringBuilder inpstr = new StringBuilder(); byte input = 0; int cnt = 0; bool stillread = true; do { try { input = br.ReadByte(); if (input==0) stillread=false; inpstr.Append(Convert.ToChar(input)); } catch (System.IO.EndOfStreamException) { stillread=false; } cnt++; }while (stillread); return (inpstr.ToString()); } private string GetAsciiString(BinaryReader br, int len) { StringBuilder inpstr = new StringBuilder(); byte input = 0; int cnt = 0; do { try { input = br.ReadByte(); inpstr.Append(Convert.ToChar(input)); } catch (System.IO.EndOfStreamException) { input = 0; while (cnt < len) { inpstr.Append(Convert.ToChar(input)); cnt++; } } cnt++; }while (cnt < len); return (inpstr.ToString()); } public void LoadFMTFile(string fname) { FmtFileVars FmtVars = new FmtFileVars(); string str = null; // read in title. brFmt = new BinaryReader(File.Open(fname,System.IO.FileMode.Open,System.IO.FileAccess.ReadWrite,FileShare.ReadWrite)); short len = brFmt.ReadInt16(); string tstr = GetAsciiString(brFmt,len); char []nulls = {Convert.ToChar(0)}; FmtVars.Title = tstr.TrimEnd(nulls); // read in struct name/def name/page file name // - ignore these. for (int i=0;i<3;i++) { len = brFmt.ReadInt16(); str = GetAsciiString(brFmt,len); } // Get the number of Int's, Long's, Char's (bytes) // - This is the number of bytes to the character strings part // of the format file. short numIntsLongsBytes = brFmt.ReadInt16(); // Read in all the Int, Long, and Char variable values // for the FMT files. Get the order of the format variables // from the FORMAT.STR file in the 16-bit code (\PROMSNT\FORMAT) // and maps the old 16-bit variables with the 32-bit structures and classes // short BytesReadIn = 0; // the first format value is a place holder, read and ignore it. byte skip_byte; ushort skip_short; uint skip_int; // FirstChar skip_byte = brFmt.ReadByte(); // XtraFlag[18] // for (int i=0; i < 18; i++) // FmtVars.XtraFlag[i] = brFmt.ReadUInt16(); FmtVars.FmtFlags.XtraFlag_0 = brFmt.ReadUInt16(); FmtVars.FmtFlags.XtraFlag_1 = brFmt.ReadUInt16(); FmtVars.FmtFlags.XtraFlag_2 = brFmt.ReadUInt16(); FmtVars.FmtFlags.XtraFlag_3 = brFmt.ReadUInt16(); FmtVars.FmtFlags.XtraFlag_4 = brFmt.ReadUInt16(); FmtVars.FmtFlags.XtraFlag_5 = brFmt.ReadUInt16(); FmtVars.FmtFlags.XtraFlag_6 = brFmt.ReadUInt16(); FmtVars.FmtFlags.XtraFlag_7 = brFmt.ReadUInt16(); FmtVars.FmtFlags.XtraFlag_8 = brFmt.ReadUInt16(); FmtVars.FmtFlags.XtraFlag_9 = brFmt.ReadUInt16(); FmtVars.FmtFlags.XtraFlag_10 = brFmt.ReadUInt16(); FmtVars.FmtFlags.XtraFlag_11 = brFmt.ReadUInt16(); FmtVars.FmtFlags.XtraFlag_12 = brFmt.ReadUInt16(); FmtVars.FmtFlags.XtraFlag_13 = brFmt.ReadUInt16(); FmtVars.FmtFlags.XtraFlag_14 = brFmt.ReadUInt16(); FmtVars.FmtFlags.XtraFlag_15 = brFmt.ReadUInt16(); FmtVars.FmtFlags.XtraFlag_16 = brFmt.ReadUInt16(); FmtVars.FmtFlags.XtraFlag_17 = brFmt.ReadUInt16(); // VEAIRFlag // FmtVars.VEAIRFlag = brFmt.ReadUInt16(); FmtVars.FmtFlags.VEAIRFlag = brFmt.ReadUInt16(); // PurchaseOption // FmtVars.PurchaseOptions = brFmt.ReadUInt16(); FmtVars.FmtFlags.PurchaseOptions = brFmt.ReadUInt16(); // EMode skip_short = brFmt.ReadUInt16(); FmtVars.Emode = (skip_short == 1); // TopRow FmtVars.TopRow = brFmt.ReadInt16(); // Appendlines (ANO, V.C. Summer) skip_short = brFmt.ReadUInt16(); // DoPrnDrvrAdjusts skip_short = brFmt.ReadUInt16(); FmtVars.DoPrintDriverAdjustments = (skip_short == 1); // STStyle[STRUCTDEFTYPES] for (int i=0; i < FmtVars.NumStepSubStepTypes; i++) FmtVars.StepDefinitions[i].TextStyle = brFmt.ReadUInt32(); // Att[STRUCTDEFTYPES] (atribute) for (int i=0;i 0) // FmtVars.BoxInfo[i].BoxChar[j] = GetStringFromAllStrings(offset-1); // FmtVars.BoxInfo[i].BoxChar[j].Item = GetStringFromAllStrings(offset-1); FmtVars.BoxInfo[i].BoxChar[j].Text = GetStringFromAllStrings(offset-1); } } // TBIdent[MAXTABS][2] for (int i=0; i < FmtVars.MaxTabs; i++) { offset = brFmt.ReadInt16(); if (offset > 0) // FmtVars.TabInfo[i].TabFmt.ForEdit = GetStringFromAllStrings(offset-1); // FmtVars.TabInfo[i].TabFmt.ForEdit.Item = GetStringFromAllStrings(offset-1); FmtVars.TabInfo[i].TabFmt.ForEdit.Text = GetStringFromAllStrings(offset-1); offset = brFmt.ReadInt16(); if (offset > 0) // FmtVars.TabInfo[i].TabFmt.ForPrint = GetStringFromAllStrings(offset-1); // FmtVars.TabInfo[i].TabFmt.ForPrint.Item = GetStringFromAllStrings(offset-1); FmtVars.TabInfo[i].TabFmt.ForPrint.Text = GetStringFromAllStrings(offset-1); } // for (int j=0; j < 2; j++) // { // offset = brFmt.ReadInt16(); // if (offset > 0) // FmtVars.TabInfo[i].TabFmt[j] = GetStringFromAllStrings(offset-1); // } // Sep[STRUCTDEFTYPES] for (int i=0;i 0) // FmtVars.StepDefinitions[i].SeparatorText = GetStringFromAllStrings(offset-1); // FmtVars.StepDefinitions[i].SeparatorText.Item = GetStringFromAllStrings(offset-1); FmtVars.StepDefinitions[i].SeparatorText.Text = GetStringFromAllStrings(offset-1); } // StepPrefix[STRUCTDEFTYPES] for (int i=0;i 0) // FmtVars.StepDefinitions[i].PrefixText = GetStringFromAllStrings(offset-1); // FmtVars.StepDefinitions[i].PrefixText.Item = GetStringFromAllStrings(offset-1); FmtVars.StepDefinitions[i].PrefixText.Text = GetStringFromAllStrings(offset-1); } // StepSuffix[STRUCTDEFTYPES] for (int i=0;i 0) // FmtVars.StepDefinitions[i].SuffixText = GetStringFromAllStrings(offset-1); // FmtVars.StepDefinitions[i].SuffixText.Item = GetStringFromAllStrings(offset-1); FmtVars.StepDefinitions[i].SuffixText.Text = GetStringFromAllStrings(offset-1); } // IdentB offset = brFmt.ReadInt16(); if (offset > 0) // FmtVars.DefaultBullet = GetStringFromAllStrings(offset-1); FmtVars.DefaultBullet.Text = GetStringFromAllStrings(offset-1); // SeqTab[9] for (int i=0; i<9; i++) { offset = brFmt.ReadInt16(); if (offset > 0) // FmtVars.SeqSubStpTabFmt[i] = GetStringFromAllStrings(offset-1); // FmtVars.SeqTabInfo[i].SeqSubStpTabFmt = GetStringFromAllStrings(offset-1); // FmtVars.SeqTabInfo[i].SeqSubStpTabFmt.Item = GetStringFromAllStrings(offset-1); FmtVars.SeqTabInfo[i].SeqSubStpTabFmt.Text = GetStringFromAllStrings(offset-1); } // ReplaceWord[REPLACESIZE] for (int i=0;i 0) // FmtVars.ReplaceWordList[i].ReplaceWord = GetStringFromAllStrings(offset-1); // FmtVars.ReplaceWordList[i].ReplaceWord.Item = GetStringFromAllStrings(offset-1); FmtVars.ReplaceWordList[i].ReplaceWord.Text = GetStringFromAllStrings(offset-1); } // ReplaceWith[REPLACESIZE] for (int i=0;i 0) // FmtVars.ReplaceWordList[i].ReplaceWith = GetStringFromAllStrings(offset-1); // FmtVars.ReplaceWordList[i].ReplaceWith.Item = GetStringFromAllStrings(offset-1); FmtVars.ReplaceWordList[i].ReplaceWith.Text = GetStringFromAllStrings(offset-1); } // MatchProcNumber[10] for (int i=0;i<10;i++) { offset = brFmt.ReadInt16(); if (offset > 0) // FmtVars.ProcDescriptors[i].MatchProcNumber = GetStringFromAllStrings(offset-1); // FmtVars.ProcDescriptors[i].MatchProcNumber.Item = GetStringFromAllStrings(offset-1); FmtVars.ProcDescriptors[i].MatchProcNumber.Text = GetStringFromAllStrings(offset-1); } // ProcDescriptor[10] for (int i=0;i<10;i++) { offset = brFmt.ReadInt16(); if (offset > 0) // FmtVars.ProcDescriptors[i].ProcDescriptor = GetStringFromAllStrings(offset-1); // FmtVars.ProcDescriptors[i].ProcDescriptor.Item = GetStringFromAllStrings(offset-1); FmtVars.ProcDescriptors[i].ProcDescriptor.Text = GetStringFromAllStrings(offset-1); } // ProcDescriptor2[10] for (int i=0;i<10;i++) { offset = brFmt.ReadInt16(); if (offset > 0) // FmtVars.ProcDescriptors[i].ProcDescriptor2 = GetStringFromAllStrings(offset-1); // FmtVars.ProcDescriptors[i].ProcDescriptor2.Item = GetStringFromAllStrings(offset-1); FmtVars.ProcDescriptors[i].ProcDescriptor2.Text = GetStringFromAllStrings(offset-1); } // VersionIdText[5] for (int i=0; i<5; i++) { offset = brFmt.ReadInt16(); if (offset > 0) // FmtVars.VersionIdText[i] = GetStringFromAllStrings(offset-1); FmtVars.VersionIDText[i].Text = GetStringFromAllStrings(offset-1); // FmtVars.VersionIDText[i].Item = GetStringFromAllStrings(offset-1); } // DelimiterForTransitionTitle offset = brFmt.ReadInt16(); if (offset > 0) // FmtVars.DelimiterForTransitionTitle = GetStringFromAllStrings(offset-1); FmtVars.DelimiterForTransitionTitle.Text = GetStringFromAllStrings(offset-1); // SetpSubstepDelimeter offset = brFmt.ReadInt16(); if (offset > 0) // FmtVars.StepSubstepDelimeter = GetStringFromAllStrings(offset-1); FmtVars.StepSubstepDelimeter.Text = GetStringFromAllStrings(offset-1); //ThroughString offset = brFmt.ReadInt16(); if (offset > 0) // FmtVars.ThroughString = GetStringFromAllStrings(offset-1); // FmtVars.ThroughString.Item = GetStringFromAllStrings(offset-1); FmtVars.ThroughString.Text = GetStringFromAllStrings(offset-1); // ProcedureSuffixFlags offset = brFmt.ReadInt16(); if (offset > 0) // FmtVars.ProcedureSuffixFlags = GetStringFromAllStrings(offset-1); FmtVars.ProcedureSuffixFlags.Text = GetStringFromAllStrings(offset-1); // ProcedureSuffix[10] for (int i=0;i<10;i++) { offset = brFmt.ReadInt16(); if (offset > 0) // FmtVars.ProcedureSuffix[i] = GetStringFromAllStrings(offset-1); // FmtVars.ProcedureSuffix[i].Item = GetStringFromAllStrings(offset-1); FmtVars.ProcedureSuffix[i].Text = GetStringFromAllStrings(offset-1); } // PlantDnLoad skip_short = brFmt.ReadUInt16(); // TopOfPageThing offset = brFmt.ReadInt16(); if (offset > 0) // FmtVars.TopOfPageThing = GetStringFromAllStrings(offset-1); FmtVars.TopOfPageThing.Text = GetStringFromAllStrings(offset-1); // XTitle[3][10] for (int i=0; i < 30; i++) skip_short= brFmt.ReadUInt16(); // TextType[10] for(int i=0;i<10;i++) { offset = brFmt.ReadInt16(); if (offset > 0) // FmtVars.CautNoteMenuOverride[i].TextType = GetStringFromAllStrings(offset-1); // FmtVars.CautNoteMenuOverride[i].TextType.Item = GetStringFromAllStrings(offset-1); FmtVars.CautNoteMenuOverride[i].TextType.Text = GetStringFromAllStrings(offset-1); } // SectionsToPrint[10] for (int i=0; i < 10; i++) skip_short = brFmt.ReadUInt16(); // SectionsNumberMask[10] for (int i=0; i < 10; i++) skip_short = brFmt.ReadUInt16(); // SectionsToPrintTitle[10] for (int i=0; i < 10; i++) skip_short = brFmt.ReadUInt16(); // DocumentTitleExtensions[10] for (int i=0; i < 10; i++) skip_short = brFmt.ReadUInt16(); // DocumentFixFileExtensions[10] for (int i=0; i < 10; i++) skip_short = brFmt.ReadUInt16(); // PreSeqTab[9][2] for (int i =0; i < 9; i++) { offset = brFmt.ReadInt16(); if (offset > 0) // FmtVars.PreSeqSubStepTab[i].ForEdit = GetStringFromAllStrings(offset-1); // FmtVars.SeqTabInfo[i].PreSeqSubStepTab.ForEdit = GetStringFromAllStrings(offset-1); // FmtVars.SeqTabInfo[i].PreSeqSubStepTab.ForEdit.Item = GetStringFromAllStrings(offset-1); FmtVars.SeqTabInfo[i].PreSeqSubStepTab.ForEdit.Text = GetStringFromAllStrings(offset-1); offset = brFmt.ReadInt16(); if (offset > 0) // FmtVars.PreSeqSubStepTab[i].ForPrint = GetStringFromAllStrings(offset-1); // FmtVars.SeqTabInfo[i].PreSeqSubStepTab.ForPrint = GetStringFromAllStrings(offset-1); // FmtVars.SeqTabInfo[i].PreSeqSubStepTab.ForPrint.Item = GetStringFromAllStrings(offset-1); FmtVars.SeqTabInfo[i].PreSeqSubStepTab.ForPrint.Text = GetStringFromAllStrings(offset-1); } // for (int j=0; j < 2; j++) // { // offset = brFmt.ReadInt16(); // if (offset > 0) // FmtVars.PreSeqSubStp[i,j] = GetStringFromAllStrings(offset-1); // } // PostSeqTab[9][2] for (int i =0; i<9;i++) { offset = brFmt.ReadInt16(); if (offset > 0) // FmtVars.PostSeqSubStepTab[i].ForEdit = GetStringFromAllStrings(offset-1); // FmtVars.SeqTabInfo[i].PostSeqSubStepTab.ForEdit = GetStringFromAllStrings(offset-1); // FmtVars.SeqTabInfo[i].PostSeqSubStepTab.ForEdit.Item = GetStringFromAllStrings(offset-1); FmtVars.SeqTabInfo[i].PostSeqSubStepTab.ForEdit.Text = GetStringFromAllStrings(offset-1); offset = brFmt.ReadInt16(); if (offset > 0) // FmtVars.PostSeqSubStepTab[i].ForPrint = GetStringFromAllStrings(offset-1); // FmtVars.SeqTabInfo[i].PostSeqSubStepTab.ForPrint = GetStringFromAllStrings(offset-1); // FmtVars.SeqTabInfo[i].PostSeqSubStepTab.ForPrint.Item = GetStringFromAllStrings(offset-1); FmtVars.SeqTabInfo[i].PostSeqSubStepTab.ForPrint.Text = GetStringFromAllStrings(offset-1); } // for (int j=0; j < 2; j++) // { // offset = brFmt.ReadInt16(); // if (offset > 0) // FmtVars.PostSeqSubStp[i,j] = GetStringFromAllStrings(offset-1); // } // RNOSepString offset = brFmt.ReadInt16(); if (offset > 0) // FmtVars.RNOSepString = GetStringFromAllStrings(offset-1); FmtVars.RNOSepString.Text = GetStringFromAllStrings(offset-1); // UnderlineTerminate[10] for (int i=0; i < 10; i++) { offset = brFmt.ReadInt16(); if (offset > 0) // FmtVars.UnderlineTerminate[i] = GetStringFromAllStrings(offset-1); // FmtVars.UnderlineTerminate[i].Item = GetStringFromAllStrings(offset-1); FmtVars.UnderlineTerminate[i].Text = GetStringFromAllStrings(offset-1); } // ImmStepHdr[2] for (int i=0; i < 2; i++) { offset = brFmt.ReadInt16(); if (offset > 0) // FmtVars.ImmStepHdr[i] = GetStringFromAllStrings(offset-1); // FmtVars.ImmStepHdr[i].Item = GetStringFromAllStrings(offset-1); FmtVars.ImmStepHdr[i].Text = GetStringFromAllStrings(offset-1); } // AlternateStepTypes[5] for (int i=0; i < 5; i++) { offset = brFmt.ReadInt16(); if (offset > 0) // FmtVars.AlternateStepTypes[i] = GetStringFromAllStrings(offset-1); // FmtVars.AlternateStepTypes[i].Item = GetStringFromAllStrings(offset-1); FmtVars.AlternateStepTypes[i].Text = GetStringFromAllStrings(offset-1); } // AlternateSubTypes[16] for (int i=0; i < 16; i++) { offset = brFmt.ReadInt16(); if (offset > 0) // FmtVars.AlternateSubTypes[i] = GetStringFromAllStrings(offset-1); // FmtVars.AlternateSubTypes[i].Item = GetStringFromAllStrings(offset-1); FmtVars.AlternateSubTypes[i].Text = GetStringFromAllStrings(offset-1); } // SpecialChangeBar offset = brFmt.ReadInt16(); if (offset > 0) // FmtVars.ChangeBarSettings.ChgBar = GetStringFromAllStrings(offset-1); // FmtVars.ChangeBarSettings.ChgBar.Item = GetStringFromAllStrings(offset-1); FmtVars.ChangeBarSettings.ChgBar.Text = GetStringFromAllStrings(offset-1); // ImperfectStructureSeparator skip_short = brFmt.ReadUInt16(); // ObserveNCString[4][2] for (int i=0; i < 4; i++) { offset = brFmt.ReadInt16(); if (offset > 0) // FmtVars.ObserveNCString[i].ForEdit = GetStringFromAllStrings(offset-1); // FmtVars.ObserveNCString[i].ForEdit.Item = GetStringFromAllStrings(offset-1); // FmtVars.ObserveNCString[i].ForEdit.Text = GetStringFromAllStrings(offset-1); FmtVars.ObserveNCString[i].ForEdit.Text = GetStringFromAllStrings(offset-1); if (offset > 0) // FmtVars.ObserveNCString[i].ForPrint = GetStringFromAllStrings(offset-1); // FmtVars.ObserveNCString[i].ForPrint.Item = GetStringFromAllStrings(offset-1); // FmtVars.ObserveNCString[i].ForPrint.Text = GetStringFromAllStrings(offset-1); FmtVars.ObserveNCString[i].ForPrint.Text = GetStringFromAllStrings(offset-1); } // for (int j=0; j < 2; j++) // { // offset = brFmt.ReadInt16(); // if (offset > 0) // FmtVars.ObserveNCString[i,j] = GetStringFromAllStrings(offset-1); // } //UnderlineTheseChar for (int i=0;i0) // FmtVars.StepDefinitions[i].UnderlineThese = GetStringFromAllStrings(offset-1); // FmtVars.StepDefinitions[i].UnderlineThese.Item = GetStringFromAllStrings(offset-1); FmtVars.StepDefinitions[i].UnderlineThese.Text = GetStringFromAllStrings(offset-1); } // SubScriptTheseChar skip_short = brFmt.ReadUInt16(); // RightCheckoffPrompts[MAXCHECKOFFS] // FmtVars.CheckOffSettings.ChkOffMenuItems = new string[FmtVars.CheckOffSettings.maxcheckoffs]; // FmtVars.CheckOffSettings.ChkOffMenuItems = new ChkOffItem[FmtVars.CheckOffSettings.maxcheckoffs]; // FmtVars.CheckOffSettings.ChkOffMenuItems.Item = new string[FmtVars.CheckOffSettings.maxcheckoffs]; FmtVars.CheckOffSettings.ChkOffMenuItems = new Txt[FmtVars.CheckOffSettings.maxcheckoffs]; for (int i=0; i < FmtVars.CheckOffSettings.maxcheckoffs; i++) { offset = brFmt.ReadInt16(); if (offset > 0) { // FmtVars.CheckOffSettings.ChkOffMenuItems[i] = GetStringFromAllStrings(offset-1); // FmtVars.CheckOffSettings.ChkOffMenuItems[i].Item = GetStringFromAllStrings(offset-1); FmtVars.CheckOffSettings.ChkOffMenuItems[i].Text = GetStringFromAllStrings(offset-1); } } // CheckOffHeadings[MAXCHKHEADINGS] // FmtVars.CheckOffSettings.ChkOffHeadings = new string[FmtVars.CheckOffSettings.MaxCheckoffHeadings]; // FmtVars.CheckOffSettings.ChkOffHeadings = new ChkOffItem[FmtVars.CheckOffSettings.MaxCheckoffHeadings]; FmtVars.CheckOffSettings.ChkOffHeadings = new Txt[FmtVars.CheckOffSettings.MaxCheckoffHeadings]; for (int i=0; i < FmtVars.CheckOffSettings.MaxCheckoffHeadings; i++) { offset = brFmt.ReadInt16(); if (offset >0) { // FmtVars.CheckOffSettings.ChkOffHeadings[i] = GetStringFromAllStrings(offset-1); // FmtVars.CheckOffSettings.ChkOffHeadings[i].Item = GetStringFromAllStrings(offset-1); FmtVars.CheckOffSettings.ChkOffHeadings[i].Text = GetStringFromAllStrings(offset-1); } } // WindEditFile skip_short = brFmt.ReadUInt16(); // PSInfFile offset = brFmt.ReadInt16(); if (offset > 0) // FmtVars.PSInfFile = GetStringFromAllStrings(offset-1); FmtVars.PSInfFile.Text = GetStringFromAllStrings(offset-1); // RNOPreSeqTab[9][2] for (int i=0;i<9;i++) for (int j=0; j<2; j++) skip_short = brFmt.ReadUInt16(); // HLStpSeparatorString offset = brFmt.ReadInt16(); if (offset >0) // FmtVars.HLStpSeparatorString = GetStringFromAllStrings(offset-1); FmtVars.HLStpSeparatorString.Text = GetStringFromAllStrings(offset-1); // HLRNOStpSeparatorString offset = brFmt.ReadInt16(); if (offset >0) // FmtVars.HLRNOStpSeparatorString = GetStringFromAllStrings(offset-1); FmtVars.HLRNOStpSeparatorString.Text = GetStringFromAllStrings(offset-1); // RNOTBIdent[MAXTABS][2] for (int i=0;i 0) // FmtVars.TabInfo[i].RNOTabFmt.ForEdit = GetStringFromAllStrings(offset-1); // FmtVars.TabInfo[i].RNOTabFmt.ForEdit.Item = GetStringFromAllStrings(offset-1); FmtVars.TabInfo[i].RNOTabFmt.ForEdit.Text = GetStringFromAllStrings(offset-1); offset = brFmt.ReadInt16(); if (offset > 0) // FmtVars.TabInfo[i].RNOTabFmt.ForPrint = GetStringFromAllStrings(offset-1); // FmtVars.TabInfo[i].RNOTabFmt.ForPrint.Item = GetStringFromAllStrings(offset-1); FmtVars.TabInfo[i].RNOTabFmt.ForPrint.Text = GetStringFromAllStrings(offset-1); } // for (int j=0;j<2;j++) // { // offset = brFmt.ReadInt16(); // if (offset > 0) // FmtVars.TabInfo[i].RNOTabFmt[j] = GetStringFromAllStrings(offset-1); // } // LowserLimitDivisor offset = brFmt.ReadInt16(); if (offset > 0) // FmtVars.LowerLimitDivisor=GetStringFromAllStrings(offset-1); FmtVars.LowerLimitDivisor.Text=GetStringFromAllStrings(offset-1); // TransFmt[MAXTRANS] for (int i=0;i 0) // FmtVars.TransDefs[i].TransFmt = GetStringFromAllStrings(offset-1); // FmtVars.TransDefs[i].TransFmt.Item = GetStringFromAllStrings(offset-1); FmtVars.TransDefs[i].TransFmt.Text = GetStringFromAllStrings(offset-1); } // TransMenu[MAXTRANS] for (int i=0;i 0) // FmtVars.TransDefs[i].TransMenu = GetStringFromAllStrings(offset-1); // FmtVars.TransDefs[i].TransMenu.Item = GetStringFromAllStrings(offset-1); FmtVars.TransDefs[i].TransMenu.Text = GetStringFromAllStrings(offset-1); } // OutsideTransFmt[MAXTRANS] for (int i=0;i 0) // FmtVars.NonLinkedStepNumber = GetStringFromAllStrings(offset-1); FmtVars.NonLinkedStepNumber.Text = GetStringFromAllStrings(offset-1); // BldLstFile skip_short = brFmt.ReadUInt16(); // AltPrintTBIdent[MAXTABS] for (int i=0;i 0) // FmtVars.TabInfo[i].AltPrintTabFmt = GetStringFromAllStrings(offset-1); // FmtVars.TabInfo[i].AltPrintTabFmt.Item = GetStringFromAllStrings(offset-1); FmtVars.TabInfo[i].AltPrintTabFmt.Text = GetStringFromAllStrings(offset-1); } // NonLinkedCautNoteNumber offset = brFmt.ReadInt16(); if (offset > 0) // FmtVars.NonLinkedCautNoteNumber = GetStringFromAllStrings(offset-1); FmtVars.NonLinkedCautNoteNumber.Text = GetStringFromAllStrings(offset-1); // F_DuplexBGDirectory offset = brFmt.ReadInt16(); if (offset > 0) // FmtVars.DuplexBGDirectory = GetStringFromAllStrings(offset-1); FmtVars.DuplexBGDirectory.Text = GetStringFromAllStrings(offset-1); // F_DuplexDDDirectory offset = brFmt.ReadInt16(); if (offset > 0) // FmtVars.DuplexDDDirectory = GetStringFromAllStrings(offset-1); FmtVars.DuplexDDDirectory.Text = GetStringFromAllStrings(offset-1); // NonLinkedRNONumber offset = brFmt.ReadInt16(); if (offset > 0) // FmtVars.NonLinkedRNONumber = GetStringFromAllStrings(offset-1); FmtVars.NonLinkedRNONumber.Text = GetStringFromAllStrings(offset-1); /***********************************************/ brFmt.Close(); // Now try to xml it.... string XMLFileName = "C:\\" + fname.Substring(fname.LastIndexOf("\\")+1) + ".XML"; XmlSerializer serializer = new XmlSerializer(typeof(FmtFileVars)); TextWriter writer = new StreamWriter(XMLFileName); serializer.Serialize(writer, FmtVars); writer.Close(); MessageBox.Show(XMLFileName,"Created XML File:"); } } }