use sdk project
This commit is contained in:
1 parent
be21771a17
commit
5861666e1b
36 files changed
+759
-2228
No files matched your search
File diff suppressed because it is too large.
Load diff
@@ -3,7 +3,7 @@ using System.Diagnostics;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.IO;
|
||||
using System.Net;
|
||||
#if !netle40
|
||||
#if !NET40
|
||||
using System.Runtime;
|
||||
#endif
|
||||
using System.Security.Authentication;
|
||||
@@ -26,7 +26,7 @@ namespace HandyControlDemo
|
||||
|
||||
public App()
|
||||
{
|
||||
#if !netle40
|
||||
#if !NET40
|
||||
var cachePath = $"{AppDomain.CurrentDomain.BaseDirectory}Cache";
|
||||
if (!Directory.Exists(cachePath))
|
||||
{
|
||||
|
||||
@@ -12,7 +12,7 @@ namespace HandyControlDemo.Data
|
||||
public string Title
|
||||
{
|
||||
get => _title;
|
||||
#if netle40
|
||||
#if NET40
|
||||
set => Set(nameof(Title), ref _title, value);
|
||||
#else
|
||||
set => Set(ref _title, value);
|
||||
@@ -24,7 +24,7 @@ namespace HandyControlDemo.Data
|
||||
public int SelectedIndex
|
||||
{
|
||||
get => _selectedIndex;
|
||||
#if netle40
|
||||
#if NET40
|
||||
set => Set(nameof(SelectedIndex), ref _selectedIndex, value);
|
||||
#else
|
||||
set => Set(ref _selectedIndex, value);
|
||||
|
||||
@@ -43,7 +43,7 @@ namespace HandyControlDemo.ViewModel
|
||||
public string ChatString
|
||||
{
|
||||
get => _chatString;
|
||||
#if netle40
|
||||
#if NET40
|
||||
set => Set(nameof(ChatString), ref _chatString, value);
|
||||
#else
|
||||
set => Set(ref _chatString, value);
|
||||
|
||||
@@ -14,7 +14,7 @@ namespace HandyControlDemo.ViewModel
|
||||
public string Result
|
||||
{
|
||||
get => _result;
|
||||
#if netle40
|
||||
#if NET40
|
||||
set => Set(nameof(Result), ref _result, value);
|
||||
#else
|
||||
set => Set(ref _result, value);
|
||||
@@ -26,7 +26,7 @@ namespace HandyControlDemo.ViewModel
|
||||
public string Message
|
||||
{
|
||||
get => _message;
|
||||
#if netle40
|
||||
#if NET40
|
||||
set => Set(nameof(Message), ref _message, value);
|
||||
#else
|
||||
set => Set(ref _message, value);
|
||||
|
||||
@@ -11,7 +11,7 @@ namespace HandyControlDemo.ViewModel
|
||||
public int Count
|
||||
{
|
||||
get => _count;
|
||||
#if netle40
|
||||
#if NET40
|
||||
set => Set(nameof(Count), ref _count, value);
|
||||
#else
|
||||
set => Set(ref _count, value);
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
using System.Windows;
|
||||
using GalaSoft.MvvmLight;
|
||||
using GalaSoft.MvvmLight.Command;
|
||||
#if !netle40
|
||||
#if !NET40
|
||||
using System.Threading.Tasks;
|
||||
#endif
|
||||
using HandyControl.Controls;
|
||||
@@ -20,7 +20,7 @@ namespace HandyControlDemo.ViewModel
|
||||
public string DialogResult
|
||||
{
|
||||
get => _dialogResult;
|
||||
#if netle40
|
||||
#if NET40
|
||||
set => Set(nameof(DialogResult), ref _dialogResult, value);
|
||||
#else
|
||||
set => Set(ref _dialogResult, value);
|
||||
@@ -42,7 +42,7 @@ namespace HandyControlDemo.ViewModel
|
||||
}
|
||||
}
|
||||
|
||||
#if netle40
|
||||
#if NET40
|
||||
public RelayCommand<bool> ShowInteractiveDialogCmd => new Lazy<RelayCommand<bool>>(() =>
|
||||
new RelayCommand<bool>(ShowInteractiveDialog)).Value;
|
||||
|
||||
|
||||
@@ -17,7 +17,7 @@ namespace HandyControlDemo.ViewModel
|
||||
public ShowAnimation ShowAnimation
|
||||
{
|
||||
get => _showAnimation;
|
||||
#if netle40
|
||||
#if NET40
|
||||
set => Set(nameof(ShowAnimation) ,ref _showAnimation, value);
|
||||
#else
|
||||
set => Set(ref _showAnimation, value);
|
||||
@@ -29,7 +29,7 @@ namespace HandyControlDemo.ViewModel
|
||||
public bool StaysOpen
|
||||
{
|
||||
get => _staysOpen;
|
||||
#if netle40
|
||||
#if NET40
|
||||
set => Set(nameof(StaysOpen) ,ref _staysOpen, value);
|
||||
#else
|
||||
set => Set(ref _staysOpen, value);
|
||||
|
||||
@@ -18,7 +18,7 @@ namespace HandyControlDemo.ViewModel
|
||||
public string Content
|
||||
{
|
||||
get => _content;
|
||||
#if netle40
|
||||
#if NET40
|
||||
set => Set(nameof(Content), ref _content, value);
|
||||
#else
|
||||
set => Set(ref _content, value);
|
||||
@@ -32,7 +32,7 @@ namespace HandyControlDemo.ViewModel
|
||||
get => _contextMenuIsShow;
|
||||
set
|
||||
{
|
||||
#if netle40
|
||||
#if NET40
|
||||
Set(nameof(ContextMenuIsShow), ref _contextMenuIsShow, value);
|
||||
#else
|
||||
Set(ref _contextMenuIsShow, value);
|
||||
@@ -52,7 +52,7 @@ namespace HandyControlDemo.ViewModel
|
||||
public bool ContextMenuIsBlink
|
||||
{
|
||||
get => _contextMenuIsBlink;
|
||||
#if netle40
|
||||
#if NET40
|
||||
set => Set(nameof(ContextMenuIsBlink), ref _contextMenuIsBlink, value);
|
||||
#else
|
||||
set => Set(ref _contextMenuIsBlink, value);
|
||||
@@ -66,7 +66,7 @@ namespace HandyControlDemo.ViewModel
|
||||
get => _contextContentIsShow;
|
||||
set
|
||||
{
|
||||
#if netle40
|
||||
#if NET40
|
||||
Set(nameof(ContextContentIsShow), ref _contextContentIsShow, value);
|
||||
#else
|
||||
Set(ref _contextContentIsShow, value);
|
||||
@@ -86,7 +86,7 @@ namespace HandyControlDemo.ViewModel
|
||||
public bool ContextContentIsBlink
|
||||
{
|
||||
get => _contextContentIsBlink;
|
||||
#if netle40
|
||||
#if NET40
|
||||
set => Set(nameof(ContextContentIsBlink), ref _contextContentIsBlink, value);
|
||||
#else
|
||||
set => Set(ref _contextContentIsBlink, value);
|
||||
|
||||
@@ -26,7 +26,7 @@ namespace HandyControlDemo.ViewModel
|
||||
public int PageIndex
|
||||
{
|
||||
get => _pageIndex;
|
||||
#if netle40
|
||||
#if NET40
|
||||
set => Set(nameof(PageIndex), ref _pageIndex, value);
|
||||
#else
|
||||
set => Set(ref _pageIndex, value);
|
||||
|
||||
@@ -17,7 +17,7 @@ namespace HandyControlDemo.ViewModel
|
||||
public int StepIndex
|
||||
{
|
||||
get => _stepIndex;
|
||||
#if netle40
|
||||
#if NET40
|
||||
set => Set(nameof(StepIndex), ref _stepIndex, value);
|
||||
#else
|
||||
set => Set(ref _stepIndex, value);
|
||||
|
||||
@@ -16,7 +16,7 @@ namespace HandyControlDemo.ViewModel
|
||||
public IList<T> DataList
|
||||
{
|
||||
get => _dataList;
|
||||
#if netle40
|
||||
#if NET40
|
||||
set => Set(nameof(DataList), ref _dataList, value);
|
||||
#else
|
||||
set => Set(ref _dataList, value);
|
||||
|
||||
@@ -9,7 +9,7 @@ namespace HandyControlDemo.ViewModel
|
||||
{
|
||||
public ItemsDisplayViewModel(Func<List<AvatarModel>> getDatAction)
|
||||
{
|
||||
#if netle40
|
||||
#if NET40
|
||||
Task.Factory.StartNew(() => DataList = getDatAction?.Invoke());
|
||||
#else
|
||||
Task.Run(() => DataList = getDatAction?.Invoke());
|
||||
|
||||
@@ -59,7 +59,7 @@ namespace HandyControlDemo.ViewModel
|
||||
|
||||
DemoInfoCollection = new ObservableCollection<DemoInfoModel>();
|
||||
|
||||
#if netle40
|
||||
#if NET40
|
||||
Task.Factory.StartNew(() =>
|
||||
{
|
||||
DataList = dataService.GetDemoDataList();
|
||||
@@ -101,7 +101,7 @@ namespace HandyControlDemo.ViewModel
|
||||
public object SubContent
|
||||
{
|
||||
get => _subContent;
|
||||
#if netle40
|
||||
#if NET40
|
||||
set => Set(nameof(SubContent), ref _subContent, value);
|
||||
#else
|
||||
set => Set(ref _subContent, value);
|
||||
@@ -114,7 +114,7 @@ namespace HandyControlDemo.ViewModel
|
||||
public object ContentTitle
|
||||
{
|
||||
get => _contentTitle;
|
||||
#if netle40
|
||||
#if NET40
|
||||
set => Set(nameof(ContentTitle), ref _contentTitle, value);
|
||||
#else
|
||||
set => Set(ref _contentTitle, value);
|
||||
|
||||
@@ -14,7 +14,22 @@ namespace HandyControlDemo.Window
|
||||
|
||||
var versionInfo = FileVersionInfo.GetVersionInfo(Assembly.GetEntryAssembly().Location);
|
||||
CopyRight = versionInfo.LegalCopyright;
|
||||
Version = $"v {versionInfo.FileVersion}";
|
||||
#if NET40
|
||||
var netVersion = "NET 40";
|
||||
#elif NET45
|
||||
var netVersion = "NET 45";
|
||||
#elif NET462
|
||||
var netVersion = "NET 462";
|
||||
#elif NET47
|
||||
var netVersion = "NET 47";
|
||||
#elif NET48
|
||||
var netVersion = "NET 48";
|
||||
#elif NETCOREAPP3_0
|
||||
var netVersion = "CORE 30";
|
||||
#elif NETCOREAPP3_1
|
||||
var netVersion = "CORE 31";
|
||||
#endif
|
||||
Version = $"v {versionInfo.FileVersion} {netVersion}";
|
||||
}
|
||||
|
||||
public static readonly DependencyProperty CopyRightProperty = DependencyProperty.Register(
|
||||
|
||||
@@ -348,7 +348,7 @@ namespace HandyControl.Controls
|
||||
|
||||
GrowlWindow.Show(true);
|
||||
|
||||
#if netle40
|
||||
#if NET40
|
||||
Application.Current.Dispatcher?.Invoke(new Action(() =>
|
||||
{
|
||||
var ctl = new Growl
|
||||
@@ -397,7 +397,7 @@ namespace HandyControl.Controls
|
||||
/// <param name="growlInfo"></param>
|
||||
private static void Show(GrowlInfo growlInfo)
|
||||
{
|
||||
#if netle40
|
||||
#if NET40
|
||||
Application.Current.Dispatcher?.Invoke(new Action(() =>
|
||||
{
|
||||
var ctl = new Growl
|
||||
|
||||
@@ -5,7 +5,7 @@ using System.Windows.Controls;
|
||||
using System.Windows.Controls.Primitives;
|
||||
using System.Windows.Data;
|
||||
using System.Windows.Input;
|
||||
#if netle40
|
||||
#if NET40
|
||||
using System.Windows.Threading;
|
||||
#endif
|
||||
using HandyControl.Data;
|
||||
@@ -18,7 +18,7 @@ namespace HandyControl.Controls
|
||||
[TemplatePart(Name = AutoPopupAutoComplete, Type = typeof(Popup))]
|
||||
public class ComboBox : System.Windows.Controls.ComboBox, IDataInput
|
||||
{
|
||||
#if netle40
|
||||
#if NET40
|
||||
|
||||
private string _searchText;
|
||||
|
||||
@@ -71,7 +71,7 @@ namespace HandyControl.Controls
|
||||
|
||||
if (AutoComplete)
|
||||
{
|
||||
#if netle40
|
||||
#if NET40
|
||||
_autoCompleteTimer = new DispatcherTimer
|
||||
{
|
||||
Interval = TimeSpan.FromMilliseconds(500)
|
||||
@@ -84,7 +84,7 @@ namespace HandyControl.Controls
|
||||
{
|
||||
UpdateSourceTrigger = UpdateSourceTrigger.PropertyChanged,
|
||||
Mode = BindingMode.OneWayToSource,
|
||||
#if !netle40
|
||||
#if !NET40
|
||||
Delay = 500,
|
||||
#endif
|
||||
Source = this
|
||||
@@ -96,7 +96,7 @@ namespace HandyControl.Controls
|
||||
}
|
||||
}
|
||||
|
||||
#if netle40
|
||||
#if NET40
|
||||
|
||||
private void AutoCompleteTimer_Tick(object sender, EventArgs e)
|
||||
{
|
||||
@@ -119,7 +119,7 @@ namespace HandyControl.Controls
|
||||
}
|
||||
}
|
||||
|
||||
#if !netle40
|
||||
#if !NET40
|
||||
protected override void OnDropDownClosed(EventArgs e)
|
||||
{
|
||||
base.OnDropDownClosed(e);
|
||||
@@ -142,7 +142,7 @@ namespace HandyControl.Controls
|
||||
_isAutoCompleteAction = false;
|
||||
base.OnSelectionChanged(e);
|
||||
VerifyData();
|
||||
#if netle40
|
||||
#if NET40
|
||||
_isAutoCompleteAction = true;
|
||||
#endif
|
||||
}
|
||||
@@ -312,7 +312,7 @@ namespace HandyControl.Controls
|
||||
var ctl = (ComboBox)d;
|
||||
if (ctl._isAutoCompleteAction)
|
||||
{
|
||||
#if netle40
|
||||
#if NET40
|
||||
ctl._searchText = e.NewValue as string;
|
||||
ctl._autoCompleteTimer.Stop();
|
||||
ctl._autoCompleteTimer.Start();
|
||||
|
||||
@@ -201,7 +201,7 @@ namespace HandyControl.Controls
|
||||
return;
|
||||
}
|
||||
|
||||
#if netle45
|
||||
#if NET40 || NET45
|
||||
_formattedText = new FormattedText(
|
||||
Text,
|
||||
CultureInfo.CurrentUICulture,
|
||||
|
||||
@@ -129,7 +129,7 @@ namespace HandyControl.Controls
|
||||
return;
|
||||
}
|
||||
|
||||
#if netle45
|
||||
#if NET40 || NET45
|
||||
_formattedText = new FormattedText(
|
||||
Text,
|
||||
CultureInfo.CurrentUICulture,
|
||||
|
||||
@@ -8,7 +8,7 @@ using HandyControl.Data;
|
||||
using HandyControl.Tools;
|
||||
using HandyControl.Tools.Extension;
|
||||
using HandyControl.Tools.Interop;
|
||||
#if netle40
|
||||
#if NET40
|
||||
using Microsoft.Windows.Shell;
|
||||
#else
|
||||
using System.Windows.Shell;
|
||||
@@ -104,7 +104,7 @@ namespace HandyControl.Controls
|
||||
|
||||
public Window()
|
||||
{
|
||||
#if netle40
|
||||
#if NET40
|
||||
var chrome = new WindowChrome
|
||||
{
|
||||
CornerRadius = new CornerRadius(),
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
using System;
|
||||
using System.ComponentModel;
|
||||
using System.Globalization;
|
||||
#if !netle40
|
||||
#if !NET40
|
||||
using System.Runtime.CompilerServices;
|
||||
#endif
|
||||
using System.Windows;
|
||||
@@ -76,7 +76,7 @@ namespace HandyControl.Tools
|
||||
|
||||
public event PropertyChangedEventHandler PropertyChanged;
|
||||
|
||||
#if netle40
|
||||
#if NET40
|
||||
protected virtual void OnPropertyChanged(string propertyName)
|
||||
{
|
||||
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
|
||||
|
||||
@@ -134,7 +134,7 @@ namespace HandyControl.Tools
|
||||
{
|
||||
InteropValues.APPBARDATA appBarData = default;
|
||||
var autoHide = InteropMethods.SHAppBarMessage(4, ref appBarData) != 0;
|
||||
#if netle40
|
||||
#if NET40
|
||||
return WindowResizeBorderThickness.Add(new Thickness(autoHide ? -8 : 0));
|
||||
#elif Core
|
||||
var hdc = InteropMethods.GetDC(IntPtr.Zero);
|
||||
|
||||
Reference in new issue
Block a user