-
Notifications
You must be signed in to change notification settings - Fork 75
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: process-modeling templates (#11310)
* Streaming used in process modelign * temp * GetTemplates tests * Saveproces from template tests * Get appversion tests * use embedded resources for templates to avoid often IO operations on disc * format * fix reading template as embedded resource instead as stream * comments and test added * docs fix
- Loading branch information
1 parent
35d8e63
commit 85a283e
Showing
27 changed files
with
877 additions
and
72 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
using System.Linq; | ||
using System.Xml.Linq; | ||
using System.Xml.XPath; | ||
|
||
namespace Altinn.Studio.Designer.Helpers | ||
{ | ||
public static class PackageVersionHelper | ||
{ | ||
public static bool TryGetPackageVersionFromCsprojFile(string csprojFilePath, string packageName, out System.Version version) | ||
{ | ||
version = null; | ||
var doc = XDocument.Load(csprojFilePath); | ||
var packageReferences = doc.XPathSelectElements("//PackageReference") | ||
.Where(element => element.Attribute("Include")?.Value == packageName).ToList(); | ||
|
||
if (packageReferences.Count != 1) | ||
{ | ||
return false; | ||
} | ||
|
||
var packageReference = packageReferences.First(); | ||
|
||
string versionString = packageReference.Attribute("Version")?.Value; | ||
if (string.IsNullOrEmpty(versionString)) | ||
{ | ||
return false; | ||
} | ||
|
||
version = System.Version.Parse(versionString); | ||
return true; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.