public byte[] doExport(IAzManExport[] objectsToExport, bool includeItemAuthorizations, bool includeDBUsers, bool includeAuthorizations) { MemoryStream ms = new MemoryStream(); XmlWriter xw = null; xw = XmlWriter.Create(ms); this.BeginExport(xw); foreach (IAzManExport objectToExport in objectsToExport) { objectToExport.Export(xw, includeItemAuthorizations, includeDBUsers, includeAuthorizations, objectToExport); } this.EndExport(xw); xw.Flush(); xw.Close(); return ms.ToArray(); }
void exportAction_Triggered(object sender, MMC.SyncActionEventArgs e) { frmExportOptions frm = new frmExportOptions(); DialogResult dr = this.SnapIn.Console.ShowDialog(frm); if (dr == DialogResult.OK) { frmExport frmwait = new frmExport(); IAzManExport[] objectsToExport = new IAzManExport[this.SelectedNodes.Count]; for (int i = 0; i < this.SelectedNodes.Count; i++) { objectsToExport[i] = ((ItemDefinitionScopeNode)this.SelectedNodes[i]).Item; } frmwait.ShowDialog(e, frm.fileName, objectsToExport, frm.includeSecurityObjects, frm.includeDBUsers, frm.includeAuthorizations, ((ItemDefinitionScopeNode)this.SelectedNodes[0]).Item.Application.Store.Storage); } }
void exportAction_Triggered(object sender, MMC.SyncActionEventArgs e) { frmExportOptions frm = new frmExportOptions(); DialogResult dr = this.SnapIn.Console.ShowDialog(frm); if (dr == DialogResult.OK) { frmExport frmwait = new frmExport(); IAzManItem[] itemToExport = this.application.GetItems(); IAzManExport[] toExport = new IAzManExport[itemToExport.Length]; for (int i = 0; i < itemToExport.Length; i++) { toExport[i] = itemToExport[i]; } frmwait.ShowDialog(e, frm.fileName, toExport, frm.includeSecurityObjects, frm.includeDBUsers, frm.includeAuthorizations, this.application.Store.Storage); } }
public DialogResult ShowDialog(MMC.SyncActionEventArgs e, string fileName, IAzManExport[] objectsToExport, bool includeSecurityObjects, bool includeDBUsers, bool includeAuthorizations, IAzManStorage storage) { this.storage = storage; XmlWriter xw=null; try { this.Show(); this.Activate(); this.Focus(); /*Application.DoEvents();*/ if (e!=null) e.Status.ReportProgress(50, 100, Globalization.MultilanguageResource.GetString("frmExport_Msg10")); xw = XmlWriter.Create(fileName); this.BeginExport(xw); foreach (IAzManExport objectToExport in objectsToExport) { objectToExport.Export(xw, includeSecurityObjects, includeDBUsers, includeAuthorizations, objectToExport); /*Application.DoEvents();*/ } this.EndExport(xw); if (e != null) e.Status.Complete(Globalization.MultilanguageResource.GetString("frmExport_Msg20"), true); return this.DialogResult = DialogResult.OK; } catch (Exception ex) { this.ShowError(ex.Message, Globalization.MultilanguageResource.GetString("frmExport_Msg30")); e.Status.Complete(Globalization.MultilanguageResource.GetString("frmExport_Msg20"), false); return this.DialogResult = DialogResult.Cancel; } finally { if (xw != null) { xw.Flush(); xw.Close(); } this.Hide(); } }
void exportAction_Triggered(object sender, MMC.SyncActionEventArgs e) { frmExportOptions frm = new frmExportOptions(); DialogResult dr = this.SnapIn.Console.ShowDialog(frm); if (dr == DialogResult.OK) { frmExport frmwait = new frmExport(); IAzManExport[] objectsToExport = new IAzManExport[this.SelectedNodes.Count]; for (int i = 0; i < this.SelectedNodes.Count; i++) { objectsToExport[i] = ((ApplicationScopeNode)this.SelectedNodes[i]).Application; } frmwait.ShowDialog(e, frm.fileName, objectsToExport, frm.includeSecurityObjects, frm.includeDBUsers, frm.includeAuthorizations, ((ApplicationScopeNode)this.SelectedNodes[0]).Application.Store.Storage); } }