public static ProcessingBehaveList <T> GetInstance() { if (instanceBehave == null) { GC.Collect(); lock (_lock) { if (instanceBehave == null) { instanceBehave = new ProcessingBehaveList <T>(); } } } return(instanceBehave); }
public string Analysis(ProcessingAllData data, Hashtable ht, ProcessingBehaveList <ProcessingBehave> pbList) { String keys = "key"; foreach (String key in ht.Keys) { if (data.Data.Contains(key) || data.Data.Contains(key)) { this.UserIPA = data.SourceAddress; this.UserIPB = data.DestinationAddress; this.time = data.Time; this.protocol = data.HardwareType; string str = ht[key].ToString(); string[] strs = str.Split(','); this.reason = strs[0]; this.detailReason = strs[1]; Console.WriteLine("reason= " + str[0] + "detailReason= " + detailReason); lock (pbList.SyncRoot) { pbList.Add(this); } keys = key; } //if (data.Data.Contains(key) || data.Data.Contains(key)) //{ // this.UserIPA = data.SourceAddress; // this.UserIPB = data.DestinationAddress; // this.time = data.Time; // this.protocol = data.HardwareType; // this.reason = (String)ht[key]; // lock (pbList.SyncRoot) // { // pbList.Add(this); // } // keys = key; //} } return(keys); }