Exemplo n.º 1
0
        internal static DxfAnnotationScaleObjectContextData smethod_5(
            DxfHandledObject obj,
            bool returnAny = false)
        {
            if (obj.ExtensionDictionary == null)
            {
                return((DxfAnnotationScaleObjectContextData)null);
            }
            DxfDictionary valueByName1 = obj.ExtensionDictionary.GetValueByName("AcDbContextDataManager") as DxfDictionary;

            if (valueByName1 == null)
            {
                return((DxfAnnotationScaleObjectContextData)null);
            }
            DxfDictionary valueByName2 = valueByName1.GetValueByName("ACDB_ANNOTATIONSCALES") as DxfDictionary;

            if (valueByName2 == null)
            {
                return((DxfAnnotationScaleObjectContextData)null);
            }
            DxfAnnotationScaleObjectContextData objectContextData = valueByName2.Entries.Select <IDictionaryEntry, DxfAnnotationScaleObjectContextData>((Func <IDictionaryEntry, DxfAnnotationScaleObjectContextData>)(ctxDataEntry => (DxfAnnotationScaleObjectContextData)ctxDataEntry.Value)).FirstOrDefault <DxfAnnotationScaleObjectContextData>((Func <DxfAnnotationScaleObjectContextData, bool>)(ctx => ctx.IsDefault));

            if (objectContextData == null && returnAny && valueByName2.Entries.Count != 0)
            {
                return((DxfAnnotationScaleObjectContextData)valueByName2.Entries[0].Value);
            }
            return(objectContextData);
        }
Exemplo n.º 2
0
        public override void CopyFrom(DxfHandledObject from, CloneContext cloneContext)
        {
            base.CopyFrom(from, cloneContext);
            DxfAnnotationScaleObjectContextData objectContextData = (DxfAnnotationScaleObjectContextData)from;

            if (objectContextData.Scale == null)
            {
                this.Scale = (DxfScale)null;
            }
            else if (cloneContext.SourceModel == cloneContext.TargetModel)
            {
                this.Scale = objectContextData.Scale;
            }
            else
            {
                this.Scale = (DxfScale)objectContextData.Scale.Clone(cloneContext);
            }
        }
Exemplo n.º 3
0
        internal static void smethod_8(DxfEntity obj)
        {
            if (DxfScale.smethod_2(obj.Layer) == null)
            {
                return;
            }
            DxfLayer oldLayer;
            DxfScale scale = DxfScale.smethod_4(obj.Layer, out oldLayer);

            if (scale == null)
            {
                return;
            }
            DxfAnnotationScaleObjectContextData contextData = ((IAnnotative)obj).CreateContextData(scale);

            obj.Layer = oldLayer;
            DxfDictionary dxfDictionary = DxfAnnotationScaleObjectContextData.smethod_6((DxfHandledObject)obj);

            dxfDictionary.Entries.Clear();
            dxfDictionary.Entries.Add((IDictionaryEntry) new DxfDictionaryEntry("*A", (DxfObject)contextData));
        }
Exemplo n.º 4
0
        internal static double smethod_9(DxfEntity obj, DxfScale scale)
        {
            // ISSUE: object of a compiler-generated type is created
            // ISSUE: variable of a compiler-generated type
            DxfAnnotationScaleObjectContextData.Class357 class357 = new DxfAnnotationScaleObjectContextData.Class357();
            // ISSUE: reference to a compiler-generated field
            class357.dxfScale_0 = scale;
            if (obj.ExtensionDictionary == null)
            {
                return(1.0);
            }
            DxfDictionary valueByName1 = obj.ExtensionDictionary.GetValueByName("AcDbContextDataManager") as DxfDictionary;

            if (valueByName1 == null)
            {
                return(1.0);
            }
            DxfDictionary valueByName2 = valueByName1.GetValueByName("ACDB_ANNOTATIONSCALES") as DxfDictionary;

            if (valueByName2 == null)
            {
                return(1.0);
            }
            // ISSUE: reference to a compiler-generated method
            DxfAnnotationScaleObjectContextData objectContextData1 = valueByName2.Entries.Select <IDictionaryEntry, DxfAnnotationScaleObjectContextData>((Func <IDictionaryEntry, DxfAnnotationScaleObjectContextData>)(ctxDataEntry => (DxfAnnotationScaleObjectContextData)ctxDataEntry.Value)).FirstOrDefault <DxfAnnotationScaleObjectContextData>(new Func <DxfAnnotationScaleObjectContextData, bool>(class357.method_0));

            if (objectContextData1 == null || objectContextData1.IsDefault)
            {
                return(1.0);
            }
            DxfAnnotationScaleObjectContextData objectContextData2 = valueByName2.Entries.Select <IDictionaryEntry, DxfAnnotationScaleObjectContextData>((Func <IDictionaryEntry, DxfAnnotationScaleObjectContextData>)(ctxDataEntry => (DxfAnnotationScaleObjectContextData)ctxDataEntry.Value)).FirstOrDefault <DxfAnnotationScaleObjectContextData>((Func <DxfAnnotationScaleObjectContextData, bool>)(ctx => ctx.IsDefault));

            if (objectContextData2 == null)
            {
                return(1.0);
            }
            return(objectContextData1.Scale.ScaleFactor / objectContextData2.Scale.ScaleFactor);
        }
Exemplo n.º 5
0
        internal static DxfAnnotationScaleObjectContextData smethod_4(
            DxfHandledObject obj,
            DxfScale scale,
            bool ignoreDefault)
        {
            // ISSUE: object of a compiler-generated type is created
            // ISSUE: variable of a compiler-generated type
            DxfAnnotationScaleObjectContextData.Class356 class356 = new DxfAnnotationScaleObjectContextData.Class356();
            // ISSUE: reference to a compiler-generated field
            class356.dxfScale_0 = scale;
            // ISSUE: reference to a compiler-generated field
            if (obj.ExtensionDictionary == null || class356.dxfScale_0 == null)
            {
                return((DxfAnnotationScaleObjectContextData)null);
            }
            DxfDictionary valueByName1 = obj.ExtensionDictionary.GetValueByName("AcDbContextDataManager") as DxfDictionary;

            if (valueByName1 == null)
            {
                return((DxfAnnotationScaleObjectContextData)null);
            }
            DxfDictionary valueByName2 = valueByName1.GetValueByName("ACDB_ANNOTATIONSCALES") as DxfDictionary;

            if (valueByName2 == null)
            {
                return((DxfAnnotationScaleObjectContextData)null);
            }
            // ISSUE: reference to a compiler-generated method
            DxfAnnotationScaleObjectContextData objectContextData = valueByName2.Entries.Select <IDictionaryEntry, DxfAnnotationScaleObjectContextData>((Func <IDictionaryEntry, DxfAnnotationScaleObjectContextData>)(ctxDataEntry => (DxfAnnotationScaleObjectContextData)ctxDataEntry.Value)).FirstOrDefault <DxfAnnotationScaleObjectContextData>(new Func <DxfAnnotationScaleObjectContextData, bool>(class356.method_0));

            if (ignoreDefault && objectContextData != null && objectContextData.IsDefault)
            {
                return((DxfAnnotationScaleObjectContextData)null);
            }
            return(objectContextData);
        }
Exemplo n.º 6
0
 internal static DxfDictionary smethod_6(DxfHandledObject obj)
 {
     return(DxfAnnotationScaleObjectContextData.smethod_7(obj, true));
 }
Exemplo n.º 7
0
 internal static void smethod_2(DxfHandledObject o)
 {
     DxfAnnotationScaleObjectContextData.smethod_3(o, true, true);
 }