private void InternListSection(ref int rlngIdx) { int friendGetClassIndex = mobjAcadClasses.FriendGetClassIndex; AcadClass dobjAcadClass; for (int dlngIdx = 0; dlngIdx <= friendGetClassIndex; dlngIdx = checked (dlngIdx + 1)) { dobjAcadClass = mobjAcadClasses.FriendGetItem(dlngIdx); if (dobjAcadClass == null) { continue; } bool dblnWrite = true; if (Operators.CompareString(mstrAcadVer, "AC1018", TextCompare: false) >= 0) { string originalClassName = dobjAcadClass.OriginalClassName; if (Operators.CompareString(originalClassName, "AcDbLayout", TextCompare: false) != 0) { if (Operators.CompareString(originalClassName, "AcDbPlaceholder", TextCompare: false) == 0) { dblnWrite = false; } } else { dblnWrite = false; } } if (dblnWrite) { AcadClass acadClass = dobjAcadClass; InternAddToDictLine(ref rlngIdx, 0, acadClass.DXFName); InternAddToDictLine(ref rlngIdx, 1, acadClass.OriginalDXFName); InternAddToDictLine(ref rlngIdx, 2, acadClass.OriginalClassName); InternAddToDictLine(ref rlngIdx, 3, acadClass.ApplicationDescription); InternAddToDictLine(ref rlngIdx, 90, acadClass.ProxyFlags); if (Operators.CompareString(mstrAcadVer, "AC1018", TextCompare: false) >= 0) { InternAddToDictLine(ref rlngIdx, 91, acadClass.InstanceCount); } InternAddToDictLine(ref rlngIdx, 280, RuntimeHelpers.GetObjectValue(Interaction.IIf(acadClass.AppWasAvailable, 0, 1))); InternAddToDictLine(ref rlngIdx, 281, acadClass.ProxyType); acadClass = null; } } dobjAcadClass = null; }
private bool InternReadClass(ref int rlngIdx, ref string nrstrErrMsg) { nrstrErrMsg = null; checked { int dlngStartIdx = rlngIdx * 2 - 1; bool dblnError = default(bool); AcadClass dobjAcadClass3; if (Operators.ConditionalCompareObjectNotEqual(mobjDictReadCodes[rlngIdx], 1, TextCompare: false)) { nrstrErrMsg = "Ungültiger Gruppencode für DXF-Klassennamen in Zeile " + Conversions.ToString(rlngIdx * 2 + 1) + "."; dblnError = true; } else if (Operators.ConditionalCompareObjectNotEqual(mobjDictReadCodes[rlngIdx + 1], 2, TextCompare: false)) { nrstrErrMsg = "Ungültiger Gruppencode für Klassennamen in Zeile " + Conversions.ToString(rlngIdx * 2 + 3) + "."; dblnError = true; } else if (Operators.ConditionalCompareObjectNotEqual(mobjDictReadCodes[rlngIdx + 2], 3, TextCompare: false)) { nrstrErrMsg = "Ungültiger Gruppencode für Applikationsbeschreibung in Zeile " + Conversions.ToString(rlngIdx * 2 + 5) + "."; dblnError = true; } else if (Operators.ConditionalCompareObjectNotEqual(mobjDictReadCodes[rlngIdx + 3], 90, TextCompare: false)) { nrstrErrMsg = "Ungültiger Gruppencode für Proxy-Flag-Werte in Zeile " + Conversions.ToString(rlngIdx * 2 + 7) + "."; dblnError = true; } else { string dstrOriginalDXFName = Conversions.ToString(mobjDictReadValues[rlngIdx]); string dstrOriginalClassName = Conversions.ToString(mobjDictReadValues[rlngIdx + 1]); string dstrApplicationDescription = Conversions.ToString(mobjDictReadValues[rlngIdx + 2]); int dlngProxyFlags = Conversions.ToInteger(mobjDictReadValues[rlngIdx + 3]); InternIncreaseIndex(ref rlngIdx, 4); int dlngInstanceCount = default(int); if (Operators.CompareString(mstrAcadVer, "AC1018", TextCompare: false) >= 0) { if (Operators.ConditionalCompareObjectNotEqual(mobjDictReadCodes[rlngIdx], 91, TextCompare: false)) { nrstrErrMsg = "Ungültiger Gruppencode für Instanzzählung für benutzerspezifische Klasse in Zeile " + Conversions.ToString(rlngIdx * 2 + 1) + "."; dblnError = true; } else { dlngInstanceCount = Conversions.ToInteger(mobjDictReadValues[rlngIdx]); InternIncreaseIndex(ref rlngIdx, 1); } } else { dlngInstanceCount = hwpDxf_Vars.plngInstanceCount; } if (!dblnError) { if (Operators.ConditionalCompareObjectNotEqual(mobjDictReadCodes[rlngIdx], 280, TextCompare: false)) { nrstrErrMsg = "Ungültiger Gruppencode für Applikationsladestatus in Zeile " + Conversions.ToString(rlngIdx * 2 + 1) + "."; dblnError = true; } else if (Operators.ConditionalCompareObjectNotEqual(mobjDictReadCodes[rlngIdx + 1], 281, TextCompare: false)) { nrstrErrMsg = "Ungültiger Gruppencode für Klassenableitung in Zeile " + Conversions.ToString(rlngIdx * 2 + 3) + "."; dblnError = true; } else { int dlngAppWasAvailable = Conversions.ToInteger(mobjDictReadValues[rlngIdx]); int dlngProxyType = Conversions.ToInteger(mobjDictReadValues[rlngIdx + 1]); InternIncreaseIndex(ref rlngIdx, 2); dobjAcadClass3 = mobjAcadClasses.FriendGetItemByOriginalClassName(dstrOriginalClassName); if (dobjAcadClass3 != null && dobjAcadClass3.ProxyFlags == dlngProxyFlags) { nrstrErrMsg = "Klasse " + dstrOriginalClassName + " ab Zeile " + Conversions.ToString(dlngStartIdx) + " existiert bereits."; dblnError = true; } if (!dblnError) { dobjAcadClass3 = mobjAcadClasses.FriendAdd(dstrOriginalClassName); AcadClass acadClass = dobjAcadClass3; acadClass.FriendLetAppWasAvailable = (dlngAppWasAvailable == 0); acadClass.FriendLetApplicationDescription = dstrApplicationDescription; acadClass.FriendLetOriginalDXFName = dstrOriginalDXFName; acadClass.FriendLetOriginalClassName = dstrOriginalClassName; acadClass.FriendLetProxyFlags = dlngProxyFlags; acadClass.FriendLetInstanceCount = dlngInstanceCount; acadClass.FriendLetProxyType = unchecked ((hwpDxf_Enums.PROXY_TYPE)dlngProxyType); acadClass = null; } } } } bool InternReadClass = !dblnError; dobjAcadClass3 = null; return(InternReadClass); } }