/// <summary>Export data according to shuffle definition in Definition to format Type</summary> /// <param name="container"></param> /// <param name="definition">Shuffle Definition</param> /// <param name="type">Type of target file</param> /// <param name="delimeter">Delimeter to use when exporting to Type: Text</param> /// <param name="ShuffleEventHandler">Event handler processing messages from the export. May be null.</param> /// <param name="defpath">Folder path for the shuffle definition file.</param> /// <param name="clearRemainingShuffleVars"></param> /// <param name="splitFiles">if true, it will split into seperate XmlDocuments for each record exported. </param> /// <returns>XmlDocument with exported data</returns> public static Dictionary <string, XmlDocument> QuickExport(IContainable container, XmlDocument definition, SerializationType type, char delimeter, EventHandler <ShuffleEventArgs> ShuffleEventHandler, string defpath, bool clearRemainingShuffleVars, bool splitFiles = false) { container.Logger.StartSection("QuickExport"); var shuffle = new Shuffler(container); if (ShuffleEventHandler != null) { shuffle.RaiseShuffleEvent += ShuffleEventHandler; } ShuffleHelper.VerifyShuffleVars(definition, clearRemainingShuffleVars); shuffle.Definition = definition; shuffle.definitionpath = defpath; var blocks = shuffle.ExportFromCRM(); Dictionary <string, XmlDocument> results; if (splitFiles) { results = shuffle.SplitFiles(blocks, type, delimeter); } else { results = new Dictionary <string, XmlDocument> { { string.Empty, shuffle.Serialize(blocks, type, delimeter) } }; } container.Logger.EndSection(); return(results); }
/// <summary>Export data according to shuffle definition in Definition to format Type</summary> /// <param name="Definition">Shuffle Definition</param> /// <param name="Type">Type of target file</param> /// <param name="Delimeter">Delimeter to use when exporting to Type: Text</param> /// <param name="ShuffleEventHandler">Event handler processing messages from the export. May be null.</param> /// <param name="container"></param> /// <param name="defpath">Folder path for the shuffle definition file.</param> /// <param name="clearRemainingShuffleVars"></param> /// <returns>XmlDocument with exported data</returns> public static XmlDocument QuickExport(XmlDocument Definition, SerializationType Type, char Delimeter, EventHandler <ShuffleEventArgs> ShuffleEventHandler, CintContainer container, string defpath, bool clearRemainingShuffleVars) { container.Logger.StartSection("QuickExport"); Shuffler shuffle = new Shuffler(container); if (ShuffleEventHandler != null) { shuffle.RaiseShuffleEvent += ShuffleEventHandler; } ShuffleHelper.VerifyShuffleVars(Definition, clearRemainingShuffleVars); shuffle.Definition = Definition; shuffle.definitionpath = defpath; ShuffleBlocks blocks = shuffle.ExportFromCRM(); XmlDocument result = shuffle.Serialize(blocks, Type, Delimeter); container.Logger.EndSection(); return(result); }