示例#1
0
 private int method_7(IExtendedDataValue value)
 {
     DxfExtendedData.Int32 int32 = value as DxfExtendedData.Int32;
     if (int32 == null)
     {
         throw new Exception("Invalid format of OLE xData.");
     }
     return(int32.Value);
 }
示例#2
0
        internal override void vmethod_10(DxfModel model)
        {
            base.vmethod_10(model);
            DxfExtendedData extendedData;

            if (!this.HasExtendedData || !this.ExtendedDataCollection.TryGetValue(this.Model.AppIdAcad, out extendedData))
            {
                return;
            }
            TrueTypeFontDescriptor typeFontDescriptor = new TrueTypeFontDescriptor();
            bool flag = false;

            foreach (IExtendedDataValue extendedDataValue in (List <IExtendedDataValue>)extendedData.Values)
            {
                DxfExtendedData.String @string = extendedDataValue as DxfExtendedData.String;
                if (@string != null)
                {
                    typeFontDescriptor.FontFilename = @string.Value;
                    if (!string.IsNullOrEmpty(typeFontDescriptor.FontFilename))
                    {
                        flag = true;
                    }
                }
                else
                {
                    DxfExtendedData.Int32 int32 = extendedDataValue as DxfExtendedData.Int32;
                    if (int32 != null)
                    {
                        typeFontDescriptor.Flags = (TrueTypeFontFlags)int32.Value;
                        if (typeFontDescriptor.Flags != TrueTypeFontFlags.None)
                        {
                            flag = true;
                        }
                    }
                }
            }
            if (!flag)
            {
                return;
            }
            this.trueTypeFontDescriptor_0 = typeFontDescriptor;
        }
示例#3
0
        private void method_10(DxfExtendedData extendedData)
        {
            IEnumerator <IExtendedDataValue> enumerator = (IEnumerator <IExtendedDataValue>) new DxfExtendedData.RecursiveEnumerator((IEnumerator <IExtendedDataValue>)extendedData.Values.GetEnumerator());

            DxfExtendedData.Int32 int32 = (DxfExtendedData.Int32)null;
            while (enumerator.MoveNext())
            {
                int32 = enumerator.Current as DxfExtendedData.Int32;
                if (int32 != null)
                {
                    break;
                }
            }
            if (int32 == null)
            {
                int32 = new DxfExtendedData.Int32();
                extendedData.Values.Add((IExtendedDataValue)int32);
            }
            int32.Value = (int)this.transparency_0.Data;
        }
