public NagiosChecker(LogLineDelegate pLogger, DateTime pIgnoreBefore, string pURL, string pLogin, string pPassword) { this.mLogLineCallback = pLogger; this.mIgnoreBefore = pIgnoreBefore; this.mNagiosURL = pURL; this.mNagiosLogin = pLogin; this.mNagiosPassword = pPassword; }
public NagiosChecker(LogLineDelegate pLogger, DateTime pIgnoreBefore, string pURL, string pLogin, string pPassword) { this.mLogLineCallback = pLogger; this.mIgnoreBefore = pIgnoreBefore; this.mNagiosURL = pURL; this.mNagiosLogin = pLogin; this.mNagiosPassword = pPassword; }
static void ConsoleWriteWinMDTypes(ParsedArgs parsedArgs, LogLineDelegate outputWriteLine, LogLineDelegate verboseWriteLine) { List <Regex> matches = parsedArgs.matches.Select <string, Regex>(matchRaw => new Regex(matchRaw)).ToList(); WinMDTypes typeStore = new WinMDTypes(parsedArgs.files.ToArray()); var graph = typeStore.CreateGraph(typeInfo => { string fullName = typeInfo.FullName; Type type = typeInfo.Type; bool genericArgs = false; if (type != null) { genericArgs = type.GenericTypeArguments.Length > 0; } bool nameMatch = (fullName != null && matches.Any(match => match.IsMatch(fullName))); return(nameMatch || genericArgs); }); outputWriteLine("// Generated by https://github.com/david-risney/WinMDGraph " + parsedArgs.rawArgs); verboseWriteLine("// All in graph to start"); foreach (var node in graph.NodeContextToNode.Values) { verboseWriteLine("// - " + node.Context); } verboseWriteLine("// Collapse types that don't match any of the regex but are parameterized types"); foreach (var node in graph.NodeContextToNode.Values.ToList().Where( node => (node.Context.FullName == null || !matches.Any(match => match.IsMatch(node.Context.FullName))) && (node.Context.CorrespondingType != null && node.Context.CorrespondingType.GenericTypeArguments.Length > 0) )) { verboseWriteLine("// - " + node.Context); node.RemoveAndCollapseAllEdges(); } verboseWriteLine("// Remove types that don't match any of the regex"); foreach (var node in graph.NodeContextToNode.Values.ToList().Where( node => (node.Context.FullName == null || !matches.Any(match => match.IsMatch(node.Context.FullName))) && (node.Context.CorrespondingType == null || node.Context.CorrespondingType.GenericTypeArguments.Length == 0) )) { verboseWriteLine("// - " + node.Context); node.RemoveAndRemoveAllEdges(); } verboseWriteLine("// Collapse non-classes"); foreach (var node in graph.NodeContextToNode.Values.ToList().Where( node => (node.Context.Class == null || node.Context.Class.FullName == null) //&& node.Context.Interface == null )) { verboseWriteLine("// - " + node.Context); node.RemoveAndCollapseAllEdges(); } // Remove self referential edges foreach (var edge in graph.Edges.ToList().Where( edge => edge.Start.Context.FullName == edge.End.Context.FullName )) { edge.Remove(); } Dictionary <string, List <string> > namespaceToEntries = new Dictionary <string, List <string> >(); foreach (var node in graph.NodeContextToNode.Values) { string ns = node.Context.Namespace; List <string> entries = namespaceToEntries.ContainsKey(ns) ? namespaceToEntries[ns] : (namespaceToEntries[ns] = new List <string>()); entries.Add(EncodeNameForDot(node.Context.Name) + ";"); } foreach (var edge in graph.Edges) { string ns = EdgeToNamespace(edge); List <string> entries = namespaceToEntries.ContainsKey(ns) ? namespaceToEntries[ns] : (namespaceToEntries[ns] = new List <string>()); entries.Add(EncodeNameForDot(edge.Start.Context.Name) + " -> " + EncodeNameForDot(edge.End.Context.Name) + ";"); } outputWriteLine("digraph {"); outputWriteLine("\tnode [ fontname = \"Segoe UI\" ];"); outputWriteLine("\tnode [ shape = \"rectangle\" ];"); outputWriteLine("\tnode [ fillcolor = \"white\" ];"); outputWriteLine("\tnode [ color = black ];"); outputWriteLine("\tnode [ style = filled ];"); int keyIdx = 0; foreach (var key in namespaceToEntries.Keys) { if (key != "") { outputWriteLine("\tsubgraph cluster_" + keyIdx + " {"); outputWriteLine("\t\tlabel = \"" + key + "\";"); outputWriteLine("\t\tcolor = grey35;"); outputWriteLine("\t\tstyle = filled;"); outputWriteLine("\t\tfillcolor = grey90;"); outputWriteLine("\t\tfontname = \"Segoe UI\";"); outputWriteLine("\t\tfontsize = 18;"); ++keyIdx; } foreach (var entry in namespaceToEntries[key]) { outputWriteLine((key == "" ? "\t" : "\t\t") + entry); } if (key != "") { outputWriteLine("\t}"); } } outputWriteLine("}"); }
public NagiosChecker(LogLineDelegate pLogger, string pURL, string pLogin, string pPassword) : this(pLogger, DateTime.MinValue, pURL, pLogin, pPassword) { }
public NagiosChecker(LogLineDelegate pLogger, string pURL, string pLogin, string pPassword) : this(pLogger, DateTime.MinValue, pURL, pLogin, pPassword) { }
public ApplicationOutputPage() { InitializeComponent(); LogLineFunc = LogLine; }