private static object tryGetCommonField(ref Memories MemoryHaystack, String KeyS, KeyWord KeyK, thing.Parts.Memory.MemoryComponents InPart, thing.Parts.Memory.MemoryComponents OutPart) { thing.Parts.Memory MemoryNeedle = new thing.Parts.Memory(KeyS, KeyK, String.Empty); foreach (thing.Parts.Memory Memory in MemoryHaystack) { switch (InPart) { case thing.Parts.Memory.MemoryComponents.KEY: if (!Object.Equals(null, KeyK)) { if (KeyK != KeyWord.NIL) { if (compare(Memory, MemoryNeedle, InPart)) { return(get(Memory, OutPart)); } } } if (!Object.Equals(null, KeyS)) { if (KeyS != String.Empty) { if (compare(Memory, MemoryNeedle, InPart)) { return(get(Memory, OutPart)); } } } break; case thing.Parts.Memory.MemoryComponents.NAME: if (!Object.Equals(null, KeyK)) { if (KeyK != KeyWord.NIL) { if (compare(Memory, MemoryNeedle, InPart)) { return(get(Memory, OutPart)); } } } if (!Object.Equals(null, KeyS)) { if (KeyS != String.Empty) { if (compare(Memory, MemoryNeedle, InPart)) { return(get(Memory, OutPart)); } } } break; } } return(null); }
internal Event(String Source_FullyQualifiedName , KeyWord KeyWord , Memories Memories , Double WhenSent , Double WhenRcvd , KeyWord Importance , KeyWord DeliveryState) { _Source_FullyQualifiedName = Source_FullyQualifiedName; _DeliveryState = DeliveryState; _Importance = Importance; _Keyword = KeyWord; _Memories = Memories; _WhenSent = WhenSent; _WhenRcvd = WhenRcvd; }
//Deserialization constructor public Event(SerializationInfo info , StreamingContext ctxt) { _WhenSent = ( Double ) info.GetValue("_WhenSent" , typeof(Double)); _WhenRcvd = ( Double ) info.GetValue("_WhenRcvd" , typeof(Double)); _Importance = ( KeyWord ) info.GetValue("_Importance" , typeof(KeyWord)); _Memories = ( Memories ) info.GetValue("_Memories" , typeof(Memories)); _Keyword = ( KeyWord ) info.GetValue("_Keyword" , typeof(KeyWord)); _DeliveryState = ( KeyWord ) info.GetValue("_DeliveryState" , typeof(KeyWord)); _Source_FullyQualifiedName = ( String ) info.GetValue("_Source_FullyQualifiedName" , typeof(String)); }
//Deserialization constructor public Event(SerializationInfo info, StreamingContext ctxt) { _WhenSent = ( Double )info.GetValue("_WhenSent", typeof(Double)); _WhenRcvd = ( Double )info.GetValue("_WhenRcvd", typeof(Double)); _Importance = ( KeyWord )info.GetValue("_Importance", typeof(KeyWord)); _Memories = ( Memories )info.GetValue("_Memories", typeof(Memories)); _Keyword = ( KeyWord )info.GetValue("_Keyword", typeof(KeyWord)); _DeliveryState = ( KeyWord )info.GetValue("_DeliveryState", typeof(KeyWord)); _Source_FullyQualifiedName = ( String )info.GetValue("_Source_FullyQualifiedName", typeof(String)); }
internal Event(String Source_FullyQualifiedName, KeyWord KeyWord, Memories Memories, Double WhenSent, Double WhenRcvd, KeyWord Importance, KeyWord DeliveryState) { _Source_FullyQualifiedName = Source_FullyQualifiedName; _DeliveryState = DeliveryState; _Importance = Importance; _Keyword = KeyWord; _Memories = Memories; _WhenSent = WhenSent; _WhenRcvd = WhenRcvd; }
private static object tryGetCommonField(ref Memories MemoryHaystack, String KeyS, KeyWord KeyK, thing.Parts.Memory.MemoryComponents InPart, thing.Parts.Memory.MemoryComponents OutPart) { thing.Parts.Memory MemoryNeedle = new thing.Parts.Memory(KeyS, KeyK, String.Empty); foreach (thing.Parts.Memory Memory in MemoryHaystack) { switch (InPart) { case thing.Parts.Memory.MemoryComponents.KEY: if (!Object.Equals(null, KeyK)) { if (KeyK != KeyWord.NIL) { if (compare(Memory, MemoryNeedle, InPart)) { return get(Memory, OutPart); } } } if (!Object.Equals(null, KeyS)) { if (KeyS != String.Empty) { if (compare(Memory, MemoryNeedle, InPart)) { return get(Memory, OutPart); } } } break; case thing.Parts.Memory.MemoryComponents.NAME: if (!Object.Equals(null, KeyK)) { if (KeyK != KeyWord.NIL) { if (compare(Memory, MemoryNeedle, InPart)) { return get(Memory, OutPart); } } } if (!Object.Equals(null, KeyS)) { if (KeyS != String.Empty) { if (compare(Memory, MemoryNeedle, InPart)) { return get(Memory, OutPart); } } } break; } } return null; }
public static bool tryGetCommonField(ref Memories Memories, String KeyS, KeyWord KeyK, System.Type OutValueType, thing.Parts.Memory.MemoryComponents InPart, thing.Parts.Memory.MemoryComponents OutPart, ref object outVar) { try { //lock (Memories) //{ String TYPE_STRING = typeof(System.String).ToString(); String TYPE_INT = typeof(System.Int32).ToString(); String TYPE_BOOL = typeof(System.Boolean).ToString(); String TYPE_KEYWORD = typeof(thing.KeyWord).ToString(); String OUT_VALUE_TYPE = OutValueType.ToString(); Object o = null; // lock (Memories) // { o = tryGetCommonField(ref Memories, KeyS, KeyK, InPart, OutPart); // } string s = String.Empty; if (object.Equals(null, o)) { return false; } if (OUT_VALUE_TYPE == TYPE_STRING) { s = (String)o; outVar = s; return true; } else if (OUT_VALUE_TYPE == TYPE_BOOL) { s = (String)o; if (s != String.Empty) { outVar = Boolean.Parse(s); return true; } else { outVar = false; return false; } } else if (OUT_VALUE_TYPE == TYPE_INT) { s = (String)o; if (s != String.Empty) { outVar = System.Int32.Parse(s); return true; } else { outVar = 0; return false; } } else if (OUT_VALUE_TYPE == TYPE_KEYWORD) { outVar = (thing.KeyWord)o; return true; } else { outVar = null; return false; } //} } catch //(Exception e) { // _Log(e.ToString()); return false; } }
public static bool tryGetCommonField(ref Memories Memories, String KeyS, KeyWord KeyK, System.Type OutValueType, thing.Parts.Memory.MemoryComponents InPart, thing.Parts.Memory.MemoryComponents OutPart, ref object outVar) { try { //lock (Memories) //{ String TYPE_STRING = typeof(System.String).ToString(); String TYPE_INT = typeof(System.Int32).ToString(); String TYPE_BOOL = typeof(System.Boolean).ToString(); String TYPE_KEYWORD = typeof(thing.KeyWord).ToString(); String OUT_VALUE_TYPE = OutValueType.ToString(); Object o = null; // lock (Memories) // { o = tryGetCommonField(ref Memories, KeyS, KeyK, InPart, OutPart); // } string s = String.Empty; if (object.Equals(null, o)) { return(false); } if (OUT_VALUE_TYPE == TYPE_STRING) { s = (String)o; outVar = s; return(true); } else if (OUT_VALUE_TYPE == TYPE_BOOL) { s = (String)o; if (s != String.Empty) { outVar = Boolean.Parse(s); return(true); } else { outVar = false; return(false); } } else if (OUT_VALUE_TYPE == TYPE_INT) { s = (String)o; if (s != String.Empty) { outVar = System.Int32.Parse(s); return(true); } else { outVar = 0; return(false); } } else if (OUT_VALUE_TYPE == TYPE_KEYWORD) { outVar = (thing.KeyWord)o; return(true); } else { outVar = null; return(false); } //} } catch //(Exception e) { // _Log(e.ToString()); return(false); } }