internal static DxfObject FromBuffer(DxfCodePairBufferReader buffer) { var first = buffer.Peek(); buffer.Advance(); DxfObject obj; switch (first.StringValue) { case "ACAD_PROXY_OBJECT": obj = new DxfAcadProxyObject(); break; case "ACDBDICTIONARYWDFLT": obj = new DxfDictionaryWithDefault(); break; case "ACDBPLACEHOLDER": obj = new DxfPlaceHolder(); break; case "DATATABLE": obj = new DxfDataTable(); break; case "DICTIONARY": obj = new DxfDictionary(); break; case "DICTIONARYVAR": obj = new DxfDictionaryVariable(); break; case "DIMASSOC": obj = new DxfDimensionAssociativity(); break; case "FIELD": obj = new DxfField(); break; case "GEODATA": obj = new DxfGeoData(); break; case "GROUP": obj = new DxfGroup(); break; case "IDBUFFER": obj = new DxfIdBuffer(); break; case "IMAGEDEF": obj = new DxfImageDefinition(); break; case "IMAGEDEF_REACTOR": obj = new DxfImageDefinitionReactor(); break; case "LAYER_FILTER": obj = new DxfLayerFilter(); break; case "LAYER_INDEX": obj = new DxfLayerIndex(); break; case "LAYOUT": obj = new DxfLayout(); break; case "LIGHTLIST": obj = new DxfLightList(); break; case "MATERIAL": obj = new DxfMaterial(); break; case "MLEADERSTYLE": obj = new DxfMLeaderStyle(); break; case "MLINESTYLE": obj = new DxfMLineStyle(); break; case "OBJECT_PTR": obj = new DxfObjectPointer(); break; case "PLOTSETTINGS": obj = new DxfPlotSettings(); break; case "RASTERVARIABLES": obj = new DxfRasterVariables(); break; case "MENTALRAYRENDERSETTINGS": obj = new DxfMentalRayRenderSettings(); break; case "RENDERENVIRONMENT": obj = new DxfRenderEnvironment(); break; case "RENDERGLOBAL": obj = new DxfRenderGlobal(); break; case "SECTIONMANAGER": obj = new DxfSectionManager(); break; case "SECTIONSETTINGS": obj = new DxfSectionSettings(); break; case "SORTENTSTABLE": obj = new DxfSortentsTable(); break; case "SPATIAL_FILTER": obj = new DxfSpatialFilter(); break; case "SPATIAL_INDEX": obj = new DxfSpatialIndex(); break; case "SUNSTUDY": obj = new DxfSunStudy(); break; case "TABLESTYLE": obj = new DxfTableStyle(); break; case "UNDERLAYDEFINITION": obj = new DxfUnderlayDefinition(); break; case "VBA_PROJECT": obj = new DxfVbaProject(); break; case "VISUALSTYLE": obj = new DxfVisualStyle(); break; case "WIPEOUTVARIABLES": obj = new DxfWipeoutVariables(); break; case "XRECORD": obj = new DxfXRecordObject(); break; default: SwallowObject(buffer); obj = null; break; } if (obj != null) { obj = obj.PopulateFromBuffer(buffer); } return(obj); }
public void WriteTableStyleTest() { var table = new DxfTableStyle(); table.CellStyles.Add(new DxfTableCellStyle() { Name = "one" }); table.CellStyles.Add(new DxfTableCellStyle() { Name = "two" }); var file = new DxfFile(); file.Objects.Add(table); VerifyFileContains(file, @" 0 TABLESTYLE 5 A 100 AcDbTableStyle 3 70 0 71 0 40 0.06 41 0.06 280 0 281 0 7 one 140 0.0 170 0 62 0 63 7 283 0 90 0 91 0 274 0 275 0 276 0 277 0 278 0 279 0 284 1 285 1 286 1 287 1 288 1 289 1 64 0 65 0 66 0 67 0 68 0 69 0 7 two 140 0.0 170 0 62 0 63 7 283 0 90 0 91 0 274 0 275 0 276 0 277 0 278 0 279 0 284 1 285 1 286 1 287 1 288 1 289 1 64 0 65 0 66 0 67 0 68 0 69 0 "); }