I’m working on making an API to read and write CXML file into a DOM. This will allow a programmer to use objects, properties and collections to build and manage Pivot collections. I’m using this to build a GUI application to make Pivot Collections. Here is an example using the API to open the CarCollection.CXML change the Name of item one and save to a new file.
- PivotCollection collection = PivotCollection.CreateFromXML(@"D:dataMyCollectionCarCollection.cxml");
- collection.ItemLists[0].Items[0].Name = "This is a test";
- collection.WriteXml(@"D:dataGymManagerMyCollectionCarCollectionUpdate1.cxml");
Here is the before:
and the after:
There are ways to change the Facets of an item. To change the text of the Fuel facet for item 1 in list 1.
- PivotCollection collection = PivotCollection.CreateFromXML(@"D:dataGymManagerMyCollectionCarCollection.cxml");
- collection.ItemLists[0].Items[0].Facets["Fuel"].Text[0].Value = "Water";
- collection.WriteXml(@"D:dataMyCollectionsCarCollectionUpdate2.cxml");
If you open the CXML file you will see the changes:
There are also APIs wrapped around the SeaDraggon assembly to help build the Image collection used by Pivot.
- string sourceFolder = @"D:dataGymManagerGymRecordImage";
- string destinatinoFolder = @"D:dataGymManagerMyCollection";
- ImageConverter.ConvertFiles(sourceFolder, destinatinoFolder);
The image convertor has a method to pass the various SeaDragon parameters if you whish to override the defaults.
- /// <summary>
- /// Converts the files.
- /// </summary>
- /// <param name="sourceImages">The source images.</param>
- /// <param name="destinationFolder">The destination folder.</param>
- /// <param name="tileSize">Size of the tile.</param>
- /// <param name="imageQuality">The image quality.</param>
- /// <param name="imageFormat">The image format.</param>
- /// <param name="tileOverLap">The tile over lap.</param>
- /// <param name="recurse">if set to <c>true</c> [recurse].</param>
- /// <param name="smoothStreaming">if set to <c>true</c> [smooth streaming].</param>
- public static void ConvertFiles(IEnumerable<string> sourceImages, string destinationFolder, int tileSize, double imageQuality, ImageFormat imageFormat, int tileOverLap, bool recurse, bool smoothStreaming)
I’m also working on a Data Domain and a Collection Model that will help facilitate building a GUI.
Here is the DOM for the XML




