private void WriteRegistry() { System.Collections.Generic.List <RegistryEntry> regEntries = new List <RegistryEntry>(); regEntries.Add(new RegistryEntry(TfsRegistryPath.WorkflowActivitiesGlobalCollection, txtWorkflowActivitiesGlobalCollection.Text)); regEntries.Add(new RegistryEntry(TfsRegistryPath.WorkflowActivitiesGlobalPath, txtWorkflowActivitiesGlobalPath.Text)); regEntries.Add(new RegistryEntry(TfsRegistryPath.WorkflowsGlobalCollection, txtWorkflowsGlobalCollection.Text)); regEntries.Add(new RegistryEntry(TfsRegistryPath.WorkflowsGlobalPath, txtWorkflowsGlobalPath.Text)); regEntries.Add(new RegistryEntry(TfsRegistryPath.WorkflowsProjectReleativePath, txtWorkflowsProjectReleativePath.Text)); regEntries.Add(new RegistryEntry(TfsRegistryPath.WorkflowsConfigFileNameWebService, txtWorkflowsConfigFileNameWebService.Text)); regEntries.Add(new RegistryEntry(TfsRegistryPath.WorkflowsConfigFileNameJobAgent, txtWorkflowsConfigFileNameJobAgent.Text)); tfsRegServiceConfiguration.WriteEntries(regEntries); ReadOnlyCollection <CatalogNode> collectionNodes = srvConfiguration.CatalogNode.QueryChildren( new[] { CatalogResourceTypes.ProjectCollection }, false, CatalogQueryOptions.None); foreach (Microsoft.TeamFoundation.Framework.Client.CatalogNode collectionNode in collectionNodes) { string strCollection = collectionNode.Resource.DisplayName; Guid quidCollection = new Guid(collectionNode.Resource.Properties["InstanceId"]); Microsoft.TeamFoundation.Client.TfsTeamProjectCollection collection = srvConfiguration.GetTeamProjectCollection(quidCollection); Microsoft.TeamFoundation.Framework.Client.ITeamFoundationRegistry tfsRegServiceCollection = collection.GetService <Microsoft.TeamFoundation.Framework.Client.ITeamFoundationRegistry>(); string strWorkflowsCollectionPath = dictWorkflowsCollectionPath[strCollection]; regEntries.Clear(); regEntries.Add(new RegistryEntry(TfsRegistryPath.WorkflowsCollectionPath, strWorkflowsCollectionPath)); tfsRegServiceCollection.WriteEntries(regEntries); } }
private void ReadRegistry() { txtWorkflowActivitiesGlobalCollection.Text = tfsRegServiceConfiguration.GetValue(TfsRegistryPath.WorkflowActivitiesGlobalCollection, "").Trim(new char[] { '/' }); txtWorkflowActivitiesGlobalPath.Text = tfsRegServiceConfiguration.GetValue(TfsRegistryPath.WorkflowActivitiesGlobalPath, "").Trim(new char[] { '/' }); txtWorkflowsGlobalCollection.Text = tfsRegServiceConfiguration.GetValue(TfsRegistryPath.WorkflowsGlobalCollection, "").Trim(new char[] { '/' }); txtWorkflowsGlobalPath.Text = tfsRegServiceConfiguration.GetValue(TfsRegistryPath.WorkflowsGlobalPath, "").Trim(new char[] { '/' }); // WorkflowsCollectionPath.Text = tfsRegServiceConfiguration.GetValue(TfsRegistryPath.WorkflowsCollectionPath, "").Trim(new char[] { '/' }); txtWorkflowsProjectReleativePath.Text = tfsRegServiceConfiguration.GetValue(TfsRegistryPath.WorkflowsProjectReleativePath, "").Trim(new char[] { '/' }); txtWorkflowsConfigFileNameWebService.Text = tfsRegServiceConfiguration.GetValue(TfsRegistryPath.WorkflowsConfigFileNameWebService, "").Trim(new char[] { '/' }); txtWorkflowsConfigFileNameJobAgent.Text = tfsRegServiceConfiguration.GetValue(TfsRegistryPath.WorkflowsConfigFileNameJobAgent, "").Trim(new char[] { '/' }); cbCollection.ValueMember = ""; cbCollection.DisplayMember = ""; cbCollection.DataSource = null; dictWorkflowsCollectionPath = new Dictionary <string, string>(); ReadOnlyCollection <CatalogNode> collectionNodes = srvConfiguration.CatalogNode.QueryChildren( new[] { CatalogResourceTypes.ProjectCollection }, false, CatalogQueryOptions.None); foreach (Microsoft.TeamFoundation.Framework.Client.CatalogNode collectionNode in collectionNodes) { string strCollection = collectionNode.Resource.DisplayName; Guid quidCollection = new Guid(collectionNode.Resource.Properties["InstanceId"]); Microsoft.TeamFoundation.Client.TfsTeamProjectCollection collection = srvConfiguration.GetTeamProjectCollection(quidCollection); Microsoft.TeamFoundation.Framework.Client.ITeamFoundationRegistry tfsRegServiceCollection = collection.GetService <Microsoft.TeamFoundation.Framework.Client.ITeamFoundationRegistry>(); string strWorkflowsCollectionPath = tfsRegServiceCollection.GetValue(TfsRegistryPath.WorkflowsCollectionPath, "").Trim(new char[] { '/' }); dictWorkflowsCollectionPath.Add(strCollection, strWorkflowsCollectionPath); } cbCollection.DataSource = new BindingSource(dictWorkflowsCollectionPath, null); cbCollection.DisplayMember = "Key"; cbCollection.ValueMember = "Value"; }