| | |
| | | using System; |
| | | using Newtonsoft.Json; |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Data; |
| | | using System.Diagnostics; |
| | | using System.Linq; |
| | | using System.Runtime.Serialization; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | using System.Threading; |
| | | using Newtonsoft.Json; |
| | | using System.Diagnostics; |
| | | using System.Data; |
| | | using System.Threading.Tasks; |
| | | //using NPOI.SS.Formula.Functions; |
| | | //using 文件读写; |
| | | |
| | | |
| | | namespace Yw.WinFrmUI.Q3D |
| | | namespace Yw.WinFrmUI.Q3d |
| | | { |
| | | |
| | | |
| | | |
| | | |
| | | [Serializable] |
| | | public class dict<TKey, TValue> : Dictionary<TKey, TValue> |
| | | { |
| | | private List<TKey> keys |
| | | private List<TKey> keys |
| | | { |
| | | get |
| | | { |
| | |
| | | { |
| | | return this.Keys.ToArray(); |
| | | } |
| | | public List<TempForEnum<TKey,TValue>> items() |
| | | public List<TempForEnum<TKey, TValue>> items() |
| | | { |
| | | var temp_list = new List<TempForEnum<TKey, TValue>>(); |
| | | foreach (var Pair in this) |
| | |
| | | return default(TValue); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | return base[key]; |
| | | |
| | | } |
| | |
| | | key = (TKey)(object)index; |
| | | else |
| | | key = keys[index]; |
| | | if (!base.ContainsKey(key)) |
| | | if (!base.ContainsKey(key)) |
| | | base.Add(key, default(TValue)); |
| | | |
| | | return base[key]; |
| | |
| | | key = (TKey)(object)index; |
| | | base[key] = value; |
| | | } |
| | | |
| | | |
| | | else |
| | | { |
| | | if (index<keys.Count) |
| | | if (index < keys.Count) |
| | | { |
| | | key = keys[index]; |
| | | base[key] = value; |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | } |
| | | } |
| | | |
| | |
| | | } |
| | | public void LoadFromString(string s) |
| | | { |
| | | dict<TKey,TValue> d= JsonConvert.DeserializeObject<dict<TKey,TValue>>(s); |
| | | dict<TKey, TValue> d = JsonConvert.DeserializeObject<dict<TKey, TValue>>(s); |
| | | this.Clear(); |
| | | foreach(var kp in d) |
| | | foreach (var kp in d) |
| | | { |
| | | this.Add(kp.Key,kp.Value); |
| | | this.Add(kp.Key, kp.Value); |
| | | } |
| | | |
| | | |
| | | } |
| | | //public void ExportToExcel() |
| | | //{ |
| | |
| | | private DateTime 发送计时; |
| | | private string msgList = ""; |
| | | private System.Timers.Timer t = new System.Timers.Timer(); |
| | | |
| | | |
| | | public dict<TKey,TValue> ctx |
| | | |
| | | |
| | | public dict<TKey, TValue> ctx |
| | | { |
| | | get { return this; } |
| | | } |
| | |
| | | #endregion |
| | | |
| | | } |
| | | public class TempForEnum<TKey,TValue> |
| | | public class TempForEnum<TKey, TValue> |
| | | { |
| | | public TKey Item1; |
| | | public TValue Item2; |
| | |
| | | Item2 = value; |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | } |