Remove reference to deleted SecurityConverter
This commit is contained in:
1 parent
8761e7420a
commit
225134d4e4
5 files changed
-178
No files matched your search
@@ -1,86 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Reflection;
|
||||
|
||||
namespace bts.api
|
||||
{
|
||||
public static class ReflectionExtensions
|
||||
{
|
||||
public static void set_value(this MemberInfo info, object target, object value)
|
||||
{
|
||||
if(info is FieldInfo)
|
||||
((FieldInfo)info).SetValue(target, value);
|
||||
else if(info is PropertyInfo)
|
||||
((PropertyInfo)info).SetValue(target, value);
|
||||
}
|
||||
|
||||
public static object get_value(this MemberInfo info, object target)
|
||||
{
|
||||
if(info is FieldInfo)
|
||||
return ((FieldInfo)info).GetValue(target);
|
||||
else if(info is PropertyInfo)
|
||||
return ((PropertyInfo)info).GetValue(target);
|
||||
else
|
||||
return null;
|
||||
}
|
||||
|
||||
public static MemberInfo[] get_fields_or_properties(this Type t)
|
||||
{
|
||||
MemberInfo[] mi = t.GetMembers(BindingFlags.Instance | BindingFlags.Public
|
||||
| BindingFlags.NonPublic).Where(m => (m.MemberType == MemberTypes.Field || m.MemberType == MemberTypes.Property)).ToArray();
|
||||
return mi;
|
||||
}
|
||||
|
||||
public static MemberInfo[] get_fields(this Type t)
|
||||
{
|
||||
MemberInfo[] mi = t.GetMembers(BindingFlags.Instance | BindingFlags.Public
|
||||
| BindingFlags.NonPublic).Where(m => (m.MemberType == MemberTypes.Field)).ToArray();
|
||||
return mi;
|
||||
}
|
||||
|
||||
public static MemberInfo[] get_properties(this Type t)
|
||||
{
|
||||
MemberInfo[] mi = t.GetMembers(BindingFlags.Instance | BindingFlags.Public
|
||||
| BindingFlags.NonPublic).Where(m => (m.MemberType == MemberTypes.Property)).ToArray();
|
||||
return mi;
|
||||
}
|
||||
|
||||
public static MemberInfo get_field_or_property(this Type t, string name)
|
||||
{
|
||||
MemberInfo[] mi = t.GetMembers(BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic)
|
||||
.Where(m => (m.MemberType == MemberTypes.Field || m.MemberType == MemberTypes.Property))
|
||||
.Where(m => (m.Name == name))
|
||||
.ToArray();
|
||||
if(mi != null && mi.Length > 0)
|
||||
return mi[0];
|
||||
else
|
||||
return null;
|
||||
}
|
||||
|
||||
public static MemberInfo[] search_field_or_property(this Type t, Func<MemberInfo, bool> criteria)
|
||||
{
|
||||
MemberInfo[] mi = t.GetMembers(BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic)
|
||||
.Where(m => (m.MemberType == MemberTypes.Field || m.MemberType == MemberTypes.Property))
|
||||
.Where(criteria)
|
||||
.ToArray();
|
||||
if(mi != null && mi.Length > 0)
|
||||
return mi;
|
||||
else
|
||||
return new MemberInfo[0];
|
||||
}
|
||||
|
||||
|
||||
public static Type member_type(this MemberInfo info)
|
||||
{
|
||||
if(info is FieldInfo)
|
||||
return ((FieldInfo)info).FieldType;
|
||||
else if(info is PropertyInfo)
|
||||
return ((PropertyInfo)info).PropertyType;
|
||||
else
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,12 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace mbts.user.settings
|
||||
{
|
||||
public class ExportsUserSettingsAttribute : Attribute
|
||||
{
|
||||
}
|
||||
}
|
||||
@@ -6,7 +6,6 @@ using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Reactive.Linq;
|
||||
using System.Reactive.Subjects;
|
||||
using static bts.api.SecurityConverter;
|
||||
|
||||
namespace mbts.spark
|
||||
{
|
||||
|
||||
@@ -1,12 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
namespace mbts.ui
|
||||
{
|
||||
public interface ITimer
|
||||
{
|
||||
event Action Tick;
|
||||
}
|
||||
}
|
||||
@@ -1,67 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Input;
|
||||
using System.Windows.Threading;
|
||||
|
||||
namespace mbts.ui
|
||||
{
|
||||
public interface IAsyncCommand : ICommand, IDisposable
|
||||
{
|
||||
event Action ExecutingBegin;
|
||||
event Action ExecutingEnd;
|
||||
}
|
||||
|
||||
public class AsyncCommand<T> : DelegateCommand<T>, IAsyncCommand
|
||||
{
|
||||
public AsyncCommand(Func<T, Task> get_task) : this(get_task, null) { }
|
||||
public AsyncCommand(Func<T, Task> get_task, Func<T, bool> can_execute) {
|
||||
_get_task = get_task;
|
||||
_can_execute = can_execute == null ? new Func<T, bool>(p => !_is_executing) : new Func<T, bool>(p => !_is_executing && can_execute(p));
|
||||
_execute = _execute_async;
|
||||
}
|
||||
|
||||
private readonly Func<T, Task> _get_task;
|
||||
|
||||
private bool _is_executing;
|
||||
private void _set_is_executing(bool is_executing) {
|
||||
_is_executing = is_executing;
|
||||
RaiseCanExecuteChanged();
|
||||
if (is_executing) {
|
||||
if (ExecutingEnd != null)
|
||||
ExecutingEnd();
|
||||
} else if (ExecutingBegin != null)
|
||||
ExecutingBegin();
|
||||
}
|
||||
|
||||
private IDisposable _dispose_task;
|
||||
private async void _execute_async(T parameter) {
|
||||
_set_is_executing(true);
|
||||
var task = _get_task(parameter);
|
||||
if (task != null) {
|
||||
if (task.Status == TaskStatus.Created)
|
||||
task.Start();
|
||||
await task;
|
||||
}
|
||||
_set_is_executing(false);
|
||||
}
|
||||
|
||||
public event Action ExecutingBegin, ExecutingEnd;
|
||||
|
||||
public void Dispose() {
|
||||
Disposable.dispose(ref _dispose_task);
|
||||
}
|
||||
}
|
||||
|
||||
public class AsyncCommand : AsyncCommand<object>
|
||||
{
|
||||
public AsyncCommand(Func<Task> get_task) : base(_ => get_task()) { }
|
||||
public AsyncCommand(Func<Task> get_task, Func<bool> can_execute) : base(_ => get_task(), _ => can_execute()) { }
|
||||
public AsyncCommand(Func<Task> get_task, Func<object, bool> can_execute) : base(_ => get_task(), can_execute) { }
|
||||
public AsyncCommand(Func<object, Task> get_task) : base(get_task, null) { }
|
||||
public AsyncCommand(Func<object, Task> get_task, Func<object, bool> can_execute) : base(get_task, can_execute) { }
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user