45 using System.Collections.Generic;
47 using System.Xml.Serialization;
68 public List<string> cvKeywords =
new List<string>();
73 public List<string> cvNamesOfGUIClasses =
new List<string>();
83 public string OKW_ImplementationMatrix_xml =
string.Empty;
98 this.finalizeMe =
true;
101 #endregion Constructors
115 if ( instance == null)
125 #endregion Properties
136 string lvsReturn =
string.Empty;
138 if (this.cvImplementationMatrix.ContainsKey(fpsKey))
140 lvsReturn = this.cvImplementationMatrix[fpsKey];
159 this.Log.LogFunctionStartDebug(this.GetType().FullName +
".Init");
162 this.OKW_ImplementationMatrix_xml =
string.Empty;
165 this.cvImplementationMatrix.Clear();
166 this.cvKeywords.Clear();
167 this.cvNamesOfGUIClasses.Clear();
173 if (!
string.IsNullOrEmpty(this.OKW_ImplementationMatrix_xml))
175 this.Log.
LogPrintDebug(
"OKW Memorize Datei = >>" + this.OKW_ImplementationMatrix_xml +
"<<");
176 if (System.IO.File.Exists(
this.OKW_ImplementationMatrix_xml))
184 this.Log.
LogWarning(
"Datei: >>" + this.OKW_ImplementationMatrix_xml +
"<< nicht gefunden.");
189 this.Log.
LogWarning(
"Enviroment variable 'OKWIni' not set!");
192 this.Log.LogFunctionEndDebug();
205 this.Log.LogFunctionStartDebug( this.GetType().FullName +
"Read()");
210 StreamReader fs =
new StreamReader(this.OKW_ImplementationMatrix_xml);
216 this.Log.LogFunctionEndDebug();
231 this.Log.LogFunctionStartDebug(instance.GetType().FullName +
"Save()");
236 StreamWriter fs =
new StreamWriter(this.OKW_ImplementationMatrix_xml,
false);
237 serializer.Serialize(fs, instance);
242 this.Log.LogFunctionEndDebug();
258 public void SetImplementation(
string fpsNameOfGUIClass,
string fpsKeyWord,
string fpsImplemented)
260 this.AddNameOfGUIClass(fpsNameOfGUIClass);
261 this.AddKeyword(fpsKeyWord);
263 string lvskey = fpsNameOfGUIClass +
";" + fpsKeyWord;
265 if (fpsImplemented ==
"P" || fpsImplemented ==
"F" || fpsImplemented ==
"N")
267 this.AddImplementation(lvskey, fpsImplemented);
276 public void WriteResultXML()
280 foreach (
string lvsKeyword
in this.cvKeywords)
282 foreach (
string lvsClassName
in this.cvNamesOfGUIClasses)
284 lvskey = lvsClassName +
";" + lvsKeyword;
286 System.Console.WriteLine(
"<td>" + this.GetImplementation(lvskey) +
"</td>");
302 if (this.cvImplementationMatrix.ContainsKey(fpsKey))
304 if (fpsImplemented==
"F" & this.cvImplementationMatrix[fpsKey] ==
"N")
306 throw new Exception(
"001: Fehler in Matrix: " + this.cvImplementationMatrix[fpsKey] +
"-Wert kann nicht auf 'F' gesetzt werden.");
308 if (fpsImplemented==
"F" & this.cvImplementationMatrix[fpsKey] ==
"F")
310 this.cvImplementationMatrix[fpsKey] =
"F";
312 if (fpsImplemented==
"F" & this.cvImplementationMatrix[fpsKey] ==
"P")
314 this.cvImplementationMatrix[fpsKey] =
"F";
316 if (fpsImplemented==
"P" & this.cvImplementationMatrix[fpsKey] ==
"N")
318 throw new Exception(
"002: Fehler in Matrix: " + this.cvImplementationMatrix[fpsKey] +
"-Wert kann nicht auf 'P' gesetzt werden.");
320 if (fpsImplemented==
"P" & this.cvImplementationMatrix[fpsKey] ==
"F")
322 this.cvImplementationMatrix[fpsKey] =
"F";
324 if (fpsImplemented==
"N" & this.cvImplementationMatrix[fpsKey] ==
"P")
326 throw new Exception(
"003: Fehler in Matrix: " + this.cvImplementationMatrix[fpsKey] +
"-Wert kann nicht auf 'N' gesetzt werden.");
328 if (fpsImplemented==
"N" & this.cvImplementationMatrix[fpsKey] ==
"F")
330 throw new Exception(
"004: Fehler in Matrix: " + this.cvImplementationMatrix[fpsKey] +
"-Wert kann nicht auf 'N' gesetzt werden.");
332 if (fpsImplemented==
"N" & this.cvImplementationMatrix[fpsKey] ==
"N")
334 this.cvImplementationMatrix[fpsKey] =
"N";
339 this.cvImplementationMatrix.Add(fpsKey,fpsImplemented);
345 public void SaveAs_CSV()
348 System.IO.StreamWriter file =
new System.IO.StreamWriter(
@"C:\temp\ImplementationMatrix\ImplementationMatrix.csv");
351 lvsZeile =
"GUI-Class";
352 foreach (
string Keyword
in this.cvKeywords )
354 lvsZeile = lvsZeile +
";" + Keyword;
356 file.WriteLine(lvsZeile);
359 foreach (
string GUIKlassName
in this.cvNamesOfGUIClasses )
361 lvsZeile = GUIKlassName;
363 foreach (
string Keyword
in this.cvKeywords )
365 lvsZeile = lvsZeile +
";" + this.GetImplementation(GUIKlassName +
";" + Keyword);
368 file.WriteLine(lvsZeile);
376 public void SaveAs_HTML()
378 System.IO.StreamWriter file =
new System.IO.StreamWriter(
@"C:\temp\ImplementationMatrix\ImplementationMatrix.html");
380 file.WriteLine(
"<html>");
381 file.WriteLine(
" <head>");
383 file.WriteLine(
" <style type=\"text/css\">");
384 file.WriteLine(
" td.P{");
385 file.WriteLine(
" text-align:center;");
386 file.WriteLine(
" background-color:#00FF00;");
387 file.WriteLine(
" }");
388 file.WriteLine(
" td.F{");
389 file.WriteLine(
" text-align:center;");
390 file.WriteLine(
" background-color:#FF0000;");
391 file.WriteLine(
" }");
392 file.WriteLine(
" td.N{");
393 file.WriteLine(
" text-align:center;");
394 file.WriteLine(
" background-color:#000000;");
395 file.WriteLine(
" }");
397 file.WriteLine(
" th.rotate {");
398 file.WriteLine(
" /* Something you can count on */");
399 file.WriteLine(
" height: 200px;");
400 file.WriteLine(
" white-space: nowrap;");
401 file.WriteLine(
" }");
403 file.WriteLine(
" th.rotate > div {");
404 file.WriteLine(
" transform: ");
405 file.WriteLine(
" /* Magic Numbers */");
406 file.WriteLine(
" translate(0px, 90px)");
407 file.WriteLine(
" /* 45 is really 360 - 45 */");
408 file.WriteLine(
" rotate(-90deg);");
409 file.WriteLine(
" width: 25px;");
410 file.WriteLine(
" }");
411 file.WriteLine(
" th.rotate > div > span {");
412 file.WriteLine(
" padding: 5px 10px;");
413 file.WriteLine(
" }");
415 file.WriteLine(
" </style>");
417 file.WriteLine(
" </head>");
419 file.WriteLine(
" <body>");
421 file.WriteLine(
" <table border=\"1\">");
422 file.WriteLine(
" <tr>");
424 file.WriteLine(
" <th>GUI-Class</th>");
425 foreach (
string Keyword
in this.cvKeywords )
427 file.WriteLine(
" <th class=\"rotate\"><div><span>" + Keyword +
"</span></div></th>");
429 file.WriteLine(
" </tr>");
433 foreach (
string GUIKlassName
in this.cvNamesOfGUIClasses )
435 file.WriteLine(
" <tr>");
436 file.WriteLine(
" <th>" + GUIKlassName +
"</th>");
438 foreach (
string Keyword
in this.cvKeywords )
440 string Wert = this.GetImplementation(GUIKlassName +
";" + Keyword);
441 file.WriteLine(
" <td class=\""+ Wert +
"\" align=\"center\">" + Wert +
"</td>");
444 file.WriteLine(
" </tr>");
446 file.WriteLine(
" </table>");
448 file.WriteLine(
" </body>");
449 file.WriteLine(
"</html>");
463 if (!this.cvKeywords.Contains(fpsKeyword))
465 this.cvKeywords.Add(fpsKeyword);
478 if (!this.cvNamesOfGUIClasses.Contains(fpsNameOfGUIClass))
480 this.cvNamesOfGUIClasses.Add(fpsNameOfGUIClass);
493 this.finalizeMe=
false;
string File_OKW_ImplementationMatrix_xml
Property get/set von __File_OKW_ImplementationMatrix_xml.
static OKW_Ini Instance
Singelton-Pattern: Instanz gibt die aktuelle, gültige und einzige Innstanz der Klasse zurück...
string GetImplementation(string fpsKey)
Holt die Implementierung eines Schlüsselwortes für ein Object.
OKW_Enviroment OKW_Enviroment
Dieses Feld hält den Abschnitt OKW_Enviroment der OKW_Ini.xml vor.
ImplementationMatrix()
Privater Konstruktor als singelton.
ImplentationMatrix wird für die Dokumentaion des Implmentierungs fortschrittes verwendet.
void AddImplementation(string fpsKey, string fpsImplemented)
Fügt eine neue Implementierung der Dictionary cvImplementationMatrix hinzu. Existiert dieser (=fpsKey...
void AddNameOfGUIClass(string fpsNameOfGUIClass)
Fügt den Namen einer Klasse der List cvNamesOfGUIClasses zu, wenn dieser noch nicht in der Liste ist...
void LogPrintDebug(string fpsMessage)
Loggt eine Nachricht.
OKW.OKW_Ini ist die Klasse zur Konfigurationsdatei OKW_Ini.xml.
void LogWarning(string fps_Message)
LogWarning Function: Logs a warning to the results file.
void SetImplementation(string fpsNameOfGUIClass, string fpsKeyWord, string fpsImplemented)
Setzt die Implementierung eines Schlüsselwortes für ein Object.
void AddKeyword(string fpsKeyword)
Fügt ein Schlüsselwort der List zu wen dieser noch nicht in der Liste ist. Ziel: Eindeutige List der ...