This file contains 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.Data; | |
namespace Helpers | |
{ | |
public static class DbCommandExtensions | |
{ | |
public static void AddParameter(this IDbCommand cmd, string parameterName) | |
{ | |
IDbDataParameter parameter = cmd.CreateParameter(); | |
parameter.ParameterName = parameterName; |
This file contains 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; | |
namespace Helpers | |
{ | |
public static class RuntimeHelpers | |
{ | |
public static bool IsRunningOnMono() | |
{ | |
return Type.GetType("Mono.Runtime") != null; | |
} |
This file contains 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.ServiceProcess; | |
using System.Threading; | |
namespace Helpers | |
{ | |
public static class ServiceControllerExtensions | |
{ | |
public static void StopAndWait(this ServiceController service) | |
{ | |
if (service.Status != ServiceControllerStatus.Stopped) |
This file contains 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.Globalization; | |
namespace Helpers | |
{ | |
public static class StringExtensions | |
{ | |
public static bool IsInt16(this string s) | |
{ | |
Int16 result; return Int16.TryParse(s, out result); |
This file contains 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.Threading; | |
namespace Helpers | |
{ | |
public static class ThreadArrayExtensions | |
{ | |
public static Thread[] StartAll(this Thread[] threads, params object[] values) | |
{ | |
if (values.Length == 0) |
This file contains 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.Threading; | |
namespace Helpers | |
{ | |
public static class ThreadHelpers | |
{ | |
public static Thread[] CreateThreads(ThreadStart action, int amount, int maxStackSize) | |
{ | |
Thread[] threads = new Thread[amount]; | |
for (int i = 0; i < threads.Length; i++) |
This file contains 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
<Style TargetType="{x:Type RadioButton}"> | |
<Setter Property="FocusVisualStyle"> | |
<Setter.Value> | |
<Style> | |
<Setter Property="Control.Template"> | |
<Setter.Value> | |
<ControlTemplate> | |
<Rectangle Margin="2" SnapsToDevicePixels="True" Stroke="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}" StrokeThickness="1" StrokeDashArray="1 2"/> | |
</ControlTemplate> | |
</Setter.Value> |
This file contains 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
Resharper suggestions | |
1 | |
.Where(x => x.ErrorContent is string).Select(x => (string)x.ErrorContent) | |
заменять на | |
.Select(x => x.ErrorContent).OfType<string>() | |
2 |
This file contains 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
xcopy $(SolutionDir)lib\CefSharp $(TargetDir) /s /y |
This file contains 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
void window_KeyDown(object sender, KeyEventArgs e) | |
{ | |
if (e.Key == Key.F11) | |
{ | |
Window.ResizeMode = ResizeMode.NoResize; | |
Window.WindowState = WindowState.Normal; | |
Window.WindowStyle = WindowStyle.None; | |
Window.Width = System.Windows.Forms.Screen.PrimaryScreen.Bounds.Width; |