aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/Tango.SharedUI
diff options
context:
space:
mode:
authorRoy <Roy.mail.net@gmail.com>2023-02-20 02:28:15 +0200
committerRoy <Roy.mail.net@gmail.com>2023-02-20 02:28:15 +0200
commit795f3ab6ea36551281ec6442aa16b9547af96adc (patch)
tree4b1af0d700014054ff7d0ac01e381bbd25699e59 /Software/Visual_Studio/Tango.SharedUI
parentba39c2e2a012953f2f9633fa7df59b49cf3fd4c7 (diff)
downloadTango-795f3ab6ea36551281ec6442aa16b9547af96adc.tar.gz
Tango-795f3ab6ea36551281ec6442aa16b9547af96adc.zip
Incorporated machine type into machine creation and management + job runs.
Diffstat (limited to 'Software/Visual_Studio/Tango.SharedUI')
-rw-r--r--Software/Visual_Studio/Tango.SharedUI/Converters/IsNullToVisibilityInverseConverter.cs24
-rw-r--r--Software/Visual_Studio/Tango.SharedUI/Converters/NullObjectToBooleanInverseConverter.cs45
-rw-r--r--Software/Visual_Studio/Tango.SharedUI/Tango.SharedUI.csproj4
3 files changed, 72 insertions, 1 deletions
diff --git a/Software/Visual_Studio/Tango.SharedUI/Converters/IsNullToVisibilityInverseConverter.cs b/Software/Visual_Studio/Tango.SharedUI/Converters/IsNullToVisibilityInverseConverter.cs
new file mode 100644
index 000000000..ef284b12c
--- /dev/null
+++ b/Software/Visual_Studio/Tango.SharedUI/Converters/IsNullToVisibilityInverseConverter.cs
@@ -0,0 +1,24 @@
+using System;
+using System.Collections.Generic;
+using System.Globalization;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows;
+using System.Windows.Data;
+
+namespace Tango.SharedUI.Converters
+{
+ public class IsNullToVisibilityInverseConverter : IValueConverter
+ {
+ public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
+ {
+ return value == null ? Visibility.Visible : Visibility.Collapsed;
+ }
+
+ public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
+ {
+ throw new NotImplementedException();
+ }
+ }
+}
diff --git a/Software/Visual_Studio/Tango.SharedUI/Converters/NullObjectToBooleanInverseConverter.cs b/Software/Visual_Studio/Tango.SharedUI/Converters/NullObjectToBooleanInverseConverter.cs
new file mode 100644
index 000000000..73e41beea
--- /dev/null
+++ b/Software/Visual_Studio/Tango.SharedUI/Converters/NullObjectToBooleanInverseConverter.cs
@@ -0,0 +1,45 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows.Data;
+
+namespace Tango.SharedUI.Converters
+{
+ /// <summary>
+ /// Represents a binding converter for returning true for valid object instances and false for null object reference.
+ /// </summary>
+ public class NullObjectToBooleanInverseConverter : IValueConverter
+ {
+ /// <summary>
+ /// Converts a value.
+ /// </summary>
+ /// <param name="value">The value produced by the binding source.</param>
+ /// <param name="targetType">The type of the binding target property.</param>
+ /// <param name="parameter">The converter parameter to use.</param>
+ /// <param name="culture">The culture to use in the converter.</param>
+ /// <returns>
+ /// A converted value. If the method returns null, the valid null value is used.
+ /// </returns>
+ public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
+ {
+ return (value == null);
+ }
+
+ /// <summary>
+ /// Converts a value.
+ /// </summary>
+ /// <param name="value">The value that is produced by the binding target.</param>
+ /// <param name="targetType">The type to convert to.</param>
+ /// <param name="parameter">The converter parameter to use.</param>
+ /// <param name="culture">The culture to use in the converter.</param>
+ /// <returns>
+ /// A converted value. If the method returns null, the valid null value is used.
+ /// </returns>
+ public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
+ {
+ return value;
+ }
+ }
+}
diff --git a/Software/Visual_Studio/Tango.SharedUI/Tango.SharedUI.csproj b/Software/Visual_Studio/Tango.SharedUI/Tango.SharedUI.csproj
index c2071d296..c7eccab9f 100644
--- a/Software/Visual_Studio/Tango.SharedUI/Tango.SharedUI.csproj
+++ b/Software/Visual_Studio/Tango.SharedUI/Tango.SharedUI.csproj
@@ -119,12 +119,14 @@
<Compile Include="Converters\IsEqualConverter.cs" />
<Compile Include="Converters\IsEqualToVisibilityConverter.cs" />
<Compile Include="Converters\IsNotConverter.cs" />
+ <Compile Include="Converters\IsNullToVisibilityInverseConverter.cs" />
<Compile Include="Converters\IsNullToVisibilityConverter.cs" />
<Compile Include="Converters\IsSegmentGradientConverter.cs" />
<Compile Include="Converters\IsSegmentGradientToVisibilityConverter.cs" />
<Compile Include="Converters\IsToStringEqualToVisibilityConverter.cs" />
<Compile Include="Converters\LastItemInContainerToBooleanConverter.cs" />
<Compile Include="Converters\MathOperatorConverter.cs" />
+ <Compile Include="Converters\NullObjectToBooleanInverseConverter.cs" />
<Compile Include="Converters\NumberToFileSizeConverter.cs" />
<Compile Include="Converters\ObjectToObjectTypeConverter.cs" />
<Compile Include="Converters\ObservableCollectionToViewSourceConverter.cs" />
@@ -262,7 +264,7 @@
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<ProjectExtensions>
<VisualStudio>
- <UserProperties BuildVersion_StartDate="2000/1/1" BuildVersion_UseGlobalSettings="False" BuildVersion_BuildVersioningStyle="None.None.Increment.TimeStamp" BuildVersion_UpdateAssemblyVersion="True" BuildVersion_AssemblyInfoFilename="Properties\AssemblyInfo.cs" />
+ <UserProperties BuildVersion_AssemblyInfoFilename="Properties\AssemblyInfo.cs" BuildVersion_UpdateAssemblyVersion="True" BuildVersion_BuildVersioningStyle="None.None.Increment.TimeStamp" BuildVersion_UseGlobalSettings="False" BuildVersion_StartDate="2000/1/1" />
</VisualStudio>
</ProjectExtensions>
</Project> \ No newline at end of file