WGet.NET 4.4.1
A WinGet wrapper library for .Net.
Loading...
Searching...
No Matches
WinGetFeatureNotSupportedException.cs
1//--------------------------------------------------//
2// Created by basicx-StrgV //
3// https://github.com/basicx-StrgV/ //
4//--------------------------------------------------//
5using System;
6using System.Runtime.Serialization;
7
8namespace WGetNET.Exceptions
9{
13 [Serializable]
14 public class WinGetFeatureNotSupportedException : Exception
15 {
19 public override string Message
20 {
21 get
22 {
23 if (_minVersion == null)
24 {
25 return "This feature is not supported in the installed WinGet version.";
26 }
27
28 return $"This feature is not supported in the installed WinGet version. WinGet {_minVersion} or higher is needed to use this feature.";
29 }
30
31 }
32
33 private readonly Version? _minVersion;
34
39 public WinGetFeatureNotSupportedException(Version minVersion)
40 {
41 _minVersion = minVersion;
42 }
43
49 public WinGetFeatureNotSupportedException(Version minVersion, Exception innerException) : base(null, innerException)
50 {
51 _minVersion = minVersion;
52 }
53
65 protected WinGetFeatureNotSupportedException(SerializationInfo info, StreamingContext context) : base(info, context)
66 {
67 }
68 }
69}
Exception that gets thrown if a winget feature is not supportet in the installed winget version.
override string Message
Gets a message that describes the current exception.
WinGetFeatureNotSupportedException(SerializationInfo info, StreamingContext context)
Initializes a new instance of the WGetNET.Exceptions.WinGetFeatureNotSupportedException class with se...
WinGetFeatureNotSupportedException(Version minVersion, Exception innerException)
Initializes a new instance of the WGetNET.Exceptions.WinGetFeatureNotSupportedException class.
WinGetFeatureNotSupportedException(Version minVersion)
Initializes a new instance of the WGetNET.Exceptions.WinGetFeatureNotSupportedException class.