示例#4
0
        internal override void vmethod_10(DxfModel model)
        {
            base.vmethod_10(model);
            DxfExtendedData extendedData;

            if (this.HasExtendedData && this.ExtendedDataCollection.TryGetValue(this.Model, "AcCmTransparency", out extendedData))
            {
                IEnumerator <IExtendedDataValue> enumerator = (IEnumerator <IExtendedDataValue>) new DxfExtendedData.RecursiveEnumerator((IEnumerator <IExtendedDataValue>)extendedData.Values.GetEnumerator());
                while (enumerator.MoveNext())
                {
                    DxfExtendedData.Int32 current = enumerator.Current as DxfExtendedData.Int32;
                    if (current != null)
                    {
                        this.transparency_0 = new Transparency((uint)current.Value);
                        if (this.transparency_0.TransparencyType != TransparencyType.ByValue)
                        {
                            this.transparency_0 = Transparency.Opaque;
                            break;
                        }
                        break;
                    }
                }
            }
            if (this.ExtensionDictionary == null)
            {
                return;
            }
            DxfXRecord valueByName1 = this.ExtensionDictionary.GetValueByName("ADSK_XREC_LAYER_COLOR_OVR") as DxfXRecord;

            if (valueByName1 != null)
            {
                List <DxfXRecordValue> .Enumerator enumerator = valueByName1.Values.GetEnumerator();
                while (enumerator.MoveNext())
                {
                    if (enumerator.Current.Code == (short)102 && enumerator.Current.Value as string == "{ADSK_LYR_COLOR_OVERRIDE")
                    {
                        DxfViewport key      = (DxfViewport)null;
                        uint?       nullable = new uint?();
                        while (enumerator.MoveNext() && (enumerator.Current.Code != (short)102 || !(enumerator.Current.Value as string == "}")))
                        {
                            switch (enumerator.Current.Code)
                            {
                            case 335:
                                key = enumerator.Current.Value as DxfViewport;
                                continue;

                            case 420:
                                nullable = new uint?((uint)Convert.ToInt32(enumerator.Current.Value));
                                continue;

                            default:
                                continue;
                            }
                        }
                        if (key != null && nullable.HasValue)
                        {
                            this.ViewportLayerOverridesNotNull.ViewportColorOverridesNotNull.Add(key, Color.smethod_0(nullable.Value));
                        }
                    }
                }
            }
            DxfXRecord valueByName2 = this.ExtensionDictionary.GetValueByName("ADSK_XREC_LAYER_LINETYPE_OVR") as DxfXRecord;

            if (valueByName2 != null)
            {
                List <DxfXRecordValue> .Enumerator enumerator = valueByName2.Values.GetEnumerator();
                while (enumerator.MoveNext())
                {
                    if (enumerator.Current.Code == (short)102 && enumerator.Current.Value as string == "{ADSK_LYR_LINETYPE_OVERRIDE")
                    {
                        DxfViewport key         = (DxfViewport)null;
                        DxfLineType dxfLineType = (DxfLineType)null;
                        while (enumerator.MoveNext() && (enumerator.Current.Code != (short)102 || !(enumerator.Current.Value as string == "}")))
                        {
                            switch (enumerator.Current.Code)
                            {
                            case 335:
                                key = enumerator.Current.Value as DxfViewport;
                                continue;

                            case 343:
                                dxfLineType = enumerator.Current.Value as DxfLineType;
                                continue;

                            default:
                                continue;
                            }
                        }
                        if (key != null && dxfLineType != null)
                        {
                            this.ViewportLayerOverridesNotNull.ViewportLineTypeOverridesNotNull.Add(key, dxfLineType);
                        }
                    }
                }
            }
            DxfXRecord valueByName3 = this.ExtensionDictionary.GetValueByName("ADSK_XREC_LAYER_LINEWT_OVR") as DxfXRecord;

            if (valueByName3 != null)
            {
                List <DxfXRecordValue> .Enumerator enumerator = valueByName3.Values.GetEnumerator();
                while (enumerator.MoveNext())
                {
                    if (enumerator.Current.Code == (short)102 && enumerator.Current.Value as string == "{ADSK_LYR_LINEWT_OVERRIDE")
                    {
                        DxfViewport key      = (DxfViewport)null;
                        short?      nullable = new short?();
                        while (enumerator.MoveNext() && (enumerator.Current.Code != (short)102 || !(enumerator.Current.Value as string == "}")))
                        {
                            switch (enumerator.Current.Code)
                            {
                            case 91:
                                nullable = new short?(Convert.ToInt16(enumerator.Current.Value));
                                continue;

                            case 335:
                                key = enumerator.Current.Value as DxfViewport;
                                continue;

                            default:
                                continue;
                            }
                        }
                        if (key != null && nullable.HasValue)
                        {
                            this.ViewportLayerOverridesNotNull.ViewportLineWeightOverridesNotNull.Add(key, nullable.Value);
                        }
                    }
                }
            }
            DxfXRecord valueByName4 = this.ExtensionDictionary.GetValueByName("ADSK_XREC_LAYER_ALPHA_OVR") as DxfXRecord;

            if (valueByName4 == null)
            {
                return;
            }
            List <DxfXRecordValue> .Enumerator enumerator1 = valueByName4.Values.GetEnumerator();
            while (enumerator1.MoveNext())
            {
                if (enumerator1.Current.Code == (short)102 && enumerator1.Current.Value as string == "{ADSK_LYR_ALPHA_OVERRIDE")
                {
                    DxfViewport key      = (DxfViewport)null;
                    uint?       nullable = new uint?();
                    while (enumerator1.MoveNext() && (enumerator1.Current.Code != (short)102 || !(enumerator1.Current.Value as string == "}")))
                    {
                        switch (enumerator1.Current.Code)
                        {
                        case 335:
                            key = enumerator1.Current.Value as DxfViewport;
                            continue;

                        case 440:
                            nullable = new uint?((uint)Convert.ToInt32(enumerator1.Current.Value));
                            continue;

                        default:
                            continue;
                        }
                    }
                    if (key != null && nullable.HasValue)
                    {
                        this.ViewportLayerOverridesNotNull.ViewportTransparencyOverridesNotNull.Add(key, new Transparency(nullable.Value));
                    }
                }
            }
        }