예제 #1
0
 public IExtendedDataValue Clone(CloneContext cloneContext)
 {
     DxfExtendedData.ValueCollection valueCollection = new DxfExtendedData.ValueCollection();
     foreach (IExtendedDataValue extendedDataValue in (List <IExtendedDataValue>) this)
     {
         valueCollection.Add(extendedDataValue.Clone(cloneContext));
     }
     return((IExtendedDataValue)valueCollection);
 }
예제 #2
0
 internal void method_0(DxfExtendedData.ValueCollection debracketized, ref int i)
 {
     while (i < this.Count)
     {
         IExtendedDataValue      extendedDataValue = this[i];
         DxfExtendedData.Bracket bracket           = extendedDataValue as DxfExtendedData.Bracket;
         if (bracket == null)
         {
             debracketized.Add(extendedDataValue);
         }
         else
         {
             if (bracket.IsClosingBracket)
             {
                 break;
             }
             DxfExtendedData.ValueCollection debracketized1 = new DxfExtendedData.ValueCollection();
             ++i;
             this.method_0(debracketized1, ref i);
             debracketized.Add((IExtendedDataValue)debracketized1);
         }
         ++i;
     }
 }
예제 #3
0
            internal static DxfExtendedData.ValueCollection Read(
                Class259 objectBuilder,
                DxfReader r)
            {
                DxfExtendedData.ValueCollection valueCollection1 = new DxfExtendedData.ValueCollection();
                r.method_85();
                bool flag1 = false;
                bool flag2 = true;
                int  num1  = -1;
                bool flag3 = false;

                while (!flag1)
                {
                    Struct18 currentGroup = r.CurrentGroup;
                    switch (currentGroup.Code)
                    {
                    case 1000:
                        valueCollection1.Add((IExtendedDataValue) new DxfExtendedData.String((string)r.CurrentGroup.Value));
                        r.method_85();
                        continue;

                    case 1002:
                        if ((string)r.CurrentGroup.Value == "{")
                        {
                            if (flag2)
                            {
                                flag3 = true;
                                ++num1;
                            }
                            valueCollection1.Add((IExtendedDataValue) new DxfExtendedData.Bracket(false));
                        }
                        else
                        {
                            if (!((string)r.CurrentGroup.Value == "}"))
                            {
                                throw new DxfException("Expected '{' or '}', found " + r.CurrentGroup.Value.ToString() + " instead.");
                            }
                            if (flag2)
                            {
                                if (num1 < 0)
                                {
                                    flag2 = false;
                                }
                                --num1;
                            }
                            valueCollection1.Add((IExtendedDataValue) new DxfExtendedData.Bracket(true));
                        }
                        r.method_85();
                        continue;

                    case 1003:
                        valueCollection1.Add((IExtendedDataValue) new DxfExtendedData.LayerReference(r.Model.GetLayerWithName((string)r.CurrentGroup.Value)));
                        r.method_85();
                        continue;

                    case 1004:
                        List <byte> byteList = new List <byte>();
                        byteList.AddRange((IEnumerable <byte>)(byte[]) r.CurrentGroup.Value);
                        r.method_85();
                        while (r.CurrentGroup.Code == 1004)
                        {
                            byteList.AddRange((IEnumerable <byte>)(byte[]) r.CurrentGroup.Value);
                            r.method_85();
                        }
                        valueCollection1.Add((IExtendedDataValue) new DxfExtendedData.BinaryData(byteList.ToArray()));
                        continue;

                    case 1005:
                        ulong num2 = (ulong)r.CurrentGroup.Value;
                        DxfExtendedData.DatabaseHandle xdataDatabaseHandle = new DxfExtendedData.DatabaseHandle();
                        valueCollection1.Add((IExtendedDataValue)xdataDatabaseHandle);
                        objectBuilder.ChildBuilders.Add((Interface10) new Class618(xdataDatabaseHandle)
                        {
                            DatabaseHandle = num2
                        });
                        r.method_85();
                        continue;

                    case 1010:
                        double x1 = (double)r.CurrentGroup.Value;
                        r.method_85();
                        double y1 = (double)r.CurrentGroup.Value;
                        r.method_85();
                        double z1 = (double)r.CurrentGroup.Value;
                        valueCollection1.Add((IExtendedDataValue) new DxfExtendedData.PointOrVector(x1, y1, z1));
                        r.method_85();
                        continue;

                    case 1011:
                        double x2 = (double)r.CurrentGroup.Value;
                        r.method_85();
                        double y2 = (double)r.CurrentGroup.Value;
                        r.method_85();
                        double z2 = (double)r.CurrentGroup.Value;
                        valueCollection1.Add((IExtendedDataValue) new DxfExtendedData.WorldSpacePosition(x2, y2, z2));
                        r.method_85();
                        continue;

                    case 1012:
                        double x3 = (double)r.CurrentGroup.Value;
                        r.method_85();
                        double y3 = (double)r.CurrentGroup.Value;
                        r.method_85();
                        double z3 = (double)r.CurrentGroup.Value;
                        valueCollection1.Add((IExtendedDataValue) new DxfExtendedData.WorldSpaceDisplacement(x3, y3, z3));
                        r.method_85();
                        continue;

                    case 1013:
                        currentGroup = r.CurrentGroup;
                        double x4 = (double)currentGroup.Value;
                        r.method_85();
                        currentGroup = r.CurrentGroup;
                        double y4 = (double)currentGroup.Value;
                        r.method_85();
                        currentGroup = r.CurrentGroup;
                        double z4 = (double)currentGroup.Value;
                        valueCollection1.Add((IExtendedDataValue) new DxfExtendedData.WorldDirection(x4, y4, z4));
                        r.method_85();
                        continue;

                    case 1020:
                        double x5 = 0.0;
                        double y5 = (double)r.CurrentGroup.Value;
                        r.method_85();
                        double z5 = (double)r.CurrentGroup.Value;
                        valueCollection1.Add((IExtendedDataValue) new DxfExtendedData.PointOrVector(x5, y5, z5));
                        r.method_85();
                        continue;

                    case 1021:
                        double x6 = 0.0;
                        double y6 = (double)r.CurrentGroup.Value;
                        r.method_85();
                        double z6 = (double)r.CurrentGroup.Value;
                        valueCollection1.Add((IExtendedDataValue) new DxfExtendedData.WorldSpacePosition(x6, y6, z6));
                        r.method_85();
                        continue;

                    case 1022:
                        double x7 = 0.0;
                        double y7 = (double)r.CurrentGroup.Value;
                        r.method_85();
                        double z7 = (double)r.CurrentGroup.Value;
                        valueCollection1.Add((IExtendedDataValue) new DxfExtendedData.WorldSpaceDisplacement(x7, y7, z7));
                        r.method_85();
                        continue;

                    case 1023:
                        double x8 = 0.0;
                        currentGroup = r.CurrentGroup;
                        double y8 = (double)currentGroup.Value;
                        r.method_85();
                        currentGroup = r.CurrentGroup;
                        double z8 = (double)currentGroup.Value;
                        valueCollection1.Add((IExtendedDataValue) new DxfExtendedData.WorldDirection(x8, y8, z8));
                        r.method_85();
                        continue;

                    case 1040:
                        DxfExtendedData.ValueCollection valueCollection2 = valueCollection1;
                        currentGroup = r.CurrentGroup;
                        DxfExtendedData.Double @double = new DxfExtendedData.Double((double)currentGroup.Value);
                        valueCollection2.Add((IExtendedDataValue)@double);
                        r.method_85();
                        continue;

                    case 1041:
                        DxfExtendedData.ValueCollection valueCollection3 = valueCollection1;
                        currentGroup = r.CurrentGroup;
                        DxfExtendedData.Distance distance = new DxfExtendedData.Distance((double)currentGroup.Value);
                        valueCollection3.Add((IExtendedDataValue)distance);
                        r.method_85();
                        continue;

                    case 1042:
                        DxfExtendedData.ValueCollection valueCollection4 = valueCollection1;
                        currentGroup = r.CurrentGroup;
                        DxfExtendedData.ScaleFactor scaleFactor = new DxfExtendedData.ScaleFactor((double)currentGroup.Value);
                        valueCollection4.Add((IExtendedDataValue)scaleFactor);
                        r.method_85();
                        continue;

                    case 1070:
                        DxfExtendedData.ValueCollection valueCollection5 = valueCollection1;
                        currentGroup = r.CurrentGroup;
                        DxfExtendedData.Int16 int16 = new DxfExtendedData.Int16((short)currentGroup.Value);
                        valueCollection5.Add((IExtendedDataValue)int16);
                        r.method_85();
                        continue;

                    case 1071:
                        DxfExtendedData.ValueCollection valueCollection6 = valueCollection1;
                        currentGroup = r.CurrentGroup;
                        DxfExtendedData.Int32 int32 = new DxfExtendedData.Int32((int)currentGroup.Value);
                        valueCollection6.Add((IExtendedDataValue)int32);
                        r.method_85();
                        continue;

                    default:
                        flag1 = true;
                        continue;
                    }
                }
                if (flag3 && num1 == -1)
                {
                    DxfExtendedData.ValueCollection debracketized = new DxfExtendedData.ValueCollection();
                    int i = 0;
                    valueCollection1.method_0(debracketized, ref i);
                    valueCollection1 = debracketized;
                }
                return(valueCollection1);
            }