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
private static int TryParseProject(DTE dte, List<string> project) | |
{ | |
int noLoadProjectCount = 0; | |
foreach (var temp in dte.Solution.Projects) | |
{ | |
try | |
{ | |
if (temp is Project) | |
{ |
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
private static (string output, int exitCode) Control(string str) | |
{ | |
Process p = new Process(); | |
p.StartInfo.FileName = "cmd.exe"; | |
p.StartInfo.UseShellExecute = false; //是否使用操作系统shell启动 | |
p.StartInfo.RedirectStandardInput = true; //接受来自调用程序的输入信息 | |
p.StartInfo.RedirectStandardOutput = true; //由调用程序获取输出信息 | |
p.StartInfo.RedirectStandardError = true; //重定向标准错误输出 | |
p.StartInfo.CreateNoWindow = true; //不显示程序窗口 | |
p.StartInfo.StandardOutputEncoding = Encoding.UTF8;//Encoding.GetEncoding("GBK");//乱码 |
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 class GitControl | |
{ | |
public GitControl(string fileDirectory) | |
{ | |
FileDirectory = fileDirectory; | |
} | |
/// <summary> | |
/// git的文件夹 | |
/// </summary> |
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 class UnixConvert : JsonConverter | |
{ | |
public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer) | |
{ | |
var time = ToUnixTimestamp((DateTime) value); | |
writer.WriteValue(time); | |
} | |
public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer) | |
{ |
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.Diagnostics.CodeAnalysis; | |
using Windows.Foundation; | |
using Windows.UI.Xaml; | |
using Windows.UI.Xaml.Controls; | |
using Windows.UI.Xaml.Media; | |
namespace Common | |
{ | |
/// <summary> |
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> | |
/// 使用 WinForm 播放 Gif | |
/// </summary> | |
/// <example> | |
/// xaml: | |
/// <local:GifImageControl x:Name="Image" Path="lindexi.gif"></local:GifImageControl> | |
/// cs: | |
/// var image = new GifImageControl("E:\\lindexi.gif"); | |
/// Grid.Children.Add(image); | |
/// </example> |
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
class Bbcode2md | |
{ | |
/// <summary> | |
/// To convert bbcode to markdown | |
/// </summary> | |
/// <remarks>[JonDum/BBCode-To-Markdown-Converter](https://github.com/JonDum/BBCode-To-Markdown-Converter )</remarks> | |
/// <param name="str"></param> | |
/// <returns></returns> | |
public static string BbcodetoMd(string str) |
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 MakeValidFileName(string text, string replacement = "_") | |
{ | |
StringBuilder str=new StringBuilder(); | |
var invalidFileNameChars = System.IO.Path.GetInvalidFileNameChars(); | |
foreach (var c in text) | |
{ | |
if (invalidFileNameChars.Contains(c)) | |
{ | |
str.Append(replacement??""); | |
} |
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> | |
/// 扩展的窗口风格 | |
/// </summary> | |
/// 代码:[Extended Window Styles (Windows)](https://msdn.microsoft.com/en-us/library/windows/desktop/ff700543(v=vs.85).aspx ) | |
/// code from [Extended Window Styles (Windows)](https://msdn.microsoft.com/en-us/library/windows/desktop/ff700543(v=vs.85).aspx ) | |
[Flags] | |
public enum ExtendedWindowStyles : long | |
{ | |
/// <summary> | |
/// The window accepts drag-drop files |
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 SolidColorBrush GetSolidColorBrush(string hex) | |
{ | |
hex = hex.Replace("#", string.Empty); | |
//#FFDFD991 | |
//#DFD991 | |
//#FD92 | |
//#DAC | |
bool existAlpha = hex.Length == 8 || hex.Length == 4; |