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
public class DomainController | |
{ | |
public void CreateDomain() | |
{ | |
string pathToDlls = Path.GetDirectoryName(new Uri(Assembly.GetExecutingAssembly().CodeBase).LocalPath); | |
Trace.WriteLine(AppDomain.CurrentDomain.FriendlyName); | |
AppDomainSetup domainSetup = new AppDomainSetup { }; | |
domainSetup.ApplicationBase = pathToDlls; | |
this.testDomain = AppDomain.CreateDomain(Guid.NewGuid().ToString(), null, domainSetup, this.GetPermissionSet()); |
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
this.testDomain.Load(Assembly.GetExecutingAssembly().GetName()); | |
var instance = (CompilerService)this.testDomain.CreateInstanceAndUnwrap( | |
typeof(CompilerService).Assembly.FullName, | |
typeof(CompilerService).FullName); | |
return instance.CompileAndRunTestsInOtherDomain(args); |
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
public class LogInjectionModule : Module { | |
protected override void AttachToComponentRegistration(IComponentRegistry registry, | |
IComponentRegistration registration) { | |
registration.Preparing += OnComponentPreparing; | |
var implementationType = registration.Activator.LimitType; | |
var injectors = BuildInjectors(implementationType).ToArray(); | |
if (!injectors.Any()) { | |
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
public class DynamicParserJson | |
{ | |
public static object ConvertJTokenToObject(JToken token) | |
{ | |
if (token is JValue) | |
{ | |
return ((JValue)token).Value; | |
} | |
if (token is JObject) | |
{ |
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
public class Program | |
{ | |
static void Main(string[] args) | |
{ | |
Bootstrapper.Configure(); | |
var container = Bootstrapper.Container; | |
var obj = container.Resolve<Program>(); | |
var newString = obj.UseMe(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
public class DeviceMonitorSignaling | |
{ | |
readonly object _lockObj = new object(); | |
EventWaitHandle searchingHandle; | |
EventWaitHandle monitoringHandle; | |
bool _running; | |
bool _monitoring; | |
volatile Device device; |
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.Linq; | |
using System.Text; | |
using System.Threading.Tasks; | |
using Caliburn.Micro; | |
using SimpleInjector; | |
using System.Reflection; | |
using StackQuestionsClient.ViewModels; | |
using StackQuestionsClient.utilities; |
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 NUnit.Framework; | |
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Text; | |
using System.Threading.Tasks; | |
using TestForEverything.Converters; | |
namespace TestForEverything | |
{ |
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.ComponentModel; | |
namespace TestForEverything | |
{ | |
/// <summary> | |
/// Extension methos of string providing conversions to primitve types | |
/// </summary> | |
public static class ConverterExtensions | |
{ |
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
class Program | |
{ | |
private static readonly IEnumerable<string> DefaultNamespaces = | |
new[] | |
{ | |
"System", | |
"System.IO", | |
"System.Net", | |
"System.Linq", | |
"System.Text", |
OlderNewer