static void Drop() { DTE.InitOutputCalls("Dropdatabase"); Task.Factory.StartNew(() => { var startUpProject = DTE.Solution.FindStartUpProject(); var configItem = startUpProject.ProjectItems.Cast <ProjectItem>() .FirstOrDefault(item => new[] { "app.config", "web.config" }.Contains(item.Name.ToLower())); if (configItem == null) { DTE.WriteToOutput("Startup project " + startUpProject.Name + " does not contain a config file"); return; } foreach (ConnectionString optionsConnectionString in OptionClass.Instance.ConnectionStrings) { if (!string.IsNullOrEmpty(optionsConnectionString.Name)) { var connectionStringSettings = GetConnectionStringSettings(configItem, optionsConnectionString.Name); if (connectionStringSettings != null) { try { if (DbExist(connectionStringSettings)) { DropSqlServerDatabase(connectionStringSettings); } } catch (Exception e) { DTE.WriteToOutput(connectionStringSettings.ConnectionString + Environment.NewLine + e); } } } } DTE.WriteToOutput("Dropdatabase finished"); }, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default); }
private void OpenModelEditor(ProjectItemWrapper projectItemWrapper) { _dte.InitOutputCalls("OpenModelEditor"); try{ new ModelEditorRunner().Start(projectItemWrapper); } catch (Exception e) { _dte.WriteToOutput(e.ToString()); } }
private void LoadConfiguration(SolutionConfiguration configuration) { try{ configuration.Configuration.Activate(); SetDataSource(); DTE.InitOutputCalls($"Configuration {configuration.Name} loaded"); } catch (Exception e) { DTE.WriteToOutput(e.ToString()); } }
private IObservable <Unit> OpenModelEditor() { var projectItemWrapper = (ProjectItemWrapper)gridView1.GetRow(gridView1.FocusedRowHandle); _dte.InitOutputCalls("OpenModelEditor"); return(new ModelEditorRunner().Start(projectItemWrapper) .Catch <Unit, Exception>(e => { _dte.WriteToOutput(e.ToString()); return Observable.Empty <Unit>(); })); }
private void LoadProject(ProjectItemWrapper projectItemWrapper) { _dte.InitOutputCalls("LoadProject"); try{ var project = DteExtensions.DTE.Solution.AddFromFile(projectItemWrapper.FullPath); project.SkipBuild(); project.ChangeActiveConfiguration(); } catch (Exception e) { _dte.WriteToOutput(e.ToString()); } }
public static void Convert() { _dte.InitOutputCalls("ConvertProject"); string path = GetProjectConverterPath(); string token = OptionClass.Instance.Token; if (!string.IsNullOrEmpty(path) && !string.IsNullOrEmpty(token)) { var directoryName = Path.GetDirectoryName(_dte.Solution.FileName); _dte.WriteToOutput("Project Converter Started !!!"); var userName = $"/sc /k:{token} \"{directoryName}\""; Process.Start(path, userName); } }
static void LoadProjects() { DTE.InitOutputCalls("LoadProjects"); Task.Factory.StartNew(LoadProjectsCore, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default); }
public static void RunTest(bool debug) { DTE.InitOutputCalls("RunTest"); Task.Factory.StartNew(() => RunTestCore(debug), CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Current); }