コード例 #1
0
ファイル: SecTables.cs プロジェクト: SoftBIM/DXFReader
        private bool InternReadSection(ref string nrstrErrMsg)
        {
            nrstrErrMsg          = null;
            mobjTableAppid       = null;
            mobjTableBlockRecord = null;
            mobjTableDimStyle    = null;
            mobjTableLayer       = null;
            mobjTableLType       = null;
            mobjTableStyle       = null;
            mobjTableUCS         = null;
            mobjTableView        = null;
            mobjTableVPort       = null;
            bool dblnError = default(bool);

            if (!InternGetTables(ref nrstrErrMsg))
            {
                dblnError = true;
            }
            else if (!InternCheckTables(ref nrstrErrMsg))
            {
                dblnError = true;
            }
            else if (!InternReadTables(ref nrstrErrMsg))
            {
                dblnError = true;
            }
            return(!dblnError);
        }
コード例 #2
0
ファイル: SecTables.cs プロジェクト: SoftBIM/DXFReader
 internal void FriendQuit()
 {
     if (mblnOpened)
     {
         if (mobjTableAppid != null)
         {
             mobjTableAppid.FriendQuit();
         }
         if (mobjTableBlockRecord != null)
         {
             mobjTableBlockRecord.FriendQuit();
         }
         if (mobjTableDimStyle != null)
         {
             mobjTableDimStyle.FriendQuit();
         }
         if (mobjTableLayer != null)
         {
             mobjTableLayer.FriendQuit();
         }
         if (mobjTableLType != null)
         {
             mobjTableLType.FriendQuit();
         }
         if (mobjTableStyle != null)
         {
             mobjTableStyle.FriendQuit();
         }
         if (mobjTableUCS != null)
         {
             mobjTableUCS.FriendQuit();
         }
         if (mobjTableView != null)
         {
             mobjTableView.FriendQuit();
         }
         if (mobjTableVPort != null)
         {
             mobjTableVPort.FriendQuit();
         }
         mobjDictReadCodes    = null;
         mobjDictReadValues   = null;
         mobjTableAppid       = null;
         mobjTableBlockRecord = null;
         mobjTableDimStyle    = null;
         mobjTableLayer       = null;
         mobjTableLType       = null;
         mobjTableStyle       = null;
         mobjTableUCS         = null;
         mobjTableView        = null;
         mobjTableVPort       = null;
         mobjAcadDatabase     = null;
         mblnOpened           = false;
     }
 }
コード例 #3
0
ファイル: SecTables.cs プロジェクト: SoftBIM/DXFReader
 private void InternListSection(ref int rlngIdx)
 {
     mobjTableVPort       = null;
     mobjTableLType       = null;
     mobjTableLayer       = null;
     mobjTableStyle       = null;
     mobjTableView        = null;
     mobjTableUCS         = null;
     mobjTableAppid       = null;
     mobjTableDimStyle    = null;
     mobjTableBlockRecord = null;
     mobjTableVPort       = new TableVPort();
     mobjTableLType       = new TableLType();
     mobjTableLayer       = new TableLayer();
     mobjTableStyle       = new TableStyle();
     mobjTableView        = new TableView();
     mobjTableUCS         = new TableUCS();
     mobjTableAppid       = new TableAppid();
     mobjTableDimStyle    = new TableDimStyle();
     mobjTableBlockRecord = new TableBlockRecord();
     mobjTableVPort.Init(ref mobjAcadDatabase, ref mobjDictReadCodes, ref mobjDictReadValues);
     mobjTableLType.Init(ref mobjAcadDatabase, ref mobjDictReadCodes, ref mobjDictReadValues);
     mobjTableLayer.Init(ref mobjAcadDatabase, ref mobjDictReadCodes, ref mobjDictReadValues);
     mobjTableStyle.Init(ref mobjAcadDatabase, ref mobjDictReadCodes, ref mobjDictReadValues);
     mobjTableView.Init(ref mobjAcadDatabase, ref mobjDictReadCodes, ref mobjDictReadValues);
     mobjTableUCS.Init(ref mobjAcadDatabase, ref mobjDictReadCodes, ref mobjDictReadValues);
     mobjTableAppid.Init(ref mobjAcadDatabase, ref mobjDictReadCodes, ref mobjDictReadValues);
     mobjTableDimStyle.Init(ref mobjAcadDatabase, ref mobjDictReadCodes, ref mobjDictReadValues);
     mobjTableBlockRecord.Init(ref mobjAcadDatabase, ref mobjDictReadCodes, ref mobjDictReadValues);
     mobjTableVPort.ListTable(ref rlngIdx);
     mobjTableLType.ListTable(ref rlngIdx);
     mobjTableLayer.ListTable(ref rlngIdx);
     mobjTableStyle.ListTable(ref rlngIdx);
     mobjTableView.ListTable(ref rlngIdx);
     mobjTableUCS.ListTable(ref rlngIdx);
     mobjTableAppid.ListTable(ref rlngIdx);
     mobjTableDimStyle.ListTable(ref rlngIdx);
     mobjTableBlockRecord.ListTable(ref rlngIdx);
 }
