private void CheckOutInObject(DataAccess.IVersionControlled checkOutObject, bool trueCheckOut_falseCheckIn) { DataAccess.IVersionControlled domainObject = null; domainObject = checkOutObject; if (typeof(DataAccess.IVersionControlled).IsAssignableFrom(domainObject.GetType())) { if (trueCheckOut_falseCheckIn) { try { MetaManagerServices.GetConfigurationManagementService().CheckOutDomainObject(domainObject.Id, domainObject.GetType()); } catch (ConfigurationManagementException ex) { MessageBox.Show(ex.Message); } } else { try { Cursor.Current = Cursors.WaitCursor; MetaManagerServices.GetConfigurationManagementService().CheckInDomainObject(domainObject.Id, domainObject.GetType(), FrontendApplication); Cursor.Current = Cursors.Default; } catch (ConfigurationManagementException ex) { MessageBox.Show(ex.Message); } } } }
public ImportChange() { InitializeComponent(); modelService = MetaManagerServices.GetModelService(); configurationManagementService = MetaManagerServices.GetConfigurationManagementService(); importChangeHelper = MetaManagerServices.Helpers.ImportChangeHelper; }
public StatusAddToSourceControl(DeploymentGroup deployGrp) { InitializeComponent(); deploymentGroup = deployGrp; configurationManagementService = MetaManagerServices.GetConfigurationManagementService(); configurationManagementService.StatusChanged += new StatusChangedDelegate(confMgnService_StatusChanged); }
public GenerateReports() { InitializeComponent(); configurationManagementService = MetaManagerServices.GetConfigurationManagementService(); modelService = MetaManagerServices.GetModelService(); }
public FindPropertyForm() { InitializeComponent(); AutoSelectTableForFoundColumn = string.Empty; modelService = MetaManagerServices.GetModelService(); configurationManagementService = MetaManagerServices.GetConfigurationManagementService(); }
public CreateEditServiceMethod() { InitializeComponent(); appService = MetaManagerServices.GetApplicationService(); modelService = MetaManagerServices.GetModelService(); configurationManagementService = MetaManagerServices.GetConfigurationManagementService(); }
public GenerateCode() { InitializeComponent(); modelService = MetaManagerServices.GetModelService(); configurationManagementService = MetaManagerServices.GetConfigurationManagementService(); modelService.StatusChanged += new StatusChangedDelegate(StatusChanged); configurationManagementService.StatusChanged += new StatusChangedDelegate(StatusChanged); }
public GenerateBackendCodeForm() { InitializeComponent(); ctx = ContextRegistry.GetContext(); configurationManagementService = MetaManagerServices.GetConfigurationManagementService(); modelService = MetaManagerServices.GetModelService(); configurationManagementService.StatusChanged += new StatusChangedDelegate(confMgnService_StatusChanged); }
public int Run(string action, List <string> frontendApplications, List <string> backendApplications, Dictionary <string, string> options) { startticks = DateTime.Now.Ticks; MetaManagerServices.GetConfigurationManagementService().StatusChanged += new StatusChangedDelegate(Program_StatusChanged); MetaManagerServices.GetModelService().StatusChanged += new StatusChangedDelegate(Program_StatusChanged); switch (action) { case ActionValues.GENERATE: { if (frontendApplications.Count > 0 && backendApplications.Count > 0) { overallProgressMax = "3"; bool ignoreCheckOuts = true; if (options.ContainsKey(CommandLineOptionParameters.IGNORECHECKOUTS)) { ignoreCheckOuts = Convert.ToBoolean(options[CommandLineOptionParameters.IGNORECHECKOUTS]); if (ignoreCheckOuts) { overallProgress = "1"; } } else { overallProgress = "1"; } try { MetaManagerServices.GetModelService().GenerateApplication(frontendApplications, backendApplications, ignoreCheckOuts); Program_StatusChanged("Code generation compleate", 0, 0, 0); } catch { return(1); } } else { Program_StatusChanged("Both frontend and backend application must be specefied", 0, 0, 0); return(1); } break; } } return(0); }
private void checkinButton_Click(object sender, EventArgs e) { try { progressTextBox.Text = ""; if (resultListView.CheckedItems.Count > 0) { Cursor = Cursors.WaitCursor; searchButton.Enabled = false; progressBar.Maximum = resultListView.CheckedItems.Count; progressBar.Minimum = 0; progressBar.Value = 0; System.Windows.Forms.Application.DoEvents(); IList <IVersionControlled> selectedObjects = new List <IVersionControlled>(); foreach (ListViewItem item in resultListView.CheckedItems) { IVersionControlled domainObject = ((KeyValuePair <IVersionControlled, DataAccess.Domain.Application>)item.Tag).Key; if (GetChildFormsForDomainObject(domainObject).Count > 0) { MessageBox.Show("You must close all windows handling the " + _modelService.GetDomainObjectType(domainObject).Name + " before checking in.", System.Windows.Forms.Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Exclamation); return; } } foreach (ListViewItem item in resultListView.CheckedItems) { IVersionControlled domainObject = ((KeyValuePair <IVersionControlled, DataAccess.Domain.Application>)item.Tag).Key; selectedObjects.Add(domainObject); } MetaManagerServices.GetConfigurationManagementService().CheckInDomainObjects(selectedObjects); } } catch (Exception ex) { progressBar.Value = 0; AddToProgressText("Check in failed."); AddToProgressText(ex.ToString()); } finally { Cursor = Cursors.Default; searchButton.Enabled = true; searchButton_Click(sender, e); } }
private void undoCheckoutButton_Click(object sender, EventArgs e) { try { progressTextBox.Text = ""; if (resultListView.CheckedItems.Count > 0) { Cursor = Cursors.WaitCursor; searchButton.Enabled = false; progressBar.Maximum = resultListView.CheckedItems.Count; progressBar.Minimum = 0; progressBar.Value = 0; foreach (ListViewItem item in resultListView.CheckedItems) { System.Windows.Forms.Application.DoEvents(); //Do check in IVersionControlled domainObject = ((KeyValuePair <IVersionControlled, DataAccess.Domain.Application>)item.Tag).Key; DataAccess.Domain.Application application = ((KeyValuePair <IVersionControlled, DataAccess.Domain.Application>)item.Tag).Value; AddToProgressText(string.Format("Undoing check out for \"{0}\".", domainObject.ToString())); MetaManagerServices.GetConfigurationManagementService().UndoCheckOutDomainObject(domainObject.Id, domainObject.GetType(), application); progressBar.Value++; System.Windows.Forms.Application.DoEvents(); } AddToProgressText("Undo check out completed successfully."); } } catch (Exception ex) { AddToProgressText("Undo check out failed."); AddToProgressText(ex.ToString()); } finally { Cursor = Cursors.Default; searchButton.Enabled = true; searchButton_Click(sender, e); } }
private void CheckOutInObject(DataAccess.IVersionControlled checkOutObject, bool trueCheckOut_falseCheckIn, Application backendApplication) { DataAccess.IVersionControlled domainObject = null; domainObject = checkOutObject; if (typeof(DataAccess.IVersionControlled).IsAssignableFrom(domainObject.GetType())) { if (trueCheckOut_falseCheckIn) { MetaManagerServices.GetConfigurationManagementService().CheckOutDomainObject(domainObject.Id, domainObject.GetType()); } else { MetaManagerServices.GetConfigurationManagementService().CheckInDomainObject(domainObject.Id, domainObject.GetType(), backendApplication); } } }
private void compareWithLatestVersionToolStripMenuItem_Click(object sender, EventArgs e) { if (resultListView.SelectedItems.Count > 0) { Cursor = Cursors.WaitCursor; try { KeyValuePair <IVersionControlled, DataAccess.Domain.Application> item = ((KeyValuePair <IVersionControlled, DataAccess.Domain.Application>)resultListView.SelectedItems[0].Tag); MetaManagerServices.GetConfigurationManagementService().DiffWithPreviousVersion(item.Key, item.Value); } finally { Cursor = Cursors.Default; } } }
private void importBtn_Click(object sender, EventArgs e) { try { if (ResultlistView.CheckedItems.Count > 0) { Cursor = Cursors.WaitCursor; addFilesBtn.Enabled = false; StatusprogressBar.Maximum = ResultlistView.CheckedItems.Count * 2; StatusprogressBar.Minimum = 0; StatusprogressBar.Value = 0; Boolean stopped = false; foreach (ListViewItem item in ResultlistView.CheckedItems) { AddToProgressText("\nCotrolls if the object is available: " + item.SubItems[0].Text); System.Windows.Forms.Application.DoEvents(); Type classType = MetaManagerServices.GetConfigurationManagementService().GetClassTypeAndIdForXML(item.SubItems[0].Text).Key; Guid id = MetaManagerServices.GetConfigurationManagementService().GetClassTypeAndIdForXML(item.SubItems[0].Text).Value; DataAccess.IVersionControlled readDomainObjectfromDB = ((DataAccess.IVersionControlled)modelService.GetDomainObject(id, classType)); if (readDomainObjectfromDB != null) { if (readDomainObjectfromDB.IsLocked && readDomainObjectfromDB.LockedBy != Environment.UserName) { MessageBox.Show("The selected object " + item.SubItems[0].Text + "is checked out by another user it is not possible import this"); AddToProgressText("\nImport stopped. The selected object " + item.SubItems[0].Text + "is checked out by another user. It is not possible import this.\n"); stopped = true; } if (stopped) { break; } StatusprogressBar.Value++; System.Windows.Forms.Application.DoEvents(); } } if (stopped) { return; } List <string> existingObjectsPaths = new List <string>(); List <string> newObjectsPaths = new List <string>(); foreach (ListViewItem item in ResultlistView.CheckedItems) { Type classType = MetaManagerServices.GetConfigurationManagementService().GetClassTypeAndIdForXML(item.SubItems[0].Text).Key; Guid id = MetaManagerServices.GetConfigurationManagementService().GetClassTypeAndIdForXML(item.SubItems[0].Text).Value; DataAccess.IVersionControlled readDomainObjectfromDB = ((DataAccess.IVersionControlled)modelService.GetDomainObject(id, classType)); if (readDomainObjectfromDB != null) { //Existing object AddToProgressText("\nCheck out the object: " + item.SubItems[0].Text); System.Windows.Forms.Application.DoEvents(); try { MetaManagerServices.GetConfigurationManagementService().CheckOutDomainObject(readDomainObjectfromDB.Id, readDomainObjectfromDB.GetType()); } catch (ConfigurationManagementException ex) { MessageBox.Show(ex.Message); AddToProgressText("\nImport stopped. The selected object " + item.SubItems[0].Text + "is checked out by another user. It is not possible import this.\n"); stopped = true; } if (stopped) { break; } AddToProgressText("\nChecked out the selected object " + item.SubItems[0].Text); existingObjectsPaths.Add(item.SubItems[0].Text); } else { //New object AddToProgressText("\nFound new object: " + item.SubItems[0].Text); System.Windows.Forms.Application.DoEvents(); newObjectsPaths.Add(item.SubItems[0].Text); } StatusprogressBar.Value++; System.Windows.Forms.Application.DoEvents(); } if (stopped == false) { List <string>[] pathLists = new List <string> [2]; pathLists[0] = newObjectsPaths; pathLists[1] = existingObjectsPaths; System.Threading.ThreadPool.QueueUserWorkItem(ThreadWork, pathLists); } } } catch (BusinessLogic.ConfigurationManagementException ex) { MessageBox.Show(ex.Message); } finally { Cursor = Cursors.Default; addFilesBtn.Enabled = true; } }
public GetAllMetadataFromCM() { InitializeComponent(); configurationManagementService = MetaManagerServices.GetConfigurationManagementService(); configurationManagementService.StatusChanged += new StatusChangedDelegate(confMgnService_StatusChanged); }
public CreateEditModule() { InitializeComponent(); modelService = MetaManagerServices.GetModelService(); configurationManagementService = MetaManagerServices.GetConfigurationManagementService(); }
private void OkButton_Click(object sender, EventArgs e) { if (IsEditable) { Cursor.Current = Cursors.WaitCursor; if (application.IsFrontend == false) { if (ConnectionStringTextBox.Text != schema.ConnectionString) { if (MessageBox.Show("You have changed the connection string. This change cannot be cancelled. Are you sure that you want to save the change?", "Question", MessageBoxButtons.OKCancel, MessageBoxIcon.Question) == DialogResult.Cancel) { return; } else { //check out schema try { MetaManagerServices.GetConfigurationManagementService().CheckOutDomainObject(schema.Id, modelService.GetDomainObjectType(schema)); } catch (ConfigurationManagementException ex) { Cursor.Current = Cursors.Default; MessageBox.Show(ex.Message); return; } schema = schema = modelService.GetAllDomainObjectsByApplicationId <Schema>(BackendApplication.Id)[0]; schema.ConnectionString = ConnectionStringTextBox.Text; // Save schema schema = (Cdc.MetaManager.DataAccess.Domain.Schema)modelService.SaveDomainObject(schema); // checkin try { MetaManagerServices.GetConfigurationManagementService().CheckInDomainObject(schema.Id, modelService.GetDomainObjectType(schema), BackendApplication); } catch (ConfigurationManagementException ex) { Cursor.Current = Cursors.Default; MessageBox.Show(ex.Message); } } } } if (!NamingGuidance.CheckName(NameTextBox.Text, "Application Name", true)) { return; } application.Name = NameTextBox.Text; application.Namespace = NamespaceTextBox.Text; application.Version = VersionTextBox.Text; application = (Cdc.MetaManager.DataAccess.Domain.Application)modelService.SaveDomainObject(application); ContaindDomainObjectIdAndType = new KeyValuePair <Guid, Type>(application.Id, typeof(Cdc.MetaManager.DataAccess.Domain.Application)); Cursor.Current = Cursors.Default; this.DialogResult = System.Windows.Forms.DialogResult.OK; this.Close(); } }
public ImportSelectedObjects() { InitializeComponent(); modelService = MetaManagerServices.GetModelService(); configurationManagementService = MetaManagerServices.GetConfigurationManagementService(); }
private void Form2_Load(object sender, EventArgs e) { MetaManagerServices.GetConfigurationManagementService().StatusChanged += new StatusChangedDelegate(FindCheckOuts_StatusChanged); checkoutComboBox.SelectedIndex = 0; checkoutComboBox.Focus(); }
public EditApplicationInfo() { InitializeComponent(); modelService = MetaManagerServices.GetModelService(); configurationManagementService = MetaManagerServices.GetConfigurationManagementService(); }