This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// <summary> | |
/// Uses the local list of accounts and returns an XML formatted string representing the list | |
/// </summary> | |
/// <returns>XML formatted list of accounts</returns> | |
public static string SerializeAccountListToXml() | |
{ | |
XmlSerializer xmlizer = new XmlSerializer(typeof(List<Account>)); | |
StringWriter writer = new StringWriter(); | |
xmlizer.Serialize(writer, AccountList); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 在用户完成更改并调用CompleteUpdatesAsync之前,阻止对文件的更新 | |
// Before User finished the file Update and call the CompleteUpdatesAsync,it can prevent other updates the file. | |
CachedFileManager.DeferUpdates(storageFile); | |
//当完成更改时,其他应用程序才可以对该文件进行更改。 | |
// When the update is complete,the other can update the file | |
FileUpdateStatus status = await CachedFileManager.CompleteUpdatesAsync(storageFile); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static class ImageStorage | |
{ | |
/// <summary> | |
/// 获取图片 | |
/// 如果本地存在,就获取本地 | |
/// 如果本地不存在,获取网络 | |
/// </summary> | |
/// <param name="uri"></param> | |
/// <returns></returns> | |
public static async Task<BitmapImage> GetImage(Uri uri) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static string Md5(string str) | |
{ | |
HashAlgorithmProvider hashAlgorithm = | |
HashAlgorithmProvider.OpenAlgorithm(HashAlgorithmNames.Md5); | |
CryptographicHash cryptographic = hashAlgorithm.CreateHash(); | |
IBuffer buffer = CryptographicBuffer.ConvertStringToBinary(str, BinaryStringEncoding.Utf8); | |
cryptographic.Append(buffer); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// <summary> | |
/// 判断私有ip | |
/// </summary> | |
/// <param name="myIPAddress"></param> | |
/// <returns></returns> | |
public static bool IsPrivateIP(IPAddress myIPAddress) | |
{ | |
if (IPAddress.IsLoopback(myIPAddress)) | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
await CoreApplication.MainView.CoreWindow.Dispatcher.RunAsync(CoreDispatcherPriority.Normal, | |
() => | |
{ | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static class PasswordBoxHelper | |
{ | |
public static readonly DependencyProperty PasswordProperty = DependencyProperty.RegisterAttached( | |
"Password", typeof(string), typeof(PasswordBoxHelper), new PropertyMetadata(default(string),OnPasswordPropertyChanged)); | |
public static void SetPassword(DependencyObject element, string value) | |
{ | |
element.SetValue(PasswordProperty, value); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// <summary> | |
/// 获取csproj 所有文件,并获取文件生成选项 | |
/// Get all the files in the *.csproj | |
/// </summary> | |
/// <param name="doc">csproj 文件的XDocument</param> | |
/// <returns> | |
/// 文件路径和文件生成选项列表 | |
/// The List that include the file path and it's compile options | |
/// </returns> | |
public static List<PrjFile> GetPrjFile(XDocument doc) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static class WildcardRegexString | |
{ | |
/// <summary> | |
/// 通配符转正则 | |
/// </summary> | |
/// <param name="wildcardStr"></param> | |
/// <returns></returns> | |
public static string GetWildcardRegexString(string wildcardStr) | |
{ | |
Regex replace = //new Regex("[.$^{\\[(|)*+?\\\\]"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.Diagnostics; | |
using System.IO; | |
using System.Linq; | |
using System.Reflection; | |
namespace lindexi.wpf.Solution | |
{ | |
public class Solution |
OlderNewer