private MetadataObject GetMetadata(object ptr) { if (ptr == null) { return(null); } MetadataObject meta; switch (this.MetadataType) { case MetadataType.DocumentCollection: meta = new DocumentMetadata(this.Session, ptr); break; case MetadataType.CatalogCollection: meta = new MetadataObject(this.Session, MetadataType.Catalog, ptr); break; case MetadataType.InformationRegisterCollection: meta = new InformationRegisterMetadata(this.Session, ptr); break; case MetadataType.AccumulationRegisterCollection: meta = new AccumulationRegisterMetadata(this.Session, ptr); break; case MetadataType.AccountingRegisterCollection: meta = new AccountingRegisterMetadata(this.Session, ptr); break; case MetadataType.CalculationRegisterCollection: meta = new CalculationRegisterMetadata(this.Session, ptr); break; case MetadataType.EnumCollection: meta = new EnumMetadata(this.Session, ptr); break; case MetadataType.DocumentJournalCollection: meta = new MetadataObject(this.Session, MetadataType.DocumentJournal, ptr); break; case MetadataType.ConstantCollection: meta = new MetadataObject(this.Session, MetadataType.Constant, ptr); break; case MetadataType.TablePartCollection: meta = new MetadataObject(this.Session, MetadataType.TablePart, ptr); break; case MetadataType.RequisiteCollection: meta = new MetadataObject(this.Session, MetadataType.Requisite, ptr); break; case MetadataType.MeasureCollection: meta = new MetadataObject(this.Session, MetadataType.Measure, ptr); break; case MetadataType.ResourceCollection: meta = new MetadataObject(this.Session, MetadataType.Resource, ptr); break; default: meta = new MetadataObject(this.Session, MetadataType.Unknown, ptr); break; } if (meta != null) { PutToIndexerCache(meta.Name, meta); } return(meta); }