public override void Run()
{
string path = FileService.SaveFile(Res.GetString("TITLE_EXPORT_DATASTORE_XML"), Res.GetString("FILTER_XML_FILES"));
if (!string.IsNullOrEmpty(path))
{
TreeNode connNode = Workbench.Instance.ObjectExplorer.GetSelectedNode();
FdoConnectionManager mgr = ServiceManager.Instance.GetService<FdoConnectionManager>();
FdoConnection conn = mgr.GetConnection(connNode.Name);
using (new TempCursor(Cursors.WaitCursor))
{
using (var svc = conn.CreateFeatureService())
{
var scs = new List<SpatialContextInfo>(svc.GetSpatialContexts()).ToArray();
var schemas = svc.DescribeSchema();
var mappings = svc.DescribeSchemaMapping(true);
var dstore = new FdoDataStoreConfiguration(schemas, scs, mappings);
dstore.Save(path);
Log.InfoFormatted("Connection saved to: {0}", path);
}
}
}
}