1. Fix resultlistbox visibility
2. Fix #565
3. Remove unused convertor
This commit is contained in:
bao-qian
2016-04-24 17:06:23 +01:00
parent c2de80f532
commit 07fe141f8a
7 changed files with 7 additions and 110 deletions

View File

@@ -1,40 +0,0 @@
using System;
using System.Globalization;
using Wox.Core.UserSettings;
namespace Wox.Converters
{
public class OpacityModeConverter : ConvertorBase<OpacityModeConverter>
{
public override object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
if (!(value is OpacityMode)) return value.ToString();
var mode = (OpacityMode) value;
switch (mode)
{
case OpacityMode.Normal:
return "Normal Window";
case OpacityMode.LayeredWindow:
{
if (Environment.OSVersion.Version.Major < 5)
return "Layered Window (not supported by your Windows)";
if (Environment.OSVersion.Version.Major == 5)
return "Layered Window (not recommended on your Windows)";
return "Layered Window";
}
case OpacityMode.DWM:
{
if (Environment.OSVersion.Version.Major < 6)
return "DWM-Enabled Window (not supported by your Windows)";
return "DWM-Enabled Window";
}
}
return value.ToString();
}
public override object ProvideValue(IServiceProvider serviceProvider)
{
return this;
}
}
}

View File

@@ -1,18 +0,0 @@
using System;
using System.Globalization;
namespace Wox.Converters
{
public class StringEmptyConverter : ConvertorBase<StringEmptyConverter>
{
public override object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
return string.IsNullOrEmpty((string)value) ? parameter : value;
}
public override object ProvideValue(IServiceProvider serviceProvider)
{
return this;
}
}
}

View File

@@ -1,45 +0,0 @@
using System;
using System.Collections.Generic;
using System.Globalization;
using System.Windows;
using Wox.Plugin;
namespace Wox.Converters
{
public class StringNullOrEmptyToVisibilityConverter : ConvertorBase<StringNullOrEmptyToVisibilityConverter>
{
public override object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
return string.IsNullOrEmpty(value as string) ? Visibility.Collapsed : Visibility.Visible;
}
public override object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
{
return null;
}
public override object ProvideValue(IServiceProvider serviceProvider)
{
return this;
}
}
public class ContextMenuEmptyToWidthConverter : ConvertorBase<ContextMenuEmptyToWidthConverter>
{
public override object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
List<Result> results = value as List<Result>;
return results == null || results.Count == 0 ? 0 : 17;
}
public override object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
{
return null;
}
public override object ProvideValue(IServiceProvider serviceProvider)
{
return this;
}
}
}