public void Write(Database db, Transaction t) { try { DBDictionary dBDictionary = base.ParentDataset.Open(db, t, this.DictionaryName, (OpenMode)1); dBDictionary.DisableUndoRecording(true); this.WriteImageDictionary(dBDictionary, t); } catch { } }
protected DBDictionary WriteImageDictionary(DBDictionary parentDict, Transaction t) { DBDictionary result; try { parentDict.UpgradeOpen(); DBDictionary dBDictionary = new DBDictionary(); this.AcadDictionaryID = parentDict.SetAt(base.Name, dBDictionary); dBDictionary.DisableUndoRecording(true); t.AddNewlyCreatedDBObject(dBDictionary, true); DocUtil.WriteXRecord(t, dBDictionary, "AutoCADID", (DxfCode)330, base.RasterObjectId); DocUtil.WriteXRecord(t, dBDictionary, "ServiceFullName", (DxfCode)1, this.ServiceFullName); DocUtil.WriteXRecord(t, dBDictionary, "ConnectionName", (DxfCode)1, base.ConnectionName); DocUtil.WriteXRecord(t, dBDictionary, "ConnectionURL", (DxfCode)1, base.ConnectionURL); DocUtil.WriteXRecord(t, dBDictionary, "UserName", (DxfCode)1, base.UserName); if (base.Dynamic) { Xrecord xrecord = new Xrecord(); xrecord.Data = (new ResultBuffer(new TypedValue[] { new TypedValue(290, true) })); dBDictionary.SetAt("Dynamic", xrecord); xrecord.DisableUndoRecording(true); t.AddNewlyCreatedDBObject(xrecord, true); } DocUtil.WriteBoundingBox(t, dBDictionary, base.BoundaryExtent); DocUtil.WriteXRecord(t, dBDictionary, "ImageFormat", (DxfCode)1, base.ExportOptions.Format); DocUtil.WriteXRecord(t, dBDictionary, "Compression", (DxfCode)1, base.ExportOptions.TransCompression); DocUtil.WriteXRecord(t, dBDictionary, "Quality", (DxfCode)90, base.ExportOptions.Quality); DocUtil.WriteXRecord(t, dBDictionary, "Interpolation", (DxfCode)1, base.ExportOptions.Interpolation); DocUtil.WriteXRecord(t, dBDictionary, "MosaicMethod", (DxfCode)1, base.ExportOptions.MosaicMethod); DocUtil.WriteXRecord(t, dBDictionary, "OrderField", (DxfCode)1, base.ExportOptions.OrderField); DocUtil.WriteXRecord(t, dBDictionary, "OrderBaseValue", (DxfCode)1, base.ExportOptions.OrderBaseValue); DocUtil.WriteXRecord(t, dBDictionary, "LockRasterID", (DxfCode)1, base.ExportOptions.LockRasterID); DocUtil.WriteXRecord(t, dBDictionary, "Ascending", (DxfCode)290, base.ExportOptions.Ascending); DocUtil.WriteXRecord(t, dBDictionary, "MosaicOperator", (DxfCode)1, base.ExportOptions.MosaicOperator); result = dBDictionary; } catch (Exception ex) { string arg_209_0 = ex.Message; result = null; } return(result); }
public DBDictionary WriteMapLayer(DBDictionary parentDict, Transaction t) { DBDictionary dBDictionary = new DBDictionary(); try { parentDict.SetAt(this.FixName(this.Name), dBDictionary); dBDictionary.DisableUndoRecording(true); t.AddNewlyCreatedDBObject(dBDictionary, true); DocUtil.WriteXRecord(t, dBDictionary, "MapLayerName", (DxfCode)1, this.Name); DocUtil.WriteXRecord(t, dBDictionary, "ID", (DxfCode)90, this.ID); DocUtil.WriteXRecord(t, dBDictionary, "ParentID", (DxfCode)90, this.ParentLayerID); if (this.Visible) { Xrecord xrecord = new Xrecord(); xrecord.Data = (new ResultBuffer(new TypedValue[] { new TypedValue(290, true) })); dBDictionary.SetAt("Visible", xrecord); xrecord.DisableUndoRecording(true); t.AddNewlyCreatedDBObject(xrecord, true); } } catch { } try { if (this.Layers != null && this.Layers.Count > 0) { DBDictionary dBDictionary2 = new DBDictionary(); dBDictionary.SetAt("ChildLayers", dBDictionary2); t.AddNewlyCreatedDBObject(dBDictionary2, true); foreach (MSCMapLayer current in this.Layers) { current.WriteMapLayer(dBDictionary2, t); } } } catch { } return(dBDictionary); }
public void Write(Database db, Transaction t) { try { DBDictionary dBDictionary = this.ParentDataset.Open(db, t, FieldDomain.DictionaryName, (OpenMode)1); DBDictionary dBDictionary2 = new DBDictionary(); this.Id = dBDictionary.SetAt(this.Name, dBDictionary2); dBDictionary2.DisableUndoRecording(true); t.AddNewlyCreatedDBObject(dBDictionary2, true); this.WriteTypedValue(db, t, dBDictionary2, "KeyName", new TypedValue(1, this.Name)); this.WriteTypedValue(db, t, dBDictionary2, "DisplayName", new TypedValue(1, this.DisplayName)); this.WriteTypedValue(db, t, dBDictionary2, "DomainType", new TypedValue(1, this.DomainType)); this.WriteTypedValue(db, t, dBDictionary2, "DomainFieldType", new TypedValue(90, this.FieldType)); if (this.DomainType == "RangeDomain") { this.WriteTypedValue(db, t, dBDictionary2, "DomainMinimum", CadField.CreateTypedValue(this.MinValue)); this.WriteTypedValue(db, t, dBDictionary2, "DomainMaximum", CadField.CreateTypedValue(this.MaxValue)); } if (this.DomainType == "CodedValueDomain") { List <TypedValue> list = new List <TypedValue>(); foreach (KeyValuePair <string, MSCCodedValue> keyValuePair in this.CodedValues) { MSCCodedValue value = keyValuePair.Value; list.Add(CadField.CreateTypedValue(value.DisplayName)); list.Add(CadField.CreateTypedValue(value.Value)); } try { ResultBuffer rb = new ResultBuffer(list.ToArray()); this.WriteResultBuffer(db, t, dBDictionary2, "CodedValues", rb); } catch (System.Exception) { } } } catch { } }
public void Write(Database db, Transaction t) { try { DBDictionary parentDict = base.ParentDataset.Open(db, t, this.DictionaryName, (OpenMode)1); DBDictionary dBDictionary = this.WriteMapDictionary(parentDict, t); if (dBDictionary != null && this.Layers.Count > 0) { DBDictionary dBDictionary2 = new DBDictionary(); dBDictionary.SetAt("ESRI_Layers", dBDictionary2); dBDictionary2.DisableUndoRecording(true); t.AddNewlyCreatedDBObject(dBDictionary2, true); foreach (MSCMapLayer current in this.Layers) { current.WriteMapLayer(dBDictionary2, t); } } } catch { } }
protected DBDictionary WriteMapDictionary(DBDictionary parentDict, Transaction t) { DBDictionary result; try { parentDict.UpgradeOpen(); DBDictionary dBDictionary = new DBDictionary(); this.AcadDictionaryID = parentDict.SetAt(base.Name, dBDictionary); dBDictionary.DisableUndoRecording(true); t.AddNewlyCreatedDBObject(dBDictionary, true); DocUtil.WriteXRecord(t, dBDictionary, "AutoCADID", (DxfCode)330, base.RasterObjectId); DocUtil.WriteXRecord(t, dBDictionary, "ServiceFullName", (DxfCode)1, this.ServiceFullName); DocUtil.WriteXRecord(t, dBDictionary, "ConnectionName", (DxfCode)1, base.ConnectionName); DocUtil.WriteXRecord(t, dBDictionary, "ConnectionURL", (DxfCode)1, base.ConnectionURL); DocUtil.WriteXRecord(t, dBDictionary, "UserName", (DxfCode)1, base.UserName); if (base.Dynamic) { Xrecord xrecord = new Xrecord(); xrecord.Data = (new ResultBuffer(new TypedValue[] { new TypedValue(290, true) })); dBDictionary.SetAt("Dynamic", xrecord); xrecord.DisableUndoRecording(true); t.AddNewlyCreatedDBObject(xrecord, true); } DocUtil.WriteBoundingBox(t, dBDictionary, base.BoundaryExtent); DocUtil.WriteXRecord(t, dBDictionary, "ImageFormat", (DxfCode)1, base.ExportOptions.Format); result = dBDictionary; } catch (Exception ex) { string arg_122_0 = ex.Message; result = null; } return(result); }