forked from PintaProject/Pinta
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix the .NET 6 build by reverting usage of .NET 7 APIs
- Loading branch information
1 parent
68b8f07
commit 6b94335
Showing
3 changed files
with
27 additions
and
21 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,21 @@ | ||
// | ||
// | ||
// WorkspaceManager.cs | ||
// | ||
// | ||
// Author: | ||
// Jonathan Pobst <[email protected]> | ||
// | ||
// | ||
// Copyright (c) 2010 Jonathan Pobst | ||
// | ||
// | ||
// Permission is hereby granted, free of charge, to any person obtaining a copy | ||
// of this software and associated documentation files (the "Software"), to deal | ||
// in the Software without restriction, including without limitation the rights | ||
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
// copies of the Software, and to permit persons to whom the Software is | ||
// furnished to do so, subject to the following conditions: | ||
// | ||
// | ||
// The above copyright notice and this permission notice shall be included in | ||
// all copies or substantial portions of the Software. | ||
// | ||
// | ||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
|
@@ -107,7 +107,9 @@ public Document CreateAndActivateDocument (Gio.File? file, string? file_type, Si | |
Document doc = new Document (size); | ||
|
||
if (file is not null) { | ||
ArgumentNullException.ThrowIfNullOrEmpty (file_type); | ||
if (string.IsNullOrEmpty (file_type)) | ||
throw new ArgumentNullException ($"nameof{file_type} must contain value."); | ||
|
||
doc.File = file; | ||
doc.FileType = file_type; | ||
} else | ||
|
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 |
---|---|---|
@@ -1,21 +1,21 @@ | ||
// | ||
// | ||
// SaveDocumentImplmentationAction.cs | ||
// | ||
// | ||
// Author: | ||
// Jonathan Pobst <[email protected]> | ||
// | ||
// | ||
// Copyright (c) 2010 Jonathan Pobst | ||
// | ||
// | ||
// Permission is hereby granted, free of charge, to any person obtaining a copy | ||
// of this software and associated documentation files (the "Software"), to deal | ||
// in the Software without restriction, including without limitation the rights | ||
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
// copies of the Software, and to permit persons to whom the Software is | ||
// furnished to do so, subject to the following conditions: | ||
// | ||
// | ||
// The above copyright notice and this permission notice shall be included in | ||
// all copies or substantial portions of the Software. | ||
// | ||
// | ||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
|
@@ -154,7 +154,9 @@ private static bool SaveFile (Document document, Gio.File? file, FormatDescripto | |
throw new ArgumentException ("Attempted to save a document with no associated file"); | ||
|
||
if (format == null) { | ||
ArgumentNullException.ThrowIfNullOrEmpty (document.FileType); | ||
if (string.IsNullOrEmpty (document.FileType)) | ||
throw new ArgumentNullException ($"nameof{document.FileType} must contain value."); | ||
|
||
format = PintaCore.ImageFormats.GetFormatByExtension (document.FileType); | ||
} | ||
|
||
|