Example #1
0
        public DxfHandledObject CloneReference(DxfHandledObject sourceObject)
        {
            if (sourceObject == null)
            {
                return((DxfHandledObject)null);
            }
            ITableRecord tableRecord = sourceObject as ITableRecord;

            if (tableRecord != null)
            {
                if (this.dxfModel_0 == this.dxfModel_1)
                {
                    return(sourceObject);
                }
                tableRecord.Accept((ITableRecordVisitor)this.class756_0);
                return(this.class756_0.ClonedTableRecord);
            }
            DxfHandledObject dxfHandledObject = (DxfHandledObject)sourceObject.Clone(this);

            if (this.dxfModel_0 != this.dxfModel_1)
            {
                this.method_0(dxfHandledObject);
            }
            return(dxfHandledObject);
        }
Example #2
0
        internal FileDependency Add(
            string featureName,
            string filename,
            bool affectsGraphics,
            DxfHandledObject referencingObject)
        {
            FileDependency.Key key = new FileDependency.Key(featureName, filename);
            FileDependency     fileDependency;

            if (this.TryGetValue(key, out fileDependency))
            {
                if (!fileDependency.References.Contains(referencingObject))
                {
                    fileDependency.References.Add(referencingObject);
                }
            }
            else
            {
                fileDependency                 = new FileDependency();
                fileDependency.FeatureName     = featureName;
                fileDependency.FullFilename    = filename;
                fileDependency.AffectsGraphics = affectsGraphics;
                fileDependency.References.Add(referencingObject);
                this.Add(key, fileDependency);
            }
            return(fileDependency);
        }
Example #3
0
 public void AddPersistentReactor(DxfHandledObject reactor)
 {
     if (this.dxfHandledObjectCollection_0 == null)
     {
         this.dxfHandledObjectCollection_0 = new DxfHandledObjectCollection <DxfHandledObject>();
     }
     this.dxfHandledObjectCollection_0.Add(reactor);
 }
Example #4
0
 internal void method_0(DxfHandledObject obj)
 {
     if (this.hashSet_0.Contains(obj))
     {
         return;
     }
     this.hashSet_0.Add(obj);
     this.list_2.Add(obj);
 }
Example #5
0
        internal void Write(DxfXRecord xrecord)
        {
            xrecord.Values.Add((short)93, (object)this.int_0);
            xrecord.Values.Add((short)90, (object)(int)this.Format.DataType);
            switch (this.Format.DataType)
            {
            case ValueDataType.None:
                xrecord.Values.Add((short)91, (object)0);
                break;

            case ValueDataType.Int:
                xrecord.Values.Add((short)91, (object)Convert.ToInt32(this.Value));
                break;

            case ValueDataType.Double:
                xrecord.Values.Add((short)140, (object)Convert.ToDouble(this.Value));
                break;

            case ValueDataType.String:
                xrecord.Values.Add((short)1, (object)(string)this.Value);
                break;

            case ValueDataType.Date:
                xrecord.Values.Add((short)92, (object)16);
                byte[] numArray = DxfValue.smethod_2((DateTime)this.Value);
                xrecord.Values.Add((short)310, (object)numArray);
                break;

            case ValueDataType.Point2D:
            case ValueDataType.Point3D:
                WW.Math.Point3D point3D = (WW.Math.Point3D) this.Value;
                xrecord.Values.Add((short)11, (object)point3D);
                break;

            case ValueDataType.ObjectHandle:
                DxfHandledObject dxfHandledObject = (DxfHandledObject)this.Value;
                if (dxfHandledObject != null)
                {
                    xrecord.Values.Add((short)330, (object)dxfHandledObject);
                    break;
                }
                break;

            case ValueDataType.Buffer:
                throw new NotImplementedException("Not yet implemented: Export of value data type 'Buffer'!");

            case ValueDataType.ResultBuffer:
                throw new NotImplementedException("Not yet implemented: Export of value data type 'ResultBuffer'!");

            case ValueDataType.General:
                xrecord.Values.Add((short)1, this.Value == null ? (object)string.Empty : (object)(string)this.Value);
                break;
            }
            xrecord.Values.Add((short)94, (object)(int)this.Format.UnitType);
            xrecord.Values.Add((short)300, (object)this.Format._FormatString);
            xrecord.Values.Add((short)302, (object)this.GetValueString(this.Format));
        }