コード例 #4
0
ファイル: SecTables.cs プロジェクト: SoftBIM/DXFReader
        private bool InternGetTables(ref string nrstrErrMsg)
        {
            nrstrErrMsg = null;
            int dlngCount = 1;
            int dlngIdx   = mlngSecBeg;

            InternIncreaseIndex(ref dlngIdx, 1);
            bool dblnError = default(bool);

            while (dlngIdx <= mlngSecEnd && !dblnError)
            {
                int    dlngCode2  = Conversions.ToInteger(mobjDictReadCodes[dlngIdx]);
                object dvarValue2 = RuntimeHelpers.GetObjectValue(mobjDictReadValues[dlngIdx]);
                checked
                {
                    if (dlngCode2 != 0)
                    {
                        nrstrErrMsg = "Ungültiger Gruppencode für Tabellenabschnittsbeginn in Zeile " + Conversions.ToString(dlngIdx * 2 + 1) + ".";
                        dblnError   = true;
                        continue;
                    }
                    if (Operators.ConditionalCompareObjectNotEqual(dvarValue2, "TABLE", TextCompare: false))
                    {
                        nrstrErrMsg = "Ungültiger Name für Tabellenabschnittsbegin in Zeile " + Conversions.ToString(dlngIdx * 2 + 2) + ".";
                        dblnError   = true;
                        continue;
                    }
                    InternIncreaseIndex(ref dlngIdx, 1);
                    dlngCode2  = Conversions.ToInteger(mobjDictReadCodes[dlngIdx]);
                    dvarValue2 = RuntimeHelpers.GetObjectValue(mobjDictReadValues[dlngIdx]);
                    if (dlngCode2 != 2)
                    {
                        nrstrErrMsg = "Ungültiger Gruppencode für Tabellentyp in Zeile " + Conversions.ToString(dlngIdx * 2 + 1) + ".";
                        dblnError   = true;
                        continue;
                    }
                    InternIncreaseIndex(ref dlngIdx, 1);
                    object left = dvarValue2;
                    if (Operators.ConditionalCompareObjectEqual(left, "VPORT", TextCompare: false))
                    {
                        if (dlngCount == 1)
                        {
                            mobjTableVPort        = new TableVPort();
                            mobjTableVPort.TblBeg = dlngIdx - 1;
                            InternGetOneTable(ref dlngIdx);
                            mobjTableVPort.TblEnd = dlngIdx - 2;
                            dlngCount++;
                        }
                        else
                        {
                            nrstrErrMsg = "Ungültige Tabellenreihenfolge ab Zeile " + Conversions.ToString(dlngIdx * 2) + ".";
                            dblnError   = true;
                        }
                    }
                    else if (Operators.ConditionalCompareObjectEqual(left, "LTYPE", TextCompare: false))
                    {
                        if (dlngCount == 2)
                        {
                            mobjTableLType        = new TableLType();
                            mobjTableLType.TblBeg = dlngIdx - 1;
                            InternGetOneTable(ref dlngIdx);
                            mobjTableLType.TblEnd = dlngIdx - 2;
                            dlngCount++;
                        }
                        else
                        {
                            nrstrErrMsg = "Ungültige Tabellenreihenfolge ab Zeile " + Conversions.ToString(dlngIdx * 2) + ".";
                            dblnError   = true;
                        }
                    }
                    else if (Operators.ConditionalCompareObjectEqual(left, "LAYER", TextCompare: false))
                    {
                        if (dlngCount == 3)
                        {
                            mobjTableLayer        = new TableLayer();
                            mobjTableLayer.TblBeg = dlngIdx - 1;
                            InternGetOneTable(ref dlngIdx);
                            mobjTableLayer.TblEnd = dlngIdx - 2;
                            dlngCount++;
                        }
                        else
                        {
                            nrstrErrMsg = "Ungültige Tabellenreihenfolge ab Zeile " + Conversions.ToString(dlngIdx * 2) + ".";
                            dblnError   = true;
                        }
                    }
                    else if (Operators.ConditionalCompareObjectEqual(left, "STYLE", TextCompare: false))
                    {
                        if (dlngCount == 4)
                        {
                            mobjTableStyle        = new TableStyle();
                            mobjTableStyle.TblBeg = dlngIdx - 1;
                            InternGetOneTable(ref dlngIdx);
                            mobjTableStyle.TblEnd = dlngIdx - 2;
                            dlngCount++;
                        }
                        else
                        {
                            nrstrErrMsg = "Ungültige Tabellenreihenfolge ab Zeile " + Conversions.ToString(dlngIdx * 2) + ".";
                            dblnError   = true;
                        }
                    }
                    else if (Operators.ConditionalCompareObjectEqual(left, "VIEW", TextCompare: false))
                    {
                        if (dlngCount == 5)
                        {
                            mobjTableView        = new TableView();
                            mobjTableView.TblBeg = dlngIdx - 1;
                            InternGetOneTable(ref dlngIdx);
                            mobjTableView.TblEnd = dlngIdx - 2;
                            dlngCount++;
                        }
                        else
                        {
                            nrstrErrMsg = "Ungültige Tabellenreihenfolge ab Zeile " + Conversions.ToString(dlngIdx * 2) + ".";
                            dblnError   = true;
                        }
                    }
                    else if (Operators.ConditionalCompareObjectEqual(left, "UCS", TextCompare: false))
                    {
                        if (dlngCount == 6)
                        {
                            mobjTableUCS        = new TableUCS();
                            mobjTableUCS.TblBeg = dlngIdx - 1;
                            InternGetOneTable(ref dlngIdx);
                            mobjTableUCS.TblEnd = dlngIdx - 2;
                            dlngCount++;
                        }
                        else
                        {
                            nrstrErrMsg = "Ungültige Tabellenreihenfolge ab Zeile " + Conversions.ToString(dlngIdx * 2) + ".";
                            dblnError   = true;
                        }
                    }
                    else if (Operators.ConditionalCompareObjectEqual(left, "APPID", TextCompare: false))
                    {
                        if (dlngCount == 7)
                        {
                            mobjTableAppid        = new TableAppid();
                            mobjTableAppid.TblBeg = dlngIdx - 1;
                            InternGetOneTable(ref dlngIdx);
                            mobjTableAppid.TblEnd = dlngIdx - 2;
                            dlngCount++;
                        }
                        else
                        {
                            nrstrErrMsg = "Ungültige Tabellenreihenfolge ab Zeile " + Conversions.ToString(dlngIdx * 2) + ".";
                            dblnError   = true;
                        }
                    }
                    else if (Operators.ConditionalCompareObjectEqual(left, "DIMSTYLE", TextCompare: false))
                    {
                        if (dlngCount == 8)
                        {
                            mobjTableDimStyle        = new TableDimStyle();
                            mobjTableDimStyle.TblBeg = dlngIdx - 1;
                            InternGetOneTable(ref dlngIdx);
                            mobjTableDimStyle.TblEnd = dlngIdx - 2;
                            dlngCount++;
                        }
                        else
                        {
                            nrstrErrMsg = "Ungültige Tabellenreihenfolge ab Zeile " + Conversions.ToString(dlngIdx * 2) + ".";
                            dblnError   = true;
                        }
                    }
                    else if (Operators.ConditionalCompareObjectEqual(left, "BLOCK_RECORD", TextCompare: false))
                    {
                        if (dlngCount == 9)
                        {
                            mobjTableBlockRecord        = new TableBlockRecord();
                            mobjTableBlockRecord.TblBeg = dlngIdx - 1;
                            InternGetOneTable(ref dlngIdx);
                            mobjTableBlockRecord.TblEnd = dlngIdx - 2;
                            dlngCount++;
                        }
                        else
                        {
                            nrstrErrMsg = "Ungültige Tabellenreihenfolge ab Zeile " + Conversions.ToString(dlngIdx * 2) + ".";
                            dblnError   = true;
                        }
                    }
                    else
                    {
                        nrstrErrMsg = "Ungültiger Name für Tabellentyp in Zeile " + Conversions.ToString(dlngIdx * 2) + ".";
                        dblnError   = true;
                    }
                }
            }
            return(!dblnError);
        }