Beispiel #1
0
        //--------------------------------------------------------------------//
        //                                                        M e t h o d //
        // a d d T e x t R o w                                                //
        //--------------------------------------------------------------------//
        //                                                                    //
        // Adds a row, without numeric offset value, to the output table.     //
        //                                                                    //
        //--------------------------------------------------------------------//

        public static void addTextRow(
            PrnParseRowTypes.eType rowType,
            DataTable table,
            PrnParseConstants.eOvlShow makeOvlShow,
            String offsetText,
            String type,
            String seq,
            String desc)
        {
            if (_parseType == PrnParse.eParseType.ScanForPDL)
            {
                //------------------------------------------------------------//
                //                                                            //
                // Output inhibited.                                          //
                //                                                            //
                //------------------------------------------------------------//
            }
            else if ((_parseType == PrnParse.eParseType.MakeOverlay)
                     &&
                     (makeOvlShow ==
                      PrnParseConstants.eOvlShow.None))
            {
                //------------------------------------------------------------//
                //                                                            //
                // Output inhibited.                                          //
                //                                                            //
                //------------------------------------------------------------//
            }
            else if ((!_showMacroData) && (_macroLevel > 0))
            {
                //------------------------------------------------------------//
                //                                                            //
                // Output inhibited (e.g. don't show PCL macro contents); do  //
                // nothing.                                                   //
                //                                                            //
                //------------------------------------------------------------//
            }
            else
            {
                DataRow row;

                row = table.NewRow();

                if (_parseType == PrnParse.eParseType.MakeOverlay)
                {
                    if (makeOvlShow == PrnParseConstants.eOvlShow.Insert)
                    {
                        row[_colName_Action] = "Insert";
                    }
                    else
                    {
                        row[_colName_Action] = "";
                    }
                }

                row[_colName_RowType] = (Int32)rowType;
                // row[_colName_RowType] = rowType.ToString(); // **** DIAG ************
                row[_colName_Offset] = offsetText;
                row[_colName_Type]   = type;
                row[_colName_Seq]    = seq;
                row[_colName_Desc]   = desc;

                table.Rows.Add(row);
            }
        }
Beispiel #2
0
        //--------------------------------------------------------------------//
        //                                                        M e t h o d //
        // a d d D a t a R o w                                                //
        //--------------------------------------------------------------------//
        //                                                                    //
        // Adds a row, with numeric offset value, to the output table.        //
        //                                                                    //
        //--------------------------------------------------------------------//

        public static void addDataRow(
            PrnParseRowTypes.eType rowType,
            DataTable table,
            PrnParseConstants.eOvlShow makeOvlShow,
            PrnParseConstants.eOptOffsetFormats indxOffsetFormat,
            Int32 offset,
            Int32 level,
            String type,
            String seq,
            String desc)
        {
            if (_parseType == PrnParse.eParseType.ScanForPDL)
            {
                //------------------------------------------------------------//
                //                                                            //
                // Output inhibited.                                          //
                //                                                            //
                //------------------------------------------------------------//
            }
            else if ((_parseType == PrnParse.eParseType.MakeOverlay)
                     &&
                     (makeOvlShow ==
                      PrnParseConstants.eOvlShow.None))
            {
                //------------------------------------------------------------//
                //                                                            //
                // Output inhibited.                                          //
                //                                                            //
                //------------------------------------------------------------//
            }
            else if ((!_showMacroData) && (_macroLevel > 0))
            {
                //------------------------------------------------------------//
                //                                                            //
                // Output inhibited (e.g. don't show PCL macro contents); do  //
                // nothing.                                                   //
                //                                                            //
                //------------------------------------------------------------//
            }
            else
            {
                DataRow row;

                String offsetText;

                row = table.NewRow();

                if (offset < 0)
                {
                    if (offset ==
                        (Int32)PrnParseConstants.eOffsetPosition.StartOfFile)
                    {
                        offsetText = "<Start>";
                    }
                    else if (offset ==
                             (Int32)PrnParseConstants.eOffsetPosition.EndOfFile)
                    {
                        offsetText = "<End>";
                    }
                    else
                    {
                        offsetText = "";
                    }
                }
                else
                {
                    if (indxOffsetFormat ==
                        PrnParseConstants.eOptOffsetFormats.Decimal)
                    {
                        if (level == 0)
                        {
                            offsetText = String.Format("{0:d10}", offset);
                        }
                        else
                        {
                            offsetText = String.Format("{0:d2}", level) + ":" +
                                         String.Format("{0:d10}", offset);
                        }
                    }
                    else
                    {
                        if (level == 0)
                        {
                            offsetText = String.Format("{0:x8}", offset);
                        }
                        else
                        {
                            offsetText = String.Format("{0:x2}", level) + ":" +
                                         String.Format("{0:x8}", offset);
                        }
                    }
                }

                if ((_parseType == PrnParse.eParseType.MakeOverlay) &&
                    (makeOvlShow != PrnParseConstants.eOvlShow.None))
                {
                    row[_colName_Action] = makeOvlShow.ToString();
                }

                row[_colName_RowType] = (Int32)rowType;
                // row[_colName_RowType] = rowType.ToString(); // **** DIAG ************
                row[_colName_Offset] = offsetText;
                row[_colName_Type]   = type;
                row[_colName_Seq]    = seq;
                row[_colName_Desc]   = desc;

                table.Rows.Add(row);
            }
        }
        //--------------------------------------------------------------------//
        //                                              C o n s t r u c t o r //
        // P R N P a r s e R o w T y p e                                      //
        //                                                                    //
        //--------------------------------------------------------------------//

        public PrnParseRowType(PrnParseRowTypes.eType type,
                               String desc)
        {
            _rowType     = type;
            _rowTypeDesc = desc;
        }