protected override Task InitializeAsync(object sender, SectionInitializeEventArgs e) { _branchTeamService = new BranchTeamService(Context.TeamProjectCollection, (ITeamExplorer)ServiceProvider.GetService(typeof(ITeamExplorer))); _teamChangesetChangesetProvider = new TeamChangesetChangesetProvider(ServiceProvider); var projectNames = _teamChangesetChangesetProvider.ListProjects(); projectNames.ForEach(x => ProjectNames.Add(x.Name)); return(base.InitializeAsync(sender, e)); }
private static void PopulateProjectNames(DTE dte) { Solution = (IVsPersistSolutionProps)GetGlobalService(typeof(IVsPersistSolutionProps)); Projects projects = dte.Solution.Projects; string solutionName = dte.Solution.FullName; solutionName = solutionName.Substring(solutionName.LastIndexOf('\\') + 1); foreach (Project project in projects) { ProjectNames.Add(project); IEnumerable <AssemblyName> references; try { references = CollectSettings(project) .Where(assembly => assembly.Name.StartsWith("Cqrs")) .ToList(); } catch (NullReferenceException) { continue; } foreach (AssemblyName assemblyName in references) { string urlPath = string.Format("/{0}/{1}/{2}/{3}/{4}/{5}/{6}/{7}", HttpUtility.UrlPathEncode(dte.Version), HttpUtility.UrlPathEncode(dte.Edition), HttpUtility.UrlPathEncode(solutionName), HttpUtility.UrlPathEncode(project.Name), HttpUtility.UrlPathEncode(project.Kind), HttpUtility.UrlPathEncode(project.UniqueName.Replace('\\', '¿')), HttpUtility.UrlPathEncode(assemblyName.Name), HttpUtility.UrlPathEncode(assemblyName.Version.ToString())); HttpWebRequest request = WebRequest.Create(string.Format("https://www.chinchillasoftware.com/VisualStudio{0}", urlPath)) as HttpWebRequest; request.Method = "GET"; try { new TaskFactory().StartNew(() => { using (request.GetResponse()) { Debug.WriteLine("Called '{0}'.", request.Address); } }); Debug.WriteLine("Calling '{0}'.", request.Address); } catch { } } } }
public async Task InitializeAsync(TeamMergeContext teamMergeContext) { await _setBusyWhileExecutingAsync(async() => { var projectNames = await _teamService.GetProjectNamesAsync(); Workspaces = new ObservableCollection <Workspace>(await _teamService.AllWorkspacesAsync()); SelectedWorkspace = _teamService.CurrentWorkspace() ?? Workspaces.First(); projectNames.ToList().ForEach(x => ProjectNames.Add(x)); if (teamMergeContext != null) { RestoreContext(teamMergeContext); } else { SetSavedSelectedBranches(); } }); }
public override async void Initialize(object sender, SectionInitializeEventArgs e) { base.Initialize(sender, e); await SetBusyWhileExecutingAsync(async() => { var projectNames = await _teamService.GetProjectNames(); Workspaces = new ObservableCollection <WorkspaceModel>(await _teamService.AllWorkspaces()); SelectedWorkspace = _teamService.CurrentWorkspace() ?? Workspaces.First(); projectNames.ToList().ForEach(x => ProjectNames.Add(x)); if (e.Context != null) { RestoreContext(e); } else { SetSavedSelectedBranches(); } }); }
public void InitializeGanttHost() { _Chart = new Braincase.GanttChart.Chart(); this._Chart.Dock = System.Windows.Forms.DockStyle.Fill; this._Chart.Font = new System.Drawing.Font("Microsoft JhengHei UI", 8F); this._Chart.Location = new System.Drawing.Point(0, 0); this._Chart.Margin = new System.Windows.Forms.Padding(0); this._Chart.Name = "_Chart"; this._Chart.Size = new System.Drawing.Size(671, 496); this._Chart.TabIndex = 0; this._Chart.TimeResolution = Braincase.GanttChart.TimeResolution.Day; Project1 = new ProjectManager() { Start = new DateTime(2018, 11, 1) }; var task1 = new MyTask(Project1) { Name = "Project 1" }; var task2 = new MyTask(Project1) { Name = "Task 1" }; var task3 = new MyTask(Project1) { Name = "Task 2" }; var task4 = new MyTask(Project1) { Name = "Task 3" }; var task5 = new MyTask(Project1) { Name = "Task 4" }; var task6 = new MyTask(Project1) { Name = "Task 5" }; var task7 = new MyTask(Project1) { Name = "Task 6" }; Project1.Add(task1); Project1.Add(task2); Project1.Add(task3); Project1.Add(task4); Project1.Add(task5); Project1.Add(task6); Project1.Add(task7); Project1.SetDuration(task1, TimeSpan.FromDays(3)); Project1.SetDuration(task2, TimeSpan.FromDays(5)); Project1.SetDuration(task3, TimeSpan.FromDays(7)); Project1.SetDuration(task4, TimeSpan.FromDays(4)); Project1.SetDuration(task5, TimeSpan.FromDays(3)); Project1.SetDuration(task6, TimeSpan.FromDays(5)); Project1.Group(task1, task2); Project1.Group(task1, task3); Project1.Group(task1, task4); Project1.Group(task1, task5); Project1.Group(task1, task6); Project1.Group(task1, task7); Project1.Relate(task2, task3); Project1.Relate(task2, task4); Project1.Relate(task4, task5); Project1.Relate(task4, task6); Project1.Relate(task6, task7); Project1.Relate(task5, task7); var span = DateTime.Today - Project1.Start; Project1.Now = span; Projects.Add(Project1); Project1 = new ProjectManager() { Start = new DateTime(2018, 11, 16) }; task1 = new MyTask(Project1) { Name = "Project 2" }; task2 = new MyTask(Project1) { Name = "Task 1" }; task3 = new MyTask(Project1) { Name = "Task 2" }; task4 = new MyTask(Project1) { Name = "Task 3" }; task5 = new MyTask(Project1) { Name = "Task 4" }; task6 = new MyTask(Project1) { Name = "Task 5" }; task7 = new MyTask(Project1) { Name = "Task 6" }; Project1.Add(task1); Project1.Add(task2); Project1.Add(task3); Project1.Add(task4); Project1.Add(task5); Project1.Add(task6); Project1.Add(task7); Project1.SetDuration(task7, TimeSpan.FromDays(4)); Project1.SetDuration(task2, TimeSpan.FromDays(5)); Project1.SetDuration(task3, TimeSpan.FromDays(12)); Project1.SetDuration(task4, TimeSpan.FromDays(6)); Project1.SetDuration(task5, TimeSpan.FromDays(3)); Project1.SetDuration(task6, TimeSpan.FromDays(8)); Project1.Group(task1, task2); Project1.Group(task1, task3); Project1.Group(task1, task4); Project1.Group(task1, task5); Project1.Group(task1, task6); Project1.Group(task1, task7); Project1.Relate(task2, task3); Project1.Relate(task2, task4); Project1.Relate(task2, task5); Project1.Relate(task4, task6); Project1.Relate(task3, task7); Project1.Relate(task5, task7); span = DateTime.Today - Project1.Start; Project1.Now = span; Projects.Add(Project1); Project1 = new ProjectManager() { Start = new DateTime(2018, 10, 26) }; task1 = new MyTask(Project1) { Name = "Project 3" }; task2 = new MyTask(Project1) { Name = "Task 1" }; task3 = new MyTask(Project1) { Name = "Task 2" }; task4 = new MyTask(Project1) { Name = "Task 3" }; task5 = new MyTask(Project1) { Name = "Task 4" }; task6 = new MyTask(Project1) { Name = "Task 5" }; task7 = new MyTask(Project1) { Name = "Task 6" }; var task8 = new MyTask(Project1) { Name = "Task 7" }; Project1.Add(task1); Project1.Add(task2); Project1.Add(task3); Project1.Add(task4); Project1.Add(task5); Project1.Add(task6); Project1.Add(task7); Project1.Add(task8); Project1.SetDuration(task2, TimeSpan.FromDays(5)); Project1.SetDuration(task3, TimeSpan.FromDays(12)); Project1.SetDuration(task4, TimeSpan.FromDays(6)); Project1.SetDuration(task5, TimeSpan.FromDays(3)); Project1.SetDuration(task6, TimeSpan.FromDays(8)); Project1.SetDuration(task7, TimeSpan.FromDays(12)); Project1.SetDuration(task8, TimeSpan.FromDays(18)); Project1.Group(task1, task2); Project1.Group(task1, task3); Project1.Group(task1, task4); Project1.Group(task1, task5); Project1.Group(task1, task6); Project1.Group(task1, task7); Project1.Relate(task2, task4); Project1.Relate(task2, task6); Project1.Relate(task2, task5); Project1.Relate(task4, task6); Project1.Relate(task3, task7); Project1.Relate(task5, task8); span = DateTime.Today - Project1.Start; Project1.Now = span; Projects.Add(Project1); //_Chart.Init(Project1); //_Chart.CreateTaskDelegate = delegate () { return new MyTask(Project1); }; this.GanttHost.Child = _Chart; TimeViewComboBox.ItemsSource = typeof(TimeResolution).GetEnumNames(); TimeViewComboBox.SelectedIndex = 1; foreach (var p in Projects.ToList()) { ProjectNames.Add(p.Tasks.FirstOrDefault()); } ProjectsComboBox.ItemsSource = ProjectNames.ToList(); }