public void SaveChanges() { TaskboardService.WorkItemIssuesOccurred += HandlWorkItemIssuesOccurred; TaskboardService.SaveChanges(); TaskboardService.WorkItemIssuesOccurred -= HandlWorkItemIssuesOccurred; RefreshFilter(); }
public WorkItem CreateNewLinkedWorkItem() { var item = TaskboardService.CreateNewLinkedWorkItem(SelectedWorkItem, LinkedWorkItemViewModel.SelectedLinkTypeEnd, LinkedWorkItemViewModel.SelectedWorkItemType, LinkedWorkItemViewModel.NewWorkItemTitle, LinkedWorkItemViewModel.NewWorkItemComment); return(item); }
private void HandleConnectionFailed(object sender, ErrorEventArgs e) { // disconnect on connect error ConfigurationFileName = null; TaskboardService.Disconnect(); EnsureConfigurationModel(); OnPropertyChanged("IsConnected"); SelectedWorkItem = null; OnConnectCompleted(); IsConnecting = false; // TODO: Visualize the issue }
private void AppDomainUnhandledException(object sender, UnhandledExceptionEventArgs e) { // TODO: Check correct exception handling try { Logger.LogException(e.ExceptionObject as Exception); TaskboardService.HandleConnectionException(e.ExceptionObject as Exception); } catch (Exception ex) { Logger.LogException(ex); } }
public void OpenConfiguration(string fileName) { IsConnecting = true; // inform configuration service to use file ConfigurationService.UseMemoryFile = false; // Note: When starting with a new config the config will be set up based on the current team project // That's why we still need access to it var configuration = ConfigurationService.ReadTaskboardConfiguration(fileName); // A configuration always contains it's connection data. Therefore we disconnect the taskboard service // and reconnect it afterwards using the connection data from the configuration TaskboardService.Disconnect(); if (!configuration.IsAssociatedWithTeamProject) { EnsureConfigurationModel(); ConfigurationViewModel.ConfigurationData = ConfigurationFileName = fileName; IsConnecting = false; return; } bool connectSucceeded = false; EventHandler <LoginDataEventArgs> handleRequestLoginData = delegate(object sender, LoginDataEventArgs args) { args.LoginData.TeamProjectCollectionUri = new Uri(configuration.TeamProjectCollection); args.LoginData.TeamProjectName = configuration.TeamProject; }; EventHandler handleTaskboardServiceConnected = delegate { connectSucceeded = true; }; TaskboardService.RequestLoginData += handleRequestLoginData; TaskboardService.Connected += handleTaskboardServiceConnected; TaskboardService.Connect(); TaskboardService.RequestLoginData -= handleRequestLoginData; TaskboardService.Connected -= handleTaskboardServiceConnected; if (connectSucceeded) { ConfigurationFileName = fileName; MruFileManager.AddFile(fileName); EnsureConfigurationModel(); } else { // TODO: Handle the case when connection was not possible ConfigurationFileName = null; EnsureConfigurationModel(); } IsConnecting = false; }
private void PerformConnect(string fileName) { var config = ConfigurationService.ReadTaskboardConfiguration(fileName); ILoginData loginData = Factory.CreateObject <ILoginData>(); loginData.TeamProjectCollectionUri = new Uri(config.TeamProjectCollection); loginData.TeamProjectName = config.TeamProject; TaskboardService.LoginData = loginData; IsConnecting = true; TaskboardService.Connect(); OnConnectCompleted(); OnPropertyChanged("IsConnected"); OpenConfiguration(fileName); IsConnecting = false; }
private void HandleException(object sender, DispatcherUnhandledExceptionEventArgs e) { try { Logger.LogException(e.Exception); if (TaskboardService.HandleConnectionException(e.Exception)) { e.Handled = true; } } catch (Exception ex) { Logger.LogException(ex); } }
private void PerformQuickConnect(Uri teamProjectCollectionUri, string projectName) { // Before connecting to a new team project we close the current configuration ConfigurationFileName = null; ConfigurationService.UseMemoryFile = true; TaskboardService.Disconnect(); ConfigurationViewModel.QueryItem = null; OnPropertyChanged("IsConnected"); // Now prepare for connection and connect. In case the service cannot connect it will ask for login data...and we will answer TaskboardService.LoginData = Factory.CreateObject <ILoginData>(); TaskboardService.LoginData.TeamProjectCollectionUri = teamProjectCollectionUri; TaskboardService.LoginData.TeamProjectName = projectName; TaskboardService.Connect(); IsConnecting = false; OnConnectCompleted(); OnPropertyChanged("IsConnected"); }
public bool IsVisibleNewLinkedWorkItem(WorkItem item, WorkItemLinkTypeEnd selectedLinkTypeEnd) { bool isStateVisible = false; foreach (ICustomState customState in ConfigurationViewModel.CustomStates) { if (customState.WorkItemStates.Contains(item.State)) { isStateVisible = true; break; } } bool isLinkTypeEndVisible = ConfigurationViewModel.CurrentLinkType == null || ConfigurationViewModel.CurrentLinkType.ForwardEnd == selectedLinkTypeEnd || ConfigurationViewModel.CurrentLinkType.ReverseEnd == selectedLinkTypeEnd; if (isLinkTypeEndVisible && isStateVisible && ConfigurationViewModel.ChildItems.Contains(item.Type.Name)) { TaskboardService.ApplyConfigurationToLink(item, SelectedWorkItem); return(true); } return(false); }
public void SaveLinkedItem(WorkItem item) { TaskboardService.SaveLinkedItem(SelectedWorkItem, item, LinkedWorkItemViewModel.SelectedLinkTypeEnd); }
public string GetTargetState(WorkItem workItem, ICustomState targetState) { return(TaskboardService.GetTargetState(workItem, targetState)); }