diff options
| author | Roy <Roy.mail.net@gmail.com> | 2023-05-08 17:11:38 +0300 |
|---|---|---|
| committer | Roy <Roy.mail.net@gmail.com> | 2023-05-08 17:11:38 +0300 |
| commit | f1d5de87c0335b5c954eceef94c8c7f72278d7df (patch) | |
| tree | 4565b01453a00711c3c1136ba6a2302e9257f66e /Software/Visual_Studio/Tango.TFS | |
| parent | 32ff3d6cc46e121a221232c67515e2f58e737bf2 (diff) | |
| download | Tango-f1d5de87c0335b5c954eceef94c8c7f72278d7df.tar.gz Tango-f1d5de87c0335b5c954eceef94c8c7f72278d7df.zip | |
Added Machine Type to TFS Lib & MS.
Diffstat (limited to 'Software/Visual_Studio/Tango.TFS')
4 files changed, 39 insertions, 1 deletions
diff --git a/Software/Visual_Studio/Tango.TFS/MachineType.cs b/Software/Visual_Studio/Tango.TFS/MachineType.cs new file mode 100644 index 000000000..044155b2b --- /dev/null +++ b/Software/Visual_Studio/Tango.TFS/MachineType.cs @@ -0,0 +1,17 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Tango.TFS +{ + public enum MachineType + { + [Description("TS 1800")] + TS1800 = 0, + [Description("Twine X4")] + TwineX4 = 1, + } +} diff --git a/Software/Visual_Studio/Tango.TFS/Tango.TFS.csproj b/Software/Visual_Studio/Tango.TFS/Tango.TFS.csproj index 3e3e6f6fd..271491a7e 100644 --- a/Software/Visual_Studio/Tango.TFS/Tango.TFS.csproj +++ b/Software/Visual_Studio/Tango.TFS/Tango.TFS.csproj @@ -207,6 +207,7 @@ <Compile Include="Email.cs" /> <Compile Include="ITeamFoundationEmailClient.cs" /> <Compile Include="Iteration.cs" /> + <Compile Include="MachineType.cs" /> <Compile Include="Priority.cs" /> <Compile Include="Project.cs" /> <Compile Include="ResolvedReason.cs" /> @@ -266,7 +267,7 @@ </Target> <ProjectExtensions> <VisualStudio> - <UserProperties BuildVersion_AssemblyInfoFilename="Properties\AssemblyInfo.cs" BuildVersion_UpdateAssemblyVersion="True" BuildVersion_BuildVersioningStyle="None.None.Increment.TimeStamp" BuildVersion_UseGlobalSettings="False" BuildVersion_StartDate="2000/1/1" /> + <UserProperties BuildVersion_StartDate="2000/1/1" BuildVersion_UseGlobalSettings="False" BuildVersion_BuildVersioningStyle="None.None.Increment.TimeStamp" BuildVersion_UpdateAssemblyVersion="True" BuildVersion_AssemblyInfoFilename="Properties\AssemblyInfo.cs" /> </VisualStudio> </ProjectExtensions> </Project>
\ No newline at end of file diff --git a/Software/Visual_Studio/Tango.TFS/TeamFoundationServiceClient.cs b/Software/Visual_Studio/Tango.TFS/TeamFoundationServiceClient.cs index 750c5fa58..379dcac2e 100644 --- a/Software/Visual_Studio/Tango.TFS/TeamFoundationServiceClient.cs +++ b/Software/Visual_Studio/Tango.TFS/TeamFoundationServiceClient.cs @@ -40,6 +40,7 @@ namespace Tango.TFS public const String MACHINE_SN = "Custom.MachineSN"; public const String ENVIRONMENT = "Custom.Environment"; public const String LOGGED_IN_USER = "Custom.LoggedInUser"; + public const String MACHINE_TYPE = "Custom.MachineType"; } #endregion @@ -428,6 +429,13 @@ namespace Tango.TFS }); } + patchDocument.Add(new JsonPatchOperation + { + Operation = Operation.Add, + Path = GetExtensionFieldNameForWrite(ExtensionFields.MACHINE_TYPE), + Value = workItem.MachineType.ToDescription(), + }); + var resultWorkItem = witClient.CreateWorkItemAsync(patchDocument, project.Name, workItem.Type.ToString(), bypassRules: true).Result; workItem.ID = resultWorkItem.Id.Value; @@ -944,6 +952,11 @@ namespace Tango.TFS workItem.Environment = TryGetField(item.Fields, ExtensionFields.ENVIRONMENT).ToString(); } + if (item.Fields.ContainsKey(ExtensionFields.MACHINE_TYPE)) + { + workItem.MachineType = ParseEnumByDescription<MachineType>(item.Fields[ExtensionFields.MACHINE_TYPE].ToString()); + } + workItem.Comment = TryGetField(item.Fields, GetFieldNameForRead(CoreField.History)).ToString(); return workItem; diff --git a/Software/Visual_Studio/Tango.TFS/WorkItem.cs b/Software/Visual_Studio/Tango.TFS/WorkItem.cs index 35c2f8669..552a64161 100644 --- a/Software/Visual_Studio/Tango.TFS/WorkItem.cs +++ b/Software/Visual_Studio/Tango.TFS/WorkItem.cs @@ -80,6 +80,13 @@ namespace Tango.TFS set { _priority = value; RaisePropertyChangedAuto(); } } + private MachineType _machineType; + public MachineType MachineType + { + get { return _machineType; } + set { _machineType = value; RaisePropertyChangedAuto(); } + } + private String _stepsToReproduce; public String StepsToReproduce { |
