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 Console | |
{ | |
class Program | |
{ | |
static void Main(string[] args) | |
{ | |
dynamic context = null; | |
Action<object> Action = (x => { return; }); |
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; | |
using System.Linq; | |
namespace Konard.Helpers | |
{ | |
public static class StringHelpers | |
{ | |
// TODO: Исправить | |
//string randomString = StringHelpers.GenerateRandomUTF8String(100, UnicodeCategory.CurrencySymbol, UnicodeCategory.OtherSymbol); |
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.Collections.Generic; | |
using System.IO; | |
using System.Linq; | |
using System.Text; | |
namespace Konard.Helpers | |
{ | |
public class Log : IDisposable | |
{ |
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 Konard.Helpers | |
{ | |
public static class RandomExtensions | |
{ | |
public static string NextString(this Random rnd, int length) | |
{ | |
if (length <= 0) | |
return String.Empty; |
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.Diagnostics; | |
namespace Konard.Helpers | |
{ | |
public static class ProcessExtensions | |
{ | |
static public void AllowDirectControlThroughParentProcess(this Process childProcess) | |
{ | |
childProcess.StartInfo.UseShellExecute = false; |
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.Runtime.InteropServices; | |
namespace Konard.Helpers | |
{ | |
public static class ByteArrayExtensions | |
{ | |
public static string ToRawString(this byte[] bytes) | |
{ | |
if (bytes.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; | |
using System.Threading; | |
namespace Konard.Helpers | |
{ | |
public static class ThreadHelpers | |
{ | |
public const int BarrierDefaultValue = int.MinValue; | |
public static void InitializeThreadBarrier(ref int barrier) |
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.Runtime.InteropServices; | |
namespace Konard.Helpers | |
{ | |
public static class ByteArrayHelpers | |
{ | |
public static byte[] GetBytes<T>(T obj) | |
where T : struct | |
{ |
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 Konard.Helpers | |
{ | |
public struct Range<T> : IComparable<Range<T>>, IEquatable<Range<T>> | |
where T : IComparable<T>, IEquatable<T> | |
{ | |
/// <summary> | |
/// Minimum value of the range | |
/// </summary> |
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.Text; | |
namespace Konard.Helpers | |
{ | |
public static class ConsoleHelpers | |
{ | |
public static string ExtractOptionParameter(string[] args, string optionName, bool parameterIsMandatory) | |
{ | |
int optionIndex = Array.IndexOf(args, "-" + optionName); |
OlderNewer