/// <summary> /// Init this instance. /// </summary> public void Init() { Console.Write("ClientTest.Init: "); if (Thread.VolatileRead(ref _init) != 0) Console.WriteLine("Already initialised"); else { Console.WriteLine("Initialising..."); Thread.VolatileWrite(ref _init, 1); Artefact.ArtefactTypes.AddRange(_artefactTypes); if (UseServiceHostAsync) { _serviceHostThread = ArtefactHost.GetOrCreateAsyncThread(_artefactTypes, _defaultTimeout); // _shLogWriter = new LogTextWriter(_serviceHostLogFilePath); Thread.Sleep(_serviceHostStartDelay); } else if (UseServiceHostProc) { if (!ArtefactHost.IsRunning("ServiceHost.exe")) { IEnumerable<string> args = _artefactTypes.Select<Type, string>((T) => string.Concat("-A", Path.GetFileName(T.Assembly.Location))).Distinct() .Concat(_artefactTypes.Select<Type, string>((T) => string.Concat("-T", T.FullName))); _serviceHostProcess = ArtefactHost.ExecuteViaCommandLine("ServiceHost.exe", string.Join(" ", args)); // AppDomain.CurrentDomain.ExecuteAssembly("ServiceHost.exe", args.ToArray()); Thread.Sleep(_serviceHostStartDelay); } } _clientProxy = new RepositoryClientProxy(new NetTcpBinding(), "net.tcp://localhost:3334/ArtefactRepository"); Console.WriteLine("\nService Artefact Repository: {0}\n", _clientProxy.ToString()); _fsCreator = new FileSystemArtefactCreator(_clientProxy) { BasePath = "/media/Scarydoor/mystuff/moozik/samples/mycollections/" }; //_clientProxy.Artefacts Console.WriteLine("\nFS Creator: {0}\n", _fsCreator.ToString()); } }
/// <summary> /// Init this instance. /// </summary> public void Init() { Console.Write("ClientTest.Init: "); if (Thread.VolatileRead(ref _init) != 0) Console.WriteLine("Already initialised"); else { Console.WriteLine("Initialising..."); Thread.VolatileWrite(ref _init, 1); Artefact.ArtefactTypes.AddRange(_artefactTypes); _shLogWriter = new LogTextWriter(_serviceHostLogFilePath); _serviceHostThread = ArtefactServiceHost.GetOrCreateAsyncThread(_artefactTypes, _defaultTimeout, _shLogWriter); _serviceHostThread.Start(); Thread.Sleep(_serviceHostStartDelay); _clientProxy = new RepositoryClientProxy(new NetTcpBinding(), "net.tcp://localhost:3334/ArtefactRepository"); Console.WriteLine("\nService Artefact Repository: {0}\n", _clientProxy.ToString()); _fsCreator = new FileSystemArtefactCreator(_clientProxy) { BasePath = "/media/Scarydoor/mystuff/moozik/samples/mycollections/" }; //_clientProxy.Artefacts Console.WriteLine("\nFS Creator: {0}\n", _fsCreator.ToString()); } }