Example #1
0
 internal void FriendQuit()
 {
     if (mblnOpened)
     {
         mobjDictReadCodes              = null;
         mobjDictReadValues             = null;
         mobjAcadRegisteredApplications = null;
         mobjAcadDatabase = null;
         mblnOpened       = false;
     }
 }
Example #2
0
        private bool InternReadTable(ref string nrstrErrMsg)
        {
            nrstrErrMsg = null;
            int dlngIdx = checked (mlngTblBeg + 1);
            Dictionary <object, object> dobjDictXDictionary2 = new Dictionary <object, object>();
            double ddblObjectID    = default(double);
            double ddblOwnerID     = default(double);
            int    dlngCount       = default(int);
            bool   InternReadTable = default(bool);

            if (hwpDxf_ReadRef.BkDXFReadRef_AcadSymbolTable(mobjAcadDatabase, mobjDictReadCodes, mobjDictReadValues, ref dlngIdx, ref ddblObjectID, ref ddblOwnerID, ref dlngCount, ref dobjDictXDictionary2, ref nrstrErrMsg))
            {
                mobjAcadRegisteredApplications = mobjAcadDatabase.FriendAddAcadObjectRegisteredApplications(ref nrstrErrMsg, ddblObjectID);
                bool dblnError = default(bool);
                if (mobjAcadRegisteredApplications == null)
                {
                    nrstrErrMsg = "Das Objekt konnte nicht hinzugefügt werden.";
                    dblnError   = true;
                }
                else
                {
                    mobjAcadRegisteredApplications.FriendSetDictXDictionary = dobjDictXDictionary2;
                    bool dblnStop = default(bool);
                    while (dlngIdx <= mlngTblEnd && !dblnError && !dblnStop)
                    {
                        int    dlngCode  = Conversions.ToInteger(mobjDictReadCodes[dlngIdx]);
                        object dvarValue = RuntimeHelpers.GetObjectValue(mobjDictReadValues[dlngIdx]);
                        if (dlngCode != 0 && dlngCode != 0)
                        {
                            nrstrErrMsg = "Ungültiger Gruppencode für Tabelleneintrag/ende in Zeile " + Conversions.ToString(checked (dlngIdx * 2 + 1)) + ".";
                            dblnError   = true;
                        }
                        else if (Operators.ConditionalCompareObjectEqual(dvarValue, "ENDTAB", TextCompare: false))
                        {
                            dlngIdx  = checked (dlngIdx + 1);
                            dblnStop = true;
                        }
                        else if (!InternReadAppid(ddblObjectID, ref dlngIdx, ref mobjAcadRegisteredApplications, ref nrstrErrMsg))
                        {
                            dblnError = true;
                        }
                    }
                }
                InternReadTable = !dblnError;
            }
            dobjDictXDictionary2 = null;
            return(InternReadTable);
        }
Example #3
0
 public void ListTable(ref int rlngIdx)
 {
     mobjAcadRegisteredApplications = mobjAcadDatabase.RegisteredApplications;
     if (mobjAcadRegisteredApplications != null)
     {
         InternAddToDictLine(ref rlngIdx, 0, "TABLE");
         mlngTblBeg = rlngIdx;
         AcadRegisteredApplications acadRegisteredApplications = mobjAcadRegisteredApplications;
         InternAddToDictLine(ref rlngIdx, 2, acadRegisteredApplications.DXFName);
         InternAddToDictLine(ref rlngIdx, 5, acadRegisteredApplications.Handle);
         hwpDxf_List.BkDXFList_XDictionary((Dictionary <object, object>)acadRegisteredApplications.DictXDictionaries, ref rlngIdx, ref mobjDictReadCodes, ref mobjDictReadValues);
         InternAddToDictLine(ref rlngIdx, 330, acadRegisteredApplications.OwnerID);
         InternAddToDictLine(ref rlngIdx, 100, acadRegisteredApplications.SuperiorObjectName);
         InternAddToDictLine(ref rlngIdx, 70, acadRegisteredApplications.Count);
         acadRegisteredApplications = null;
         InternListTable(ref rlngIdx);
         mlngTblEnd = rlngIdx;
         InternAddToDictLine(ref rlngIdx, 0, "ENDTAB");
     }
 }
Example #4
0
        private bool InternReadAppid(double vdblDefOwnerID, ref int rlngIdx, ref AcadRegisteredApplications robjAcadRegisteredApplications, ref string nrstrErrMsg)
        {
            nrstrErrMsg = null;
            Dictionary <object, object> dobjDictReactors2    = new Dictionary <object, object>();
            Dictionary <object, object> dobjDictXDictionary2 = new Dictionary <object, object>();
            int dlngStartIdx = rlngIdx;

            checked
            {
                double ddblObjectID    = default(double);
                double ddblOwnerID     = default(double);
                bool   InternReadAppid = default(bool);
                AcadRegisteredApplication dobjAcadRegisteredApplication2;
                if (hwpDxf_ReadRef.BkDXFReadRef_AcadSymbolTableRecord(mobjAcadDatabase, vdblDefOwnerID, "APPID", mobjDictReadCodes, mobjDictReadValues, ref rlngIdx, ref ddblObjectID, ref ddblOwnerID, ref dobjDictReactors2, ref dobjDictXDictionary2, ref nrstrErrMsg))
                {
                    bool dblnError;
                    if (Operators.ConditionalCompareObjectNotEqual(mobjDictReadCodes[rlngIdx], 100, TextCompare: false))
                    {
                        nrstrErrMsg = "Ungültiger Gruppencode für Objektname in Zeile " + Conversions.ToString(rlngIdx * 2 + 1) + ".";
                        dblnError   = true;
                    }
                    else if (Operators.ConditionalCompareObjectNotEqual(mobjDictReadValues[rlngIdx], "AcDbRegAppTableRecord", TextCompare: false))
                    {
                        nrstrErrMsg = "Ungültiger Objektname in Zeile " + Conversions.ToString(rlngIdx * 2 + 2) + ".";
                        dblnError   = true;
                    }
                    else if (Operators.ConditionalCompareObjectNotEqual(mobjDictReadCodes[rlngIdx + 1], 2, TextCompare: false))
                    {
                        nrstrErrMsg = "Ungültiger Gruppencode für Applikationsname in Zeile " + Conversions.ToString(rlngIdx * 2 + 3) + ".";
                        dblnError   = true;
                    }
                    else if (Operators.ConditionalCompareObjectNotEqual(mobjDictReadCodes[rlngIdx + 2], 70, TextCompare: false))
                    {
                        nrstrErrMsg = "Ungültiger Gruppencode für Standard-Flag-Werte in Zeile " + Conversions.ToString(rlngIdx * 2 + 5) + ".";
                        dblnError   = true;
                    }
                    else
                    {
                        string dstrName   = Conversions.ToString(mobjDictReadValues[rlngIdx + 1]);
                        int    dlngCode70 = Conversions.ToInteger(mobjDictReadValues[rlngIdx + 2]);
                        rlngIdx += 3;
                        if (Operators.ConditionalCompareObjectEqual(mobjDictReadCodes[rlngIdx], 71, TextCompare: false))
                        {
                            rlngIdx++;
                        }
                        object dvarXDataType  = default(object);
                        object dvarXDataValue = default(object);
                        dblnError = !hwpDxf_ReadBas.BkDXFReadBas_XData(ref rlngIdx, mobjDictReadCodes, mobjDictReadValues, ref dvarXDataType, ref dvarXDataValue, ref nrstrErrMsg);
                        if (!dblnError)
                        {
                            if (robjAcadRegisteredApplications.FriendNameExist(dstrName))
                            {
                                nrstrErrMsg = "Anwendung " + dstrName + " ab Zeile " + Conversions.ToString(dlngStartIdx * 2 + 1) + " existiert bereits.";
                                dblnError   = true;
                            }
                            else
                            {
                                dobjAcadRegisteredApplication2 = robjAcadRegisteredApplications.FriendAddAcadObject(dstrName, ddblObjectID, ref nrstrErrMsg);
                                if (dobjAcadRegisteredApplication2 == null)
                                {
                                    nrstrErrMsg = "Das Objekt konnte nicht hinzugefügt werden.";
                                    dblnError   = true;
                                }
                                else
                                {
                                    AcadRegisteredApplication acadRegisteredApplication = dobjAcadRegisteredApplication2;
                                    acadRegisteredApplication.FriendLetFlags70         = dlngCode70;
                                    acadRegisteredApplication.FriendSetDictReactors    = dobjDictReactors2;
                                    acadRegisteredApplication.FriendSetDictXDictionary = dobjDictXDictionary2;
                                    acadRegisteredApplication.SetXData(RuntimeHelpers.GetObjectValue(dvarXDataType), RuntimeHelpers.GetObjectValue(dvarXDataValue));
                                    acadRegisteredApplication = null;
                                }
                            }
                        }
                    }
                    InternReadAppid = !dblnError;
                }
                dobjDictReactors2              = null;
                dobjDictXDictionary2           = null;
                dobjAcadRegisteredApplication2 = null;
                return(InternReadAppid);
            }
        }