Example #6
0
 internal virtual void vmethod_0(Action action, Stack <DxfHandledObject> callerStack)
 {
     if (DxfHandledObject.smethod_0(callerStack, this))
     {
         return;
     }
     callerStack.Push(this);
     this.ExecuteDeepHelper(action, callerStack);
     callerStack.Pop();
 }
Example #7
0
            public void ResolveReferences(Class374 modelBuilder)
            {
                DxfHandledObject dxfHandledObject = modelBuilder.method_3(this.ulong_0);

                if (dxfHandledObject == null)
                {
                    return;
                }
                this.dxfTypedObjectReference_0.ObjectReference = dxfHandledObject.Reference;
            }
Example #8
0
 private static bool smethod_0(Stack <DxfHandledObject> callerStack, DxfHandledObject caller)
 {
     foreach (object caller1 in callerStack)
     {
         if (object.ReferenceEquals(caller1, (object)caller))
         {
             return(true);
         }
     }
     return(false);
 }
Example #9
0
        public virtual void CopyFrom(DxfHandledObject from, CloneContext cloneContext)
        {
            this.ExtensionDictionary         = from.ExtensionDictionary != null ? (DxfDictionary)from.ExtensionDictionary.Clone(cloneContext) : (DxfDictionary)null;
            this.dxfExtendedDataCollection_0 = from.dxfExtendedDataCollection_0 != null?from.dxfExtendedDataCollection_0.Clone(cloneContext) : (DxfExtendedDataCollection)null;

            if (!cloneContext.CloneExact)
            {
                return;
            }
            this.dxfObjectReference_0.Handle = from.Reference.Handle;
        }
Example #10
0
        public virtual IGraphCloneable Clone(CloneContext cloneContext)
        {
            DxfHandledObject dxfHandledObject = (DxfHandledObject)cloneContext.GetExistingClone((IGraphCloneable)this);

            if (dxfHandledObject == null)
            {
                dxfHandledObject = new DxfHandledObject();
                this.RegisterClone(cloneContext, (IGraphCloneable)dxfHandledObject);
                dxfHandledObject.CopyFrom(this, cloneContext);
            }
            return((IGraphCloneable)dxfHandledObject);
        }
Example #11
0
        internal void method_1(object value)
        {
            DxfHandledObject dxfHandledObject = value as DxfHandledObject;

            if (dxfHandledObject != null)
            {
                this.object_0 = (object)dxfHandledObject.Reference;
            }
            else
            {
                this.object_0 = value;
            }
        }
Example #12
0
 public void RemovePersistentReactor(DxfHandledObject reactor)
 {
     if (this.dxfHandledObjectCollection_0 == null)
     {
         return;
     }
     this.dxfHandledObjectCollection_0.Remove(reactor);
     if (this.dxfHandledObjectCollection_0.Count != 0)
     {
         return;
     }
     this.dxfHandledObjectCollection_0 = (DxfHandledObjectCollection <DxfHandledObject>)null;
 }
Example #13
0
        internal void Remove(string featureName, string filename, DxfHandledObject referencingObject)
        {
            FileDependency.Key key = new FileDependency.Key(featureName, filename);
            FileDependency     fileDependency;

            if (!this.TryGetValue(key, out fileDependency))
            {
                return;
            }
            if (fileDependency.References.Contains(referencingObject))
            {
                fileDependency.References.Remove(referencingObject);
            }
            if (fileDependency.References.Count > 0)
            {
                return;
            }
            this.Remove(key);
        }
Example #14
0
            public IExtendedDataValue Clone(CloneContext cloneContext)
            {
                DxfHandledObject dxfHandledObject = (DxfHandledObject)cloneContext.GetExistingClone((IGraphCloneable)this.Value);

                if (dxfHandledObject == null)
                {
                    ITableRecord tableRecord = this.Value as ITableRecord;
                    if (tableRecord == null)
                    {
                        dxfHandledObject = (DxfHandledObject)cloneContext.Clone((IGraphCloneable)this.Value);
                        cloneContext.method_0(dxfHandledObject);
                    }
                    else
                    {
                        dxfHandledObject = cloneContext.CloneTableRecord(tableRecord);
                    }
                }
                return((IExtendedDataValue) new DxfExtendedData.DatabaseHandle(dxfHandledObject));
            }
Example #15
0
        internal bool method_1(DxfHandledObject sourceObject, string fieldName, ref WW.Math.Point3D p)
        {
            bool   flag = false;
            string str  = (string)null;

            if (DxfModelRepairer.smethod_0(p.X))
            {
                p.X  = 0.0;
                flag = true;
                str  = "X";
            }
            if (DxfModelRepairer.smethod_0(p.Y))
            {
                p.Y  = 0.0;
                flag = true;
                str  = !string.IsNullOrEmpty(str) ? str + ", Y" : "Y";
            }
            if (DxfModelRepairer.smethod_0(p.Z))
            {
                p.Z  = 0.0;
                flag = true;
                str  = !string.IsNullOrEmpty(str) ? str + " and Z" : "Z";
            }
            if (flag)
            {
                this.ilist_0.Add(new DxfMessage(DxfStatus.InvalidPoint, Severity.Warning, "FieldName", (object)fieldName)
                {
                    Parameters =
                    {
                        {
                            "Object",
                            (object)sourceObject
                        },
                        {
                            "InvalidCoordinates",
                            (object)str
                        }
                    }
                });
            }
            return(flag);
        }
Example #16
0
        internal bool method_6(DxfReader r, Class259 objectBuilder)
        {
            DxfHandledObject handledObject = objectBuilder.HandledObject;

            switch (r.CurrentGroup.Code)
            {
            case 5:
                if (r.ModelBuilder.Version > DxfVersion.Dxf12)
                {
                    handledObject.method_0((string)r.CurrentGroup.Value);
                }
                else
                {
                    ulong result;
                    if (ulong.TryParse((string)r.CurrentGroup.Value, NumberStyles.HexNumber, (IFormatProvider)CultureInfo.InvariantCulture, out result))
                    {
                        handledObject.SetHandle(result);
                    }
                }
                r.method_89(objectBuilder);
                break;

            case 102:
                DxfHandledObject.smethod_1(r, objectBuilder);
                break;

            case 330:
                objectBuilder.OwnerHandle = (ulong)r.CurrentGroup.Value;
                break;

            case 1001:
                this.method_7(r, objectBuilder);
                return(true);

            default:
                return(false);
            }
            r.method_85();
            return(true);
        }
Example #17
0
        internal bool method_6(DxfHandledObject sourceObject, string fieldName, ref WW.Math.Vector3D normal)
        {
            bool   flag = false;
            string str  = (string)null;

            if (DxfModelRepairer.smethod_0(normal.X))
            {
                flag = true;
                str  = "X";
            }
            if (DxfModelRepairer.smethod_0(normal.Y))
            {
                flag = true;
                str  = !string.IsNullOrEmpty(str) ? str + ", Y" : "Y";
            }
            if (DxfModelRepairer.smethod_0(normal.Z))
            {
                flag = true;
                str  = !string.IsNullOrEmpty(str) ? str + " and Z" : "Z";
            }
            if (flag)
            {
                normal = WW.Math.Vector3D.ZAxis;
                this.ilist_0.Add(new DxfMessage(DxfStatus.InvalidNormal, Severity.Warning, "FieldName", (object)fieldName)
                {
                    Parameters =
                    {
                        {
                            "Object",
                            (object)sourceObject
                        },
                        {
                            "InvalidCoordinates",
                            (object)str
                        }
                    }
                });
            }
            return(flag);
        }
Example #18
0
        internal bool method_4(DxfHandledObject sourceObject, string fieldName, ref double scale)
        {
            bool flag = false;

            if (DxfModelRepairer.smethod_0(scale) || scale == 0.0)
            {
                scale = 1.0;
                flag  = true;
            }
            if (flag)
            {
                this.ilist_0.Add(new DxfMessage(DxfStatus.InvalidScale, Severity.Warning, "FieldName", (object)fieldName)
                {
                    Parameters =
                    {
                        {
                            "Object",
                            (object)sourceObject
                        }
                    }
                });
            }
            return(flag);
        }
Example #19
0
 public void Visit(DxfTextStyle value)
 {
     this.dxfHandledObject_0 = (DxfHandledObject)Class906.GetTextStyle(this.cloneContext_0, value);
 }
Example #20
0
 public LateComposer(DxfHandledObject obj)
 {
     this.dxfHandledObject_0 = obj;
 }
Example #21
0
 public DxfHandledObject(DxfHandledObject ownerObjectSoftReference)
     : this()
 {
     this.dxfObjectReference_1 = ownerObjectSoftReference == null ? DxfObjectReference.Null : ownerObjectSoftReference.Reference;
 }
Example #22
0
        internal void Write(DxfWriter w)
        {
            DxfModel model = w.Model;

            if (model.Header.Dxf19OrHigher)
            {
                w.Write(93, (object)this.int_0);
            }
            w.Write(90, (object)(int)this.Format.DataType);
            switch (this.Format.DataType)
            {
            case ValueDataType.None:
                if (!model.Header.Dxf19OrHigher)
                {
                    w.Write(91, (object)0);
                    break;
                }
                break;

            case ValueDataType.Int:
                w.Write(91, (object)Convert.ToInt32(this.object_0));
                break;

            case ValueDataType.Double:
                w.Write(140, (object)Convert.ToDouble(this.object_0));
                break;

            case ValueDataType.String:
                w.method_142(1, 2, (string)this.object_0, true);
                break;

            case ValueDataType.Date:
                w.Write(92, (object)16);
                DateTime object0_1 = (DateTime)this.object_0;
                byte[]   numArray  = DxfValue.smethod_0(w.Model.Header.AcadVersion, object0_1);
                w.Write(310, (object)numArray);
                break;

            case ValueDataType.Point2D:
            case ValueDataType.Point3D:
                WW.Math.Point3D object0_2 = (WW.Math.Point3D) this.object_0;
                w.Write(11, object0_2);
                break;

            case ValueDataType.ObjectHandle:
                DxfHandledObject dxfHandledObject = (DxfHandledObject)this.Value;
                if (dxfHandledObject != null)
                {
                    w.method_218(330, dxfHandledObject);
                    break;
                }
                break;

            case ValueDataType.Buffer:
                throw new NotImplementedException("Not yet implemented: Export of value data type 'Buffer'!");

            case ValueDataType.ResultBuffer:
                throw new NotImplementedException("Not yet implemented: Export of value data type 'ResultBuffer'!");

            case ValueDataType.General:
                w.method_142(1, 2, (string)this.object_0, true);
                break;
            }
            if (!model.Header.Dxf19OrHigher)
            {
                return;
            }
            w.Write(94, (object)(int)this.Format.UnitType);
            w.Write(300, (object)this.Format._FormatString);
            w.method_142(302, 303, this.GetValueString(this.Format), true);
            w.Write(304, (object)"ACVALUE_END");
        }
Example #23
0
 public void SetValue(DxfHandledObject value)
 {
     this.object_0 = (object)DxfObjectReference.GetReference((IDxfHandledObject)value);
     this.string_0 = (string)null;
 }
Example #24
0
 public void Visit(DxfBlock value)
 {
     this.dxfHandledObject_0 = (DxfHandledObject)Class906.smethod_0(this.cloneContext_0, value, false);
 }
Example #25
0
 internal void method_0(string handleString)
 {
     this.SetHandle(DxfHandledObject.Parse(handleString));
 }
Example #26
0
 public void Visit(DxfDimensionStyle value)
 {
     this.dxfHandledObject_0 = (DxfHandledObject)Class906.smethod_5(this.cloneContext_0, value);
 }
Example #27
0
 public void Visit(DxfVPort value)
 {
     this.dxfHandledObject_0 = (DxfHandledObject)Class906.smethod_7(this.cloneContext_0, value);
 }
Example #28
0
 public void Visit(DxfViewportEntityHeader value)
 {
     this.dxfHandledObject_0 = (DxfHandledObject)Class906.smethod_8(this.cloneContext_0, value);
 }
Example #29
0
 public void Visit(DxfLayer value)
 {
     this.dxfHandledObject_0 = (DxfHandledObject)Class906.GetLayer(this.cloneContext_0, value);
 }
Example #30
0
 public void Visit(DxfLineType value)
 {
     this.dxfHandledObject_0 = (DxfHandledObject)Class906.GetLineType(this.cloneContext_0, value);
 }