コード例 #1
0
 /// <inheritdoc />
 public void Dispose()
 {
     timerCts?.Dispose();
     compileJobConsumer.Dispose();
     Configuration.Dispose();
     Chat.Dispose();
     Watchdog.Dispose();
     RepositoryManager.Dispose();
 }
コード例 #2
0
 /// <inheritdoc />
 public void Dispose()
 {
     timerCts?.Dispose();
     Configuration.Dispose();
     Chat.Dispose();
     Watchdog.Dispose();
     dmbFactory.Dispose();
     RepositoryManager.Dispose();
 }
コード例 #3
0
ファイル: WatchdogTests.cs プロジェクト: tcunning/DotNet.Plus
        public void WatchdogDisposeNotStartedTest()
        {
            var wd = new Watchdog(petTimeout: TimeSpan.FromMilliseconds(100), autoStartOnFirstPet: false);

            wd.Dispose();
            wd.IsTriggered.ShouldBe(false);
            wd.IsCanceled.ShouldBe(false);
            wd.IsDisposed.ShouldBe(true);
            wd.IsMonitorStarted.ShouldBe(false);
        }
コード例 #4
0
        protected void Disconnect()
        {
            if (isDisconnected)
            {
                return;
            }

            isDisconnected = true;
            WriteDebug("IFO:     Client Disconnected");
            ClientHandler.Disconnect();
            watchdog.Dispose();
            try { socket.Close(); } catch { }
        }
コード例 #5
0
ファイル: WatchdogTests.cs プロジェクト: tcunning/DotNet.Plus
        public void WatchdogDisposeStartedTest()
        {
            var wd     = new Watchdog(petTimeout: TimeSpan.FromMilliseconds(100), autoStartOnFirstPet: false);
            var wdTask = wd.AsTask();

            wd.Monitor();
            wd.Dispose();
            wd.IsTriggered.ShouldBe(false);
            wd.IsCanceled.ShouldBe(true);
            wd.IsDisposed.ShouldBe(true);
            wd.IsMonitorStarted.ShouldBe(true);
            Should.Throw <WatchdogDisposedException>(() => throw wdTask.Exception !);
            Should.Throw <WatchdogDisposedException>(() => throw wd.AsTask().Exception !);
        }
コード例 #6
0
ファイル: Program.cs プロジェクト: dbremner/smokey
		private static bool DoRun(GetOptions options)
		{ 
			Progress progress = null;
			if (!options.Has("-quiet"))
				progress = new Progress(options.Has("-verbose"));
				
			Watchdog watcher = new Watchdog(options.Has("-verbose"));
			
			Error[] errors = null;
			try
			{
				DateTime startTime = DateTime.Now;

				AnalyzeAssembly analyzer = new AnalyzeAssembly(delegate (string name)
				{
					progress.Add(name);
					watcher.Add(name);
				});
				
				List<string> excluded = new List<string>(options.Values("-exclude-check"));
				if (excluded.IndexOf("R1035") < 0)		// ValidateArgs2 is disabled by default
					excluded.Add("R1035");
				
				analyzer.ExcludedChecks = excluded.Except(options.Values("-include-check"));
				analyzer.ExcludeNames = options.Values("-exclude-name").Except(options.Values("-include-name"));
				
				string[] onlyType = options.Values("-only-type");
				
				string[] severities = options.Values("-severity");
				Severity severity = (Severity) Enum.Parse(typeof(Severity), severities[severities.Length - 1]);
				bool ignoreBreaks = options.Has("-ignore-breaking") && !options.Has("-include-breaking");
				errors = analyzer.Analyze(options.Operands[0], onlyType, severity, ignoreBreaks);
				TimeSpan elapsed = DateTime.Now - startTime;
				
				string assemblyPath = options.Operands[0];
				string outFile = options.Value("-out");
				
				if (options.Has("-xml"))
					XmlReport.Report(assemblyPath, outFile, errors);
				else if (options.Has("-html"))
					HtmlReport.Report(assemblyPath, outFile, errors, analyzer.NumRules, elapsed);
				else
					TextReport.Report(assemblyPath, outFile, errors, analyzer.NumRules, elapsed);
			}
			finally
			{
				if (progress != null)
					progress.Dispose();
				watcher.Dispose();
			}
			
			int count = errors.Count(x => x.Violation.Severity != Severity.Nitpick);
						
			return count == 0;
		}