private void OnUpdateCommonComponentsAction(SyncStatus status) { // Check New Updates int codeVersion = this.GetConfigurator().CommonVersion; int[] availableUpdates = this.GetConfigurator().ListUpdates(); bool bDetectNewUpdate = false; foreach (int availableUpdate in availableUpdates) { if (codeVersion < availableUpdate) { bDetectNewUpdate = true; break; } } if (bDetectNewUpdate) { UpdateCommonComponentsForm form = new UpdateCommonComponentsForm(GetConfigurator()); if (this.SnapIn.Console.ShowDialog(form) == DialogResult.OK) { Process currentProcess = Process.GetCurrentProcess(); ProcessStartInfo processStart = GetConfigurator().BuildUpdateCommandForCommonComponents(form.GetUpdateId(), currentProcess.Id); Process.Start(processStart); currentProcess.CloseMainWindow(); } } else { MessageBoxParameters msgBox = new MessageBoxParameters(); msgBox.Icon = MessageBoxIcon.Information; msgBox.Caption = SnapInResources.SoftwareUpdate_Caption; msgBox.Buttons = MessageBoxButtons.OK; msgBox.Text = SnapInResources.SoftwareUpdateMsg_UnableFind; this.SnapIn.Console.ShowDialog(msgBox); } }
private void OnUpdateCommonComponentsAction(SyncStatus status) { // Check New Updates int codeVersion = this.GetConfigurator().CommonVersion; int[] availableUpdates = this.GetConfigurator().ListUpdates(); bool bDetectNewUpdate = false; foreach (int availableUpdate in availableUpdates) { if (codeVersion < availableUpdate) { bDetectNewUpdate = true; break; } } if (bDetectNewUpdate) { UpdateCommonComponentsForm form = new UpdateCommonComponentsForm(GetConfigurator()); if (this.SnapIn.Console.ShowDialog(form) == DialogResult.OK) { Process currentProcess = Process.GetCurrentProcess(); ProcessStartInfo processStart = GetConfigurator().BuildUpdateCommandForCommonComponents(form.GetUpdateId(), currentProcess.Id); Process.Start(processStart); currentProcess.CloseMainWindow(); } } else { MessageBoxParameters msgBox = new MessageBoxParameters(); msgBox.Icon = MessageBoxIcon.Information; msgBox.Caption = SnapInResources.SoftwareUpdate_Caption; msgBox.Buttons = MessageBoxButtons.OK; msgBox.Text = SnapInResources.SoftwareUpdateMsg_UnableFind; this.SnapIn.Console.ShowDialog(msgBox); } }