Ejemplo n.º 1
0
        internal static DxfAppId FromBuffer(DxfCodePairBufferReader buffer)
        {
            var item = new DxfAppId();
            while (buffer.ItemsRemain)
            {
                var pair = buffer.Peek();
                if (pair.Code == 0)
                {
                    break;
                }

                buffer.Advance();
                switch (pair.Code)
                {
                    case 70:
                        item.StandardFlags = (int)pair.ShortValue;
                        break;
                    case DxfCodePairGroup.GroupCodeNumber:
                        var groupName = DxfCodePairGroup.GetGroupName(pair.StringValue);
                        item.ExtensionDataGroups.Add(DxfCodePairGroup.FromBuffer(buffer, groupName));
                        break;
                    case (int)DxfXDataType.ApplicationName:
                        item.XData = DxfXData.FromBuffer(buffer, pair.StringValue);
                        break;
                    default:
                        item.TrySetPair(pair);
                        break;
                }
            }

            return item;
        }
Ejemplo n.º 2
0
        internal static DxfAppId smethod_3(DxfModel model)
        {
            DxfAppId dxfAppId;

            if (!model.AppIds.TryGetValue("AcadAnnotative", out dxfAppId))
            {
                dxfAppId = new DxfAppId("AcadAnnotative");
                model.AppIds.Add(dxfAppId);
            }
            return(dxfAppId);
        }
Ejemplo n.º 3
0
        public void ResolveReferences(Class374 modelBuilder)
        {
            if (this.dxfExtendedData_0 == null || this.ulong_0 == 0UL)
            {
                return;
            }
            DxfHandledObject dxfHandledObject = modelBuilder.method_3(this.ulong_0);

            if (dxfHandledObject == null)
            {
                DxfMessage dxfMessage = new DxfMessage(DxfStatus.UnresolvedReference, Severity.Warning, "AppIdHandle", (object)this.ulong_0);
                modelBuilder.Messages.Add(dxfMessage);
            }
            else
            {
                DxfAppId dxfAppId = dxfHandledObject as DxfAppId;
                if (dxfAppId == null)
                {
                    modelBuilder.Messages.Add(new DxfMessage(DxfStatus.WrongType, Severity.Warning, "ExpectedType", (object)typeof(DxfAppId))
                    {
                        Parameters =
                        {
                            {
                                "ObjectType",
                                (object)dxfHandledObject.GetType()
                            },
                            {
                                "Object",
                                (object)dxfHandledObject
                            }
                        }
                    });
                }
                else
                {
                    this.dxfExtendedData_0.AppId = dxfAppId;
                }
                if (this.list_0 != null)
                {
                    foreach (Interface10 nterface10 in this.list_0)
                    {
                        nterface10.ResolveReferences(modelBuilder);
                    }
                }
            }
            if (this.class259_0 == null || this.class259_0.HandledObject == null)
            {
                return;
            }
            this.class259_0.HandledObject.ExtendedDataCollection.Add(this.dxfExtendedData_0);
        }
Ejemplo n.º 4
0
        internal static DxfAppId smethod_3(CloneContext cloneContext, DxfAppId from)
        {
            if (from == null)
            {
                return((DxfAppId)null);
            }
            if (from.Name == null)
            {
                throw new Exception("Table record name is null.");
            }
            if (cloneContext.SourceModel == cloneContext.TargetModel)
            {
                return(from);
            }
            DxfAppId dxfAppId1 = (DxfAppId)cloneContext.GetExistingClone((IGraphCloneable)from);

            if (dxfAppId1 == null)
            {
                cloneContext.TargetModel.AppIds.TryGetValue(from.Name, out dxfAppId1);
            }
            if (dxfAppId1 == null)
            {
                switch (cloneContext.ReferenceResolutionType)
                {
                case ReferenceResolutionType.CloneMissing:
                    DxfAppId dxfAppId2 = (DxfAppId)from.Clone(cloneContext);
                    if (!cloneContext.CloneExact)
                    {
                        cloneContext.TargetModel.AppIds.Add(dxfAppId2);
                    }
                    dxfAppId1 = dxfAppId2;
                    break;

                case ReferenceResolutionType.FailOnMissing:
                    throw new DxfException(string.Format("Could not resolve reference to APPID with name {0}", (object)from.Name));
                }
            }
            return(dxfAppId1);
        }
        internal static DxfTable ReadFromBuffer(DxfCodePairBufferReader buffer)
        {
            var table = new DxfAppIdTable();

            table.Items.Clear();
            while (buffer.ItemsRemain)
            {
                var pair = buffer.Peek();
                buffer.Advance();
                if (DxfTablesSection.IsTableEnd(pair))
                {
                    break;
                }

                if (pair.Code == 0 && pair.StringValue == DxfTable.AppIdText)
                {
                    var item = DxfAppId.FromBuffer(buffer);
                    table.Items.Add(item);
                }
            }

            return(table);
        }
Ejemplo n.º 6
0
 public void Visit(DxfAppId value)
 {
     this.dxfHandledObject_0 = (DxfHandledObject)Class906.smethod_3(this.cloneContext_0, value);
 }
Ejemplo n.º 7
0
 internal DxfExtendedData(DxfAppId appId, DxfExtendedData.ValueCollection values)
 {
     this.AppId  = appId;
     this.values = values;
 }
Ejemplo n.º 8
0
 public DxfExtendedData(DxfAppId appId)
     : this(appId, new DxfExtendedData.ValueCollection())
 {
 }