Skip to content

Commit

Permalink
Check for nulls
Browse files Browse the repository at this point in the history
Remove <Private>True</Private>
  • Loading branch information
ealbu committed May 20, 2022
1 parent f59ab17 commit 3afcfd2
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 26 deletions.
2 changes: 1 addition & 1 deletion TemplatesVSIX/MsBuild/Include.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public Include(string includeString)
if (!items.Any())
throw new ArgumentException("The include string is invalid", nameof(includeString));

Name = items.First();
Name = items.FirstOrDefault();
Properties = items.Skip(1)
.Select(s =>
{
Expand Down
11 changes: 6 additions & 5 deletions TemplatesVSIX/MsBuild/Project.cs
Original file line number Diff line number Diff line change
Expand Up @@ -67,16 +67,16 @@ public string TargetVersion
{
return _document
.Descendants()
.First(d => d.Name.LocalName == TargetFrameworkVersionText)
.FirstOrDefault(d => d.Name.LocalName == TargetFrameworkVersionText)?
.Value;
}
set
{
var target = _document
.Descendants()
.First(d => d.Name.LocalName == TargetFrameworkVersionText);
.FirstOrDefault(d => d.Name.LocalName == TargetFrameworkVersionText);

target.Value = value;
if (target != null) target.Value = value;
}
}

Expand All @@ -103,8 +103,9 @@ public void AddProperty(string name, string value)
{
var group = _document
.Descendants()
.First(d => d.Name.LocalName == PropertyGroupText && d.Attribute("Condition") == null);
group.Add(new XElement(defaultNs + name, value));
.FirstOrDefault(d => d.Name.LocalName == PropertyGroupText && d.Attribute("Condition") == null);

group?.Add(new XElement(defaultNs + name, value));
}
}

Expand Down
7 changes: 0 additions & 7 deletions TemplatesVSIX/SDL Terminology Provider/ProjectTemplate.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,31 +7,24 @@
</PropertyGroup>
<ItemGroup>
<Reference Include="Sdl.FileTypeSupport.Framework.Core">
<Private>True</Private>
<HintPath>$(MSBuildProgramFiles32)\Trados\Trados Studio\Studio17\Sdl.FileTypeSupport.Framework.Core.dll</HintPath>
</Reference>
<Reference Include="Sdl.FileTypeSupport.Framework.Implementation">
<Private>True</Private>
<HintPath>$(MSBuildProgramFiles32)\Trados\Trados Studio\Studio17\Sdl.FileTypeSupport.Framework.Implementation.dll</HintPath>
</Reference>
<Reference Include="Sdl.FileTypeSupport.Framework.Core">
<Private>True</Private>
<HintPath>$(MSBuildProgramFiles32)\Trados\Trados Studio\Studio17\Sdl.FileTypeSupport.Framework.Core.dll</HintPath>
</Reference>
<Reference Include="Sdl.ProjectAutomation.Core">
<Private>True</Private>
<HintPath>$(MSBuildProgramFiles32)\Trados\Trados Studio\Studio17\Sdl.ProjectAutomation.Core.dll</HintPath>
</Reference>
<Reference Include="Sdl.ProjectAutomation.FileBased">
<Private>True</Private>
<HintPath>$(MSBuildProgramFiles32)\Trados\Trados Studio\Studio17\Sdl.ProjectAutomation.FileBased.dll</HintPath>
</Reference>
<Reference Include="Sdl.ProjectAutomation.Settings">
<Private>True</Private>
<HintPath>$(MSBuildProgramFiles32)\Trados\Trados Studio\Studio17\Sdl.ProjectAutomation.Settings.dll</HintPath>
</Reference>
<Reference Include="Sdl.Terminology.TerminologyProvider.Core">
<Private>True</Private>
<HintPath>$(MSBuildProgramFiles32)\Trados\Trados Studio\Studio17\Sdl.Terminology.TerminologyProvider.Core.dll</HintPath>
</Reference>
<Reference Include="System" />
Expand Down
9 changes: 0 additions & 9 deletions TemplatesVSIX/SDL Trados Studio/ProjectTemplate.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,39 +7,30 @@
</PropertyGroup>
<ItemGroup>
<Reference Include="Sdl.Desktop.IntegrationApi">
<Private>True</Private>
<HintPath>$(MSBuildProgramFiles32)\Trados\Trados Studio\Studio17\Sdl.Desktop.IntegrationApi.dll</HintPath>
</Reference>
<Reference Include="Sdl.Desktop.IntegrationApi.Extensions">
<Private>True</Private>
<HintPath>$(MSBuildProgramFiles32)\Trados\Trados Studio\Studio17\Sdl.Desktop.IntegrationApi.Extensions.dll</HintPath>
</Reference>
<Reference Include="Sdl.FileTypeSupport.Framework.Core">
<Private>True</Private>
<HintPath>$(MSBuildProgramFiles32)\Trados\Trados Studio\Studio17\Sdl.FileTypeSupport.Framework.Core.dll</HintPath>
</Reference>
<Reference Include="Sdl.FileTypeSupport.Framework.Implementation">
<Private>True</Private>
<HintPath>$(MSBuildProgramFiles32)\Trados\Trados Studio\Studio17\Sdl.FileTypeSupport.Framework.Implementation.dll</HintPath>
</Reference>
<Reference Include="Sdl.ProjectAutomation.Core">
<Private>True</Private>
<HintPath>$(MSBuildProgramFiles32)\Trados\Trados Studio\Studio17\Sdl.ProjectAutomation.Core.dll</HintPath>
</Reference>
<Reference Include="Sdl.ProjectAutomation.FileBased">
<Private>True</Private>
<HintPath>$(MSBuildProgramFiles32)\Trados\Trados Studio\Studio17\Sdl.ProjectAutomation.FileBased.dll</HintPath>
</Reference>
<Reference Include="Sdl.ProjectAutomation.Settings">
<Private>True</Private>
<HintPath>$(MSBuildProgramFiles32)\Trados\Trados Studio\Studio17\Sdl.ProjectAutomation.Settings.dll</HintPath>
</Reference>
<Reference Include="Sdl.TranslationStudioAutomation.IntegrationApi">
<Private>True</Private>
<HintPath>$(MSBuildProgramFiles32)\Trados\Trados Studio\Studio17\Sdl.TranslationStudioAutomation.IntegrationApi.dll</HintPath>
</Reference>
<Reference Include="Sdl.TranslationStudioAutomation.IntegrationApi.Extensions">
<Private>True</Private>
<HintPath>$(MSBuildProgramFiles32)\Trados\Trados Studio\Studio17\Sdl.TranslationStudioAutomation.IntegrationApi.Extensions.dll</HintPath>
</Reference>
<Reference Include="System" />
Expand Down
4 changes: 0 additions & 4 deletions TemplatesVSIX/SDL Translation Provider/ProjectTemplate.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,14 @@
<ItemGroup>
<Reference Include="Sdl.Core.Globalization">
<HintPath>$(MSBuildProgramFiles32)\Trados\Trados Studio\Studio17\Sdl.Core.Globalization.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Sdl.LanguagePlatform.Core">
<HintPath>$(MSBuildProgramFiles32)\Trados\Trados Studio\Studio17\Sdl.LanguagePlatform.Core.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Sdl.LanguagePlatform.TranslationMemory">
<Private>True</Private>
<HintPath>$(MSBuildProgramFiles32)\Trados\Trados Studio\Studio17\Sdl.LanguagePlatform.TranslationMemory.dll</HintPath>
</Reference>
<Reference Include="Sdl.LanguagePlatform.TranslationMemoryApi">
<Private>True</Private>
<HintPath>$(MSBuildProgramFiles32)\Trados\Trados Studio\Studio17\Sdl.LanguagePlatform.TranslationMemoryApi.dll</HintPath>
</Reference>
<Reference Include="System" />
Expand Down

0 comments on commit 3afcfd2

Please sign in to comment.