public void SetConfig(IDMEEditor pbl, IDMLogger plogger, IUtil putil, string[] args, PassedArgs e, IErrorsInfo per) { Passedarg = e; Logger = plogger; ErrorObject = per; DMEEditor = pbl; List <Icon> icons = new List <Icon>(); Visutil = (IVisUtil)e.Objects.Where(c => c.Name == "VISUTIL").FirstOrDefault().obj; foreach (AssemblyClassDefinition cls in DMEEditor.ConfigEditor.DataSourcesClasses) { this.classHandlerComboBox.Items.Add(cls.className); } foreach (var item in Enum.GetValues(typeof(DatasourceCategory))) { DatasourceCategoryComboBox.Items.Add(item); // var it = DatasourceCategorycomboBox.Items.Add(item); } foreach (var item in Enum.GetValues(typeof(DataSourceType))) { DatasourceTypeComboBox.Items.Add(item); // var it = DatasourceCategorycomboBox.Items.Add(item); } foreach (string filename_w_path in Directory.GetFiles(DMEEditor.ConfigEditor.Config.Folders.Where(x => x.FolderFilesType == FolderFileTypes.GFX).FirstOrDefault().FolderPath, "*.ico", SearchOption.AllDirectories)) { try { string filename = Path.GetFileName(filename_w_path); this.iconname.Items.Add(filename); Icon ic = new Icon(filename_w_path); icons.Add(ic); } catch (FileLoadException ex) { ErrorObject.Flag = Errors.Failed; ErrorObject.Ex = ex; Logger.WriteLog($"Error Loading icons ({ex.Message})"); } } connectiondriversConfigBindingNavigator.BindingSource = connectiondriversConfigBindingSource; connectiondriversConfigBindingSource.DataSource = DMEEditor.ConfigEditor.DataDriversClasses; connectiondriversConfigBindingNavigatorSaveItem.Click += ConnectiondriversConfigBindingNavigatorSaveItem_Click; this.connectiondriversConfigDataGridView.DataError += ConnectiondriversConfigDataGridView_DataError; }
//----------------- ------------------------------ ----- public DMEEditor(IDMLogger logger, IUtil utilfunctions, IErrorsInfo per, IConfigEditor configEditor, IWorkFlowEditor pworkFlowEditor, IClassCreator pclasscreator, IETL pETL, IAssemblyHandler passemblyHandler, IDataTypesHelper dataTypesHelper) { logger.WriteLog("init all variables"); Logger = logger; Utilfunction = utilfunctions; Utilfunction.DME = this; ConfigEditor = configEditor; ErrorObject = per; classCreator = pclasscreator; WorkFlowEditor = pworkFlowEditor; WorkFlowEditor.DMEEditor = this; ETL = pETL; ETL.DMEEditor = this; assemblyHandler = passemblyHandler; typesHelper = dataTypesHelper; typesHelper.DMEEditor = this; }
public void SetConfig(IDMEEditor pbl, IDMLogger plogger, IUtil putil, string[] args, PassedArgs e, IErrorsInfo per) { Passedarg = e; Logger = plogger; ErrorObject = per; DMEEditor = pbl; Visutil = (IVisUtil)e.Objects.Where(c => c.Name == "VISUTIL").FirstOrDefault().obj; if (e.Objects.Where(c => c.Name == "Branch").Any()) { branch = (IBranch)e.Objects.Where(c => c.Name == "Branch").FirstOrDefault().obj; } //foreach (var item in Enum.GetValues(typeof(DataSourceType))) //{ // data.Items.Add(item); //} //foreach (var item in Enum.GetValues(typeof(DatasourceCategory))) //{ // CategorycomboBox.Items.Add(item); // // var it = DatasourceCategorycomboBox.Items.Add(item); //} foreach (ConnectionDriversConfig cls in DMEEditor.ConfigEditor.DataDriversClasses.Where(x => x.CreateLocal == true)) { this.EmbeddedDatabaseTypecomboBox.Items.Add(cls.classHandler); } foreach (StorageFolders p in DMEEditor.ConfigEditor.Config.Folders.Where(x => x.FolderFilesType == FolderFileTypes.DataFiles || x.FolderFilesType == FolderFileTypes.ProjectData)) { try { this.InstallFoldercomboBox.Items.Add(p.FolderPath); } catch (FileLoadException ex) { ErrorObject.Flag = Errors.Failed; ErrorObject.Ex = ex; Logger.WriteLog($"Error Loading icons ({ex.Message})"); } } this.CreateDBbutton.Click += CreateDBbutton_Click; }
public void SetConfig(IDMEEditor pbl, IDMLogger plogger, IUtil putil, string[] args, PassedArgs e, IErrorsInfo per) { Passedarg = e; Logger = plogger; DMEEditor = pbl; ErrorObject = per; Visutil = (IVisUtil)e.Objects.Where(c => c.Name == "VISUTIL").FirstOrDefault().obj; try { DMEEditor.ConfigEditor.ReadDataTypeFile(); } catch (Exception) { } this.DataSourcedataGridViewTextBoxColumn3.DataSource = DMEEditor.typesHelper.GetDataClasses(); this.NetDataTypedataGridViewTextBoxColumn4.DataSource = DMEEditor.typesHelper.GetNetDataTypes2(); try { mappingBindingSource.DataSource = DMEEditor.ConfigEditor.DataTypesMap; } catch (Exception ex) { ErrorObject.Flag = Errors.Failed; ErrorObject.Ex = ex; MessageBox.Show("Error Load Mapping ", "Beep"); Logger.WriteLog($"Error Load Mapping ({ex.Message})"); } mappingBindingNavigator.BindingSource = mappingBindingSource; this.mappingDataGridView.DataSource = mappingBindingSource; this.mappingDataGridView.Refresh(); this.mappingBindingNavigatorSaveItem.Click += MappingBindingNavigatorSaveItem_Click; this.mappingBindingSource.AddingNew += MappingBindingSource_AddingNew; this.mappingDataGridView.DataError += MappingDataGridView_DataError; }
public void SetConfig(IDMEEditor pDMEEditor, IDMLogger plogger, IUtil putil, string[] args, PassedArgs obj, IErrorsInfo per) { Passedarg = obj; Visutil = (IVisUtil)obj.Objects.Where(c => c.Name == "VISUTIL").FirstOrDefault().obj; Logger = plogger; DMEEditor = pDMEEditor; // DataSourceCategoryType = args[0]; ErrorObject = per; if (Visutil.treeEditor != null) { branch = Visutil.treeEditor.Branches[Visutil.treeEditor.Branches.FindIndex(x => x.BranchClass == "RDBMS" && x.BranchType == EnumPointType.Root)]; } else { branch = null; } foreach (var item in Enum.GetValues(typeof(DataSourceType))) { databaseTypeComboBox.Items.Add(item); } foreach (var item in Enum.GetValues(typeof(DatasourceCategory))) { CategorycomboBox.Items.Add(item); var it = DatasourceCategorycomboBox.Items.Add(item); } foreach (var item in DMEEditor.ConfigEditor.DataDriversClasses) { try { if (!string.IsNullOrEmpty(item.PackageName)) { driverNameComboBox.Items.Add(item.PackageName); } } catch (Exception ex) { Logger.WriteLog($"Error for Database connection :{ex.Message}"); } } try { foreach (var item in DMEEditor.ConfigEditor.DataDriversClasses) { if (!string.IsNullOrEmpty(item.PackageName)) { driverVersionComboBox.Items.Add(item.version); } } } catch (Exception ex) { } //util.ConfigEditor.LoadDataConnectionsValues(); dataConnectionsBindingSource.DataSource = null; ds = DMEEditor.ConfigEditor.DataConnections.Where(x => x.Category == DatasourceCategory.RDBMS).ToList(); //if (ds.FirstOrDefault() == null) //{ // ConnectionProperties x = new ConnectionProperties(); // x.Category = DatasourceCategory.RDBMS; // x.ID = DMEEditor.ConfigEditor.DataConnections.Count + 1; // DMEEditor.ConfigEditor.DataConnections.Add(x); //} dataConnectionsBindingSource.DataSource = ds; // headersBindingSource.DataSource = ds; // dataConnectionsBindingSource.ResetBindings(true); dataConnectionsBindingSource.AddingNew += DataConnectionsBindingSource_AddingNew; dataConnectionsBindingNavigator.BindingSource = dataConnectionsBindingSource; dataConnectionsBindingSource.AllowNew = true; // headersBindingSource.AllowNew = true; // entitiesBindingSource.AddingNew += EntitiesBindingSource_AddingNew; // headersBindingSource.AddingNew += HeadersBindingSource_AddingNew; this.dataConnectionsBindingNavigatorSaveItem.Click += DataConnectionsBindingNavigatorSaveItem_Click; driverNameComboBox.SelectedValueChanged += DriverNameComboBox_SelectedValueChanged; DatasourceCategorycomboBox.SelectedValueChanged += DatasourceCategorycomboBox_SelectedValueChanged; this.Headesbutton.Click += Headesbutton_Click; this.Querybutton.Click += Querybutton_Click; }