예제 #1
0
 public void SetXData(object vvarXDataType, object vvarXDataValue)
 {
     if (Operators.CompareString(mstrObjectName, "AcDbRegAppTable", TextCompare: false) == 0)
     {
         return;
     }
     if (vvarXDataType == null && vvarXDataValue == null)
     {
         if (mobjAcadXData != null)
         {
             mobjAcadXData.FriendQuit();
             mobjAcadXData = null;
         }
         return;
     }
     if (mobjAcadXData == null)
     {
         mobjAcadXData = new AcadXData();
         mobjAcadXData.FriendLetNodeParentID     = base.NodeID;
         mobjAcadXData.FriendLetApplicationIndex = mlngApplicationIndex;
         mobjAcadXData.FriendLetDocumentIndex    = mlngDocumentIndex;
         mobjAcadXData.FriendLetDatabaseIndex    = mlngDatabaseIndex;
         mobjAcadXData.FriendLetOwnerID          = mdblObjectID;
     }
     try
     {
         mobjAcadXData.SetXData(RuntimeHelpers.GetObjectValue(vvarXDataType), RuntimeHelpers.GetObjectValue(vvarXDataValue));
     }
     catch (Exception ex2)
     {
         ProjectData.SetProjectError(ex2);
         Exception ex         = ex2;
         string    dstrErrMsg = ExceptionHelper.GetExceptionMessage(ex);
         if (mobjAcadXData.Count == 0)
         {
             mobjAcadXData.FriendQuit();
             mobjAcadXData = null;
         }
         Information.Err().Raise(50000, "AcadObject", dstrErrMsg);
         ProjectData.ClearProjectError();
         return;
     }
     if (mobjAcadXData.Count == 0)
     {
         mobjAcadXData.FriendQuit();
         mobjAcadXData = null;
     }
 }
예제 #2
0
 internal new void FriendQuit()
 {
     if (!mblnOpened)
     {
         return;
     }
     if (mobjAcadXData != null)
     {
         mobjAcadXData.FriendQuit();
     }
     if (mdblObjectID > 0.0 && mlngDatabaseIndex > -1)
     {
         if (hwpDxf_Vars.pobjAcadDatabases.Opened)
         {
             AcadDatabase dobjAcadDatabase = hwpDxf_Vars.pobjAcadDatabases.FriendGetItem(mlngDatabaseIndex);
             if (dobjAcadDatabase != null)
             {
                 double     vdblObjectID   = mdblObjectID;
                 string     nrstrErrMsg    = "";
                 AcadObject dobjAcadObject = default(AcadObject);
                 if (dobjAcadDatabase.FriendObjectIdToObject(vdblObjectID, ref dobjAcadObject, ref nrstrErrMsg) && Operators.CompareString(mstrObjectName, dobjAcadObject.ObjectName, TextCompare: false) == 0)
                 {
                     dobjAcadDatabase.FriendRemoveObjectID(mdblObjectID);
                 }
             }
             else
             {
                 hwpDxf_Functions.BkDXF_DebugPrint("AcadObject, FriendQuit 2, Keine Datenbank: " + mstrObjectName);
             }
         }
         else
         {
             hwpDxf_Functions.BkDXF_DebugPrint("AcadObject, FriendQuit 1, Keine Datenbanken: " + mstrObjectName);
         }
     }
     base.FriendQuit();
     mdblObjectID        = -1.0;
     mdblOwnerID         = -1.0;
     mobjAcadXData       = null;
     mobjDictReactors    = null;
     mobjDictXDictionary = null;
     mblnOpened          = false;
 }