public DrawingManager2(EscherDggRecord dgg) { this.dgg = dgg; }
/** * Creates a primary drawing Group record. If it already * exists then it's modified. */ public void CreateDrawingGroup() { if (drawingManager == null) { EscherContainerRecord dggContainer = new EscherContainerRecord(); EscherDggRecord dgg = new EscherDggRecord(); EscherOptRecord opt = new EscherOptRecord(); EscherSplitMenuColorsRecord splitMenuColors = new EscherSplitMenuColorsRecord(); dggContainer.RecordId=unchecked((short)0xF000); dggContainer.Options=(short)0x000F; dgg.RecordId=EscherDggRecord.RECORD_ID; dgg.Options=(short)0x0000; dgg.ShapeIdMax=1024; dgg.NumShapesSaved=0; dgg.DrawingsSaved=0; dgg.FileIdClusters=new EscherDggRecord.FileIdCluster[] { }; drawingManager = new DrawingManager2(dgg); EscherContainerRecord bstoreContainer = null; if (escherBSERecords.Count > 0) { bstoreContainer = new EscherContainerRecord(); bstoreContainer.RecordId=EscherContainerRecord.BSTORE_CONTAINER; bstoreContainer.Options=(short)((escherBSERecords.Count << 4) | 0xF); for (IEnumerator iterator = escherBSERecords.GetEnumerator(); iterator.MoveNext(); ) { EscherRecord escherRecord = (EscherRecord)iterator.Current; bstoreContainer.AddChildRecord(escherRecord); } } opt.RecordId=unchecked((short)0xF00B); opt.Options=(short)0x0033; opt.AddEscherProperty(new EscherBoolProperty(EscherProperties.TEXT__SIZE_TEXT_TO_FIT_SHAPE, 524296)); opt.AddEscherProperty(new EscherRGBProperty(EscherProperties.Fill__FillCOLOR, 0x08000041)); opt.AddEscherProperty(new EscherRGBProperty(EscherProperties.LINESTYLE__COLOR, 134217792)); splitMenuColors.RecordId=unchecked((short)0xF11E); splitMenuColors.Options=(short)0x0040; splitMenuColors.Color1=0x0800000D; splitMenuColors.Color2=0x0800000C; splitMenuColors.Color3=0x08000017; splitMenuColors.Color4=0x100000F7; dggContainer.AddChildRecord(dgg); if (bstoreContainer != null) dggContainer.AddChildRecord(bstoreContainer); dggContainer.AddChildRecord(opt); dggContainer.AddChildRecord(splitMenuColors); int dgLoc = FindFirstRecordLocBySid(DrawingGroupRecord.sid); if (dgLoc == -1) { DrawingGroupRecord drawingGroup = new DrawingGroupRecord(); drawingGroup.AddEscherRecord(dggContainer); int loc = FindFirstRecordLocBySid(CountryRecord.sid); Records.Insert(loc + 1, drawingGroup); } else { DrawingGroupRecord drawingGroup = new DrawingGroupRecord(); drawingGroup.AddEscherRecord(dggContainer); Records[dgLoc]= drawingGroup; } } }