OpenKeyWord  Build Tag: jenkins-DoxyGen_EN-107, Build ID: 2015-03-08_20-51-06
 All Classes Namespaces Functions Variables Properties Pages
OKW.OKW_Memorize Class Reference
Collaboration diagram for OKW.OKW_Memorize:

Public Member Functions

bool Exists (string fpsKey)
 
string Get (string fpsKey)
 
void Init ()
 
void Read ()
 
void Save ()
 
void Set (string fpsKey, string fpsValue)
 

Static Public Member Functions

static void Reset ()
 

Public Attributes

string OKW_Memorize_xml = string.Empty
 
SerializableDictionary< string,
string > 
_Value = new SerializableDictionary<string, string>()
 

Properties

static OKW_Memorize Instance [get]
 

Private Member Functions

 OKW_Memorize ()
 

Private Attributes

LogMessenger LM = null
 
Logger Log = Logger.Instance
 

Static Private Attributes

static OKW_Memorize _Instance
 

Detailed Description

Author
Zoltán Hrabovszki
Date
2013.12.06

Constructor & Destructor Documentation

OKW.OKW_Memorize.OKW_Memorize ( )
private
Author
Zoltán Hrabovszki
Date
2014.14.27
150  {
151  this.LM = new LogMessenger(this.GetType().Name);
152  }

Here is the caller graph for this function:

Member Function Documentation

bool OKW.OKW_Memorize.Exists ( string  fpsKey)
Author
Zoltan Hrabovszki
Date
2013.11.25
221  {
222  bool lvbReturn = false;
223 
224  this.Log.LogFunctionStartDebug(_Instance.GetType().FullName + "Exists", "string fpsKey", fpsKey);
225 
226  if (this._Value.ContainsKey(fpsKey))
227  {
228  lvbReturn = true;
229  }
230 
231  this.Log.LogFunctionEndDebug(lvbReturn);
232 
233  return lvbReturn;
234  }
SerializableDictionary< string, string > _Value
Definition: OKW_Memorize.cs:97

Here is the caller graph for this function:

string OKW.OKW_Memorize.Get ( string  fpsKey)
Author
Zoltán Hrabovszki
Date
2014.14.27
251  {
252  string lvsReturn = string.Empty;
253  bool bOK = false;
254 
255  this.Log.LogFunctionStartDebug(_Instance.GetType().FullName + "Get", "String fpsKey", fpsKey);
256 
257  try
258  {
259  if (this._Value.ContainsKey(fpsKey))
260  {
261  lvsReturn = this._Value[fpsKey];
262  }
263  else
264  {
265  string ErrorText = this.LM.GetMessage("Get", "OKWMemorizeKeyNotExistsException", fpsKey);
266  throw new OKWMemorizeKeyNotExistsException(ErrorText);
267  }
268 
269  bOK = true;
270  }
271  finally
272  {
273  if (bOK)
274  {
275  this.Log.LogFunctionEndDebug();
276  }
277  else
278  {
279  this.Log.LogFunctionEndDebug(lvsReturn);
280  }
281  }
282 
283  return lvsReturn;
284  }
SerializableDictionary< string, string > _Value
Definition: OKW_Memorize.cs:97

Here is the caller graph for this function:

void OKW.OKW_Memorize.Init ( )
Author
Zoltán Hrabovszki
Date
2013.11.28
318  {
319  this.Log.LogFunctionStartDebug(this.GetType().FullName + ".Init");
320 
321  // Klassen Variablen erst löschen...
322  _Instance.OKW_Memorize_xml = string.Empty;
323  _Instance._Value.Clear();
324 
325  // ... und dann alles Initialisieren!
326  // 1. Setze Pfad und
327  this.OKW_Memorize_xml = OKW_Ini.Instance.OKW_Enviroment.File_OKWMemorize_xml;
328 
329  if (!string.IsNullOrEmpty(this.OKW_Memorize_xml))
330  {
331  this.Log.LogPrintDebug("OKW Memorize Datei = >>" + this.OKW_Memorize_xml + "<<");
332  if (System.IO.File.Exists(this.OKW_Memorize_xml))
333  {
334  // Lesen der Daten...
335  this.Read();
336  }
337  else
338  {
339  // Deafault Werte Lesen.
340  this.Log.LogWarning("Datei: >>" + this.OKW_Memorize_xml + "<< nicht gefunden.");
341  }
342  }
343  else
344  {
345  this.Log.LogWarning("Enviroment variable 'OKWIni' not set!");
346  }
347 
348  this.Log.LogFunctionEndDebug();
349  return;
350  }
string OKW_Memorize_xml
Definition: OKW_Memorize.cs:84
void OKW.OKW_Memorize.Read ( )
Author
Zoltán Hrabovszki
Date
2013.11.28
363  {
364  this.Log.LogFunctionStartDebug(_Instance.GetType().FullName + "Read()");
365 
366  try
367  {
368  XmlSerializer serializer = new XmlSerializer(typeof(OKW_Memorize));
369  StreamReader fs = new StreamReader(this.OKW_Memorize_xml);
370  _Instance = (OKW_Memorize)serializer.Deserialize(fs);
371  fs.Close();
372  }
373  finally
374  {
375  this.Log.LogFunctionEndDebug();
376  }
377 
378  return;
379  }
OKW_Memorize()
Definition: OKW_Memorize.cs:149
string OKW_Memorize_xml
Definition: OKW_Memorize.cs:84
static OKW_Memorize _Instance
Definition: OKW_Memorize.cs:108

Here is the call graph for this function:

static void OKW.OKW_Memorize.Reset ( )
static
Author
Zoltan Hrabovszki
Date
2013.11.25
203  {
204  _Instance = null;
205  }
static OKW_Memorize _Instance
Definition: OKW_Memorize.cs:108
void OKW.OKW_Memorize.Save ( )
Author
Zoltán Hrabovszki
Date
2013.11.28
395  {
396  this.Log.LogFunctionStartDebug(_Instance.GetType().FullName + "Save()");
397 
398  try
399  {
400  XmlSerializer serializer = new XmlSerializer(typeof(OKW_Memorize));
401  StreamWriter fs = new StreamWriter(this.OKW_Memorize_xml, false);
402  serializer.Serialize(fs, _Instance);
403  fs.Close();
404  }
405  finally
406  {
407  this.Log.LogFunctionEndDebug();
408  }
409 
410  return;
411  }
OKW_Memorize()
Definition: OKW_Memorize.cs:149
string OKW_Memorize_xml
Definition: OKW_Memorize.cs:84
static OKW_Memorize _Instance
Definition: OKW_Memorize.cs:108
void OKW.OKW_Memorize.Set ( string  fpsKey,
string  fpsValue 
)
Author
Zoltán Hrabovszki
Date
2014.12.27
421  {
422  this.Log.LogFunctionStartDebug(_Instance.GetType().FullName + "Set", "String fpsKey", fpsKey, "String fpsValue", fpsValue);
423 
424  try
425  {
426  if (this._Value.ContainsKey(fpsKey))
427  {
428  string lvsOverwriteKey = this.LM.GetMessage("Set", "OverwriteKeyWarning", fpsKey);
429  string lvsOldValue = this.LM.GetMessage("Set", "OldValue", this._Value[fpsKey]);
430  string lvsNewValue = this.LM.GetMessage("Set", "NewValue", fpsValue);
431 
432  this.Log.LogWarning(lvsOverwriteKey);
433  this.Log.LogPrint(lvsOldValue);
434  this.Log.LogPrint(lvsNewValue);
435  _Instance._Value[fpsKey] = fpsValue;
436  }
437  else
438  {
439  _Instance._Value.Add(fpsKey, fpsValue);
440  this.Log.LogPrint("Wert: " + fpsValue + " wird gespeichert");
441  }
442 
443  // persistentes Speichern aller Daten...
444  _Instance.Save();
445  }
446  finally
447  {
448  this.Log.LogFunctionEndDebug();
449  }
450 
451  return;
452  }
SerializableDictionary< string, string > _Value
Definition: OKW_Memorize.cs:97

Member Data Documentation

OKW_Memorize OKW.OKW_Memorize._Instance
staticprivate
Author
Zoltán Hrabovszki
Date
2013.11.28
SerializableDictionary<string, string> OKW.OKW_Memorize._Value = new SerializableDictionary<string, string>()
Author
Zoltán Hrabovszki
Date
2013.11.28
LogMessenger OKW.OKW_Memorize.LM = null
private
Author
Zoltán Hrabovszki
Date
2014.12.28
Logger OKW.OKW_Memorize.Log = Logger.Instance
private
Author
Zoltán Hrabovszki
Date
2013.11.28
string OKW.OKW_Memorize.OKW_Memorize_xml = string.Empty
Author
Zoltán Hrabovszki
Date
2013.11.28

Property Documentation

OKW_Memorize OKW.OKW_Memorize.Instance
staticget
Author
Zoltán Hrabovszki
Date
2014.14.27

The documentation for this class was generated from the following file: