public static IssueRepository Create(IssueRepositorySettings settings) { if (settings != null) return new AnkhRepository(settings.RepositoryUri, settings.RepositoryId, settings.CustomProperties); return null; }
private void PopulateConnectors() { BindingList <IssueRepositoryConnector> dataSource = new BindingList <IssueRepositoryConnector>(); dataSource.Add(new DummyConnector()); if (Context != null) { IAnkhIssueService iService = Context.GetService <IAnkhIssueService>(); if (iService != null) { IssueRepositorySettings currentSettings = CurrentSolutionSettings; ICollection <IssueRepositoryConnector> connectors = iService.Connectors; if (connectors != null) { foreach (IssueRepositoryConnector connector in connectors) { dataSource.Add(connector); } } } } connectorComboBox.DataSource = dataSource; connectorComboBox.DisplayMember = "Name"; }
protected override void OnActivated(EventArgs e) { base.OnActivated(e); // apply current connector selection when dialog is first activated if (firstActivated) { firstActivated = false; IAnkhIssueService iService = Context.GetService <IAnkhIssueService>(); if (iService != null) { IssueRepositorySettings solutionSettings = CurrentSolutionSettings; if (solutionSettings != null) { IssueRepositoryConnector selectConnector; if (iService.TryGetConnector(solutionSettings.ConnectorName, out selectConnector)) { if (selectConnector != null) { connectorComboBox.SelectedItem = selectConnector; return; } } } } connectorComboBox.SelectedIndex = 0; } }
/// <summary> /// Clears current repository object /// </summary> /// <remarks>if the new settings are "really" different from the current settings, reset</remarks> public void MarkDirty() { bool isReallyDirty; IIssueTrackerSettings settings = Settings; if (settings == null) { isReallyDirty = _repository != null; } else { IssueRepositorySettings currentRepositorySettings = settings.ToIssueRepositorySettings(); if (currentRepositorySettings == null) { isReallyDirty = _repository != null; } else { isReallyDirty = !currentRepositorySettings.ValueEquals(_repository); } } if (isReallyDirty) { CurrentIssueRepository = null; } }
/// <summary> /// Create an Issue repository based on the given settings /// </summary> /// <param name="settings"></param> /// <returns></returns> public override IssueRepository Create(IssueRepositorySettings settings) { if (settings != null && string.Equals(settings.ConnectorName, Name)) { return(AnkhRepository.Create(settings)); } return(null); }
public override IssueRepository Create(IssueRepositorySettings settings) { IssueRepositoryConnector dlg = Delegate; if (dlg != null) { return(dlg.Create(settings)); } return(null); }
public bool ShouldPersist(IssueRepositorySettings other) { return(!(true && other != null && string.Equals(ConnectorName, other.ConnectorName) && object.Equals(IssueRepositoryUri, other.RepositoryUri) && string.Equals(IssueRepositoryId, other.RepositoryId) && HasSameProperties(CustomProperties, other.CustomProperties) ) ); }
private void UpdatePageFor(IssueRepositoryConnector connector) { configPagePanel.Controls.Clear(); bool needsCurrentSettings = false; _configPage = GetConfigurationPageFor(connector, ref needsCurrentSettings); if (_connectorPageControlMap == null) { _connectorPageControlMap = new Dictionary <string, Control>(); } Control newControl = null; if (!_connectorPageControlMap.TryGetValue(connector.Name, out newControl)) { newControl = GetControlFor(_configPage); newControl.Dock = DockStyle.Fill; _connectorPageControlMap.Add(connector.Name, newControl); } // setup config page if (_configPage != null) { _configPage.OnPageEvent += new EventHandler <ConfigPageEventArgs>(_configPage_OnPageEvent); } configPagePanel.Controls.Add(newControl); if (_configPage != null && needsCurrentSettings) { BeginInvoke((DoSomething) delegate() { IssueRepositorySettings currentSettings = CurrentSolutionSettings; if (currentSettings != null && string.Equals(currentSettings.ConnectorName, connector.Name)) { _configPage.Settings = currentSettings; } }); } }
public override IssueRepository Create(IssueRepositorySettings settings) { return(settings != null && Name.Equals(settings.ConnectorName) ? VersionOneRepository.Create(settings) : null); }
/// <summary> /// Creates an Issue Repository based on the settings. /// </summary> public abstract IssueRepository Create(IssueRepositorySettings settings);
public override IssueRepository Create(IssueRepositorySettings settings) { return settings != null && Name.Equals(settings.ConnectorName) ? VersionOneRepository.Create(settings) : null; }
private bool SetIssueRepositoryProperties(AnkhContext context, SvnItem item, IssueRepositorySettings settings) { return context.GetService<IProgressRunner>().RunModal("Applying Issue Repository settings", delegate(object sender, ProgressWorkerArgs wa) { wa.Client.SetProperty(item.FullPath, AnkhSccPropertyNames.IssueRepositoryConnector, settings.ConnectorName); wa.Client.SetProperty(item.FullPath, AnkhSccPropertyNames.IssueRepositoryUri, settings.RepositoryUri.ToString()); string repositoryId = settings.RepositoryId; if (string.IsNullOrEmpty(repositoryId)) { wa.Client.DeleteProperty(item.FullPath, AnkhSccPropertyNames.IssueRepositoryId); } else { wa.Client.SetProperty(item.FullPath, AnkhSccPropertyNames.IssueRepositoryId, settings.RepositoryId); } IDictionary<string, object> customProperties = settings.CustomProperties; if (customProperties == null || customProperties.Count == 0 ) { wa.Client.DeleteProperty(item.FullPath, AnkhSccPropertyNames.IssueRepositoryPropertyNames); wa.Client.DeleteProperty(item.FullPath, AnkhSccPropertyNames.IssueRepositoryPropertyValues); } else { string[] propNameArray = new string[customProperties.Keys.Count]; customProperties.Keys.CopyTo(propNameArray, 0); string propNames = string.Join(",", propNameArray); List<string> propValueList = new List<string>(); foreach (string propName in propNameArray) { object propValue; if (!customProperties.TryGetValue(propName, out propValue)) { propValue = string.Empty; } propValueList.Add(propValue == null ? string.Empty : propValue.ToString()); } string propValues = string.Join(",", propValueList.ToArray()); wa.Client.SetProperty(item.FullPath, AnkhSccPropertyNames.IssueRepositoryPropertyNames, propNames); wa.Client.SetProperty(item.FullPath, AnkhSccPropertyNames.IssueRepositoryPropertyValues, propValues); } }).Succeeded; }
public override IssueRepository Create(IssueRepositorySettings settings) { return null; }
public static IssueRepository Create(IssueRepositorySettings settings) { return(settings != null ? new VersionOneRepository(settings.RepositoryUri, settings.RepositoryId, settings.CustomProperties) : null); }
public bool ShouldPersist(IssueRepositorySettings other) { return !(true && other != null && string.Equals(ConnectorName, other.ConnectorName) && object.Equals(IssueRepositoryUri, other.RepositoryUri) && string.Equals(IssueRepositoryId, other.RepositoryId) && HasSameProperties(CustomProperties, other.CustomProperties) ) ; }
public override IssueRepository Create(IssueRepositorySettings settings) { return(null); }
private bool SetIssueRepositoryProperties(IAnkhServiceProvider context, SvnItem item, IssueRepositorySettings settings) { return(context.GetService <IProgressRunner>().RunModal("Applying Issue Repository settings", delegate(object sender, ProgressWorkerArgs wa) { wa.Client.SetProperty(item.FullPath, AnkhSccPropertyNames.IssueRepositoryConnector, settings.ConnectorName); wa.Client.SetProperty(item.FullPath, AnkhSccPropertyNames.IssueRepositoryUri, settings.RepositoryUri.ToString()); string repositoryId = settings.RepositoryId; if (string.IsNullOrEmpty(repositoryId)) { wa.Client.DeleteProperty(item.FullPath, AnkhSccPropertyNames.IssueRepositoryId); } else { wa.Client.SetProperty(item.FullPath, AnkhSccPropertyNames.IssueRepositoryId, settings.RepositoryId); } IDictionary <string, object> customProperties = settings.CustomProperties; if (customProperties == null || customProperties.Count == 0 ) { wa.Client.DeleteProperty(item.FullPath, AnkhSccPropertyNames.IssueRepositoryPropertyNames); wa.Client.DeleteProperty(item.FullPath, AnkhSccPropertyNames.IssueRepositoryPropertyValues); } else { string[] propNameArray = new string[customProperties.Keys.Count]; customProperties.Keys.CopyTo(propNameArray, 0); string propNames = string.Join(",", propNameArray); List <string> propValueList = new List <string>(); foreach (string propName in propNameArray) { object propValue; if (!customProperties.TryGetValue(propName, out propValue)) { propValue = string.Empty; } propValueList.Add(propValue == null ? string.Empty : propValue.ToString()); } string propValues = string.Join(",", propValueList.ToArray()); wa.Client.SetProperty(item.FullPath, AnkhSccPropertyNames.IssueRepositoryPropertyNames, propNames); wa.Client.SetProperty(item.FullPath, AnkhSccPropertyNames.IssueRepositoryPropertyValues, propValues); } }).Succeeded); }
public override IssueRepository Create(IssueRepositorySettings settings) { return(new JiraIssueRepository(settings.ConnectorName, settings.CustomProperties)); }
public static ConnectorSettings ToConnectorSettings(this IssueRepositorySettings src) { return(ToConnectorSettings(src.CustomProperties, src.RepositoryUri)); }
public override IssueRepository Create(IssueRepositorySettings settings) { IssueRepositoryConnector dlg = Delegate; if (dlg != null) { return dlg.Create(settings); } return null; }
public static IssueRepository Create(IssueRepositorySettings settings) { return settings != null ? new VersionOneRepository(settings.RepositoryUri, settings.RepositoryId, settings.CustomProperties) : null; }