/// <summary> /// Save method /// </summary> /// <param name="uniqueId">UniqueID menu</param> /// <param name="CurrentValue">Color Save</param> public static void Save(string uniqueId, Color CurrentValue) { Debug.Print("Begin Save Color", General.Console_Message.ColorPicker); var Dic = ReadDataFile(); //Not have file if (Dic == new Dictionary <string, Color>()) { Dic = new Dictionary <string, Color>() { { uniqueId, CurrentValue }, }; } // Found a file else { //need save = all value in menu if (Dic.ContainsKey(uniqueId)) { //Has a key, only change that Value; Dic[uniqueId] = CurrentValue; } else { //No Key, add new Dic.Add(uniqueId, CurrentValue); } } //Convert to json string json = JsonConvert.SerializeObject(Dic, Formatting.Indented); //overwritten the file File.WriteAllText(FilePath, json); }
public DicBase GetData() { Dic <T> data = new Dic <T>(); data.name = name; data.index = new int[Count]; data.data = new T[Count]; int i = 0; Dictionary <int, T> .Enumerator enumerator = GetEnumerator(); while (enumerator.MoveNext()) { data.index[i] = enumerator.Current.Key; data.data[i] = enumerator.Current.Value; i++; } if (indexList.Count > 0) { indexList.Clear(); typeList.Clear(); } return(data); }
private void button12_Click(object sender, EventArgs e) { TestObj[] a = new TestObj[6]; TestObj o; for (int i = 0; i < 6; i++) { o = new TestObj(); o.i = i; o.d = 3.14; o.Dt = DateTime.Now; o.Str = "Hello world ." + " " + i; a[i] = o; } Helper helper = new Helper("127.0.0.1", 9527); Dic dic = helper.GetDic("Dic1"); dic.Set("testObj Array", a); WriteMsg("Set \"testObj Array\" success .\r\n"); }
private async void Submit_Click(object sender, RoutedEventArgs e) { if (await new ConfirmationDialog().EnqueueAndShowIfAsync() == ContentDialogResult.Primary) { if (dic == null) { await new MistakeDialog().EnqueueAndShowIfAsync(); } else { try { using (var context = new Context()) { var dic = await context.Dic.FirstOrDefaultAsync(x => x.Id == this.dic.Id); dic = await dic.ModifyAsync(x => x.Status = DicStatusEnum.Dispatched.ToString()); await context.SaveChangesAsync(); } NotificationManager.CreateNotification(dic.Order.DealerId, "An Order Delivery Has Been Completed", $"{SignInManager.CurrentUser.FirstName} {SignInManager.CurrentUser.LastName} has completed one of your order delivery.", NotificationTypeEnum.Dic, dic.OrderId); await new SuccessDialog().EnqueueAndShowIfAsync(); } catch (Exception) { await new ErrorDialog().EnqueueAndShowIfAsync(); } } } }
//GetMessageGrown public void GetMessageGrown(JsonData jd) { string total_sl = jd.Keys.Contains("total_sl") ? jd["total_sl"].ToString() : ""; Static.Instance.AddValue("total_sl", total_sl); JsonData GetData = jd["data"]; List <string> NameGround = new List <string> (); if (GetData != null) { for (int i = 0; i < GetData.Count; i++) { foreach (string name in GetData[i].Keys) { NameGround.Add(name); } Dic GroundData = new Dic(); for (int j = 0; j < GetData [i].Count; j++) { if (GetData [i] [j] != null) { GroundData.DataDic.Add(NameGround [j], GetData [i] [j].ToString()); } else { GroundData.DataDic.Add(NameGround [j], string.Empty); } } Static.Instance.SaveGrown(GetData [i] ["id"].ToString(), GroundData); NameGround.Clear(); } } }
/// <summary> /// 논리조직에 속한 조직 제거 /// </summary> public void DeleteGroupListCommandAction() { try { if (DeleteDic != null && FocusGroup != null) { //먼저있던 딕 제거하고 Dic.Remove(FocusGroup.GroupName); ShowDicValues.Remove(DeleteDic); //새로셋팅한 딕 넣어주기, value에 showdic으로넣어줘서 계속초기화가됬었.. ObservableCollection <UC_Organization> selectedValues = new ObservableCollection <UC_Organization>(); foreach (var a in ShowDicValues) { selectedValues.Add(a); } Dic.Add(FocusGroup.GroupName, selectedValues); //삭제하고나면 딕이 초기화된다 , 쇼가 초기화된디 //딕은초기화안됨, 쇼가 초기화되서안나타나는건데.. } else { } } catch { MessageBox.Show("논리그룹에 속한 조직을 삭제하지 못 했습니다."); } }
/// <summary> /// 获得字典条目列表 /// </summary> /// <param name="Request"></param> /// <param name="Response"></param> /// <returns></returns> public string QryDicDataList(HttpRequest Request, HttpResponse Response) { string strXML = Request["txtXML"]; string strDicName = XmlFun.getNodeValue(strXML, "//QUERYCONDITION/@dicname"); return(Dic.dicDataList(strXML, strDicName)); }
public override void CreateDic() { Dic.Add("CENTER", "CENTER"); Dic.Add("DASHDOT", "DASHDOT"); Dic.Add("DASHED", "DASHED"); Dic.Add("HIDDEN", "HIDDEN"); Dic.Add("HIDDEN2", "HIDDEN2"); Dic.Add("BORDER", "BORDER"); Dic.Add("BORDER2", "BORDER2"); Dic.Add("BORDERX2", "BORDERX2"); Dic.Add("CENTER2", "CENTER2"); Dic.Add("DASHDOT2", "DASHDOT2"); Dic.Add("DASHDOTX2", "DASHDOTX2"); Dic.Add("DASHED2", "DASHED2"); Dic.Add("DOTX2", "DOTX2"); Dic.Add("HIDDENX2", "HIDDENX2"); Dic.Add("PHANTOM", "PHANTOM"); Dic.Add("PHANTOM2", "PHANTOM2"); Dic.Add("PHANTOMX2", "PHANTOMX2"); Dic.Add("SOLID", "SOLID"); Dic.Add("BYLAYER", "BYLAYER"); Dic.Add("BYBLOCK", "BYBLOCK"); Dic.Add("DASHED0", "DASHED0"); Dic.Add("DOT0", "DOT0"); Dic.Add("DASHDOT0", "DASHDOT0"); Dic.Add("DASHDOTDOT0", "DASHDOTDOT0"); Dic.Add("INVISIBLE", "INVISIBLE"); }
public override void CreateDic() { Dic.Add(CJQXChaoJie.BiaoZhu.ToString(), "标注"); Dic.Add(CJQXChaoJie.JianCai.ToString(), "剪裁"); Dic.Add(CJQXChaoJie.PingYi.ToString(), "平移"); Dic.Add(CJQXChaoJie.ZheHui.ToString(), "折回"); }
private static dynamic TestDynamic() { var vls = TestDict(); var exp = (dynamic)Dic.ToDynamic(vls); return(exp); }
public static List <Dic> Get() { List <Dic> list = UnicornCache.Get <List <Dic> >(CacheKey.Dic); if (list == null) { list = new List <Dic>(); string sql = "select Id,Code,Name,Type,Remark,AddTime from Dics"; DataTable dt = ProjectDB.GetDt(sql); foreach (DataRow row in dt.Rows) { Dic o = new Dic(); o.Id = St.ToInt32(row["Id"], 0); o.Code = row["Code"].ToString(); o.Name = row["Name"].ToString(); o.Type = St.ToInt32(row["Type"].ToString(), 0); o.Remark = row["Remark"].ToString(); o.AddTime = St.ToDateTime(row["AddTime"].ToString()); list.Add(o); } UnicornCache.Add(CacheKey.Dic, list); } return(list); }
public bool TryGetValue(TKey key, out TValue value) { value = default(TValue); var valueDic = new Value <TKey, TValue>(value); return(Dic.TryGetValue(key, out valueDic)); }
private void ClickGuoShu(LandProperty isLand) { if (isLand.KaiKen_.isKaiken) { StopAllCoroutines(); //BigLock = true; CameraMove.Instance.TargetMove(isLand.transform); // transform.GetChild(0).gameObject.SetActive(true); //for (int i = 0; i < isLand.IsKaiKenLand.transform.childCount; i++) // { // if (isLand.IsKaiKenLand.transform.GetChild(i).CompareTag("jinju")) // { // isLand.IsKaiKenLand.transform.GetChild (i).gameObject.layer = 8; // } // } //if (isLand.IsBoZhong.activeSelf) //{ // for (int i = 0; i < isLand.IsBoZhong.transform.childCount; i++) { // isLand.IsBoZhong.transform.GetChild (i).gameObject.layer = 8; // } //} //StartCoroutine("ClickTargetPlan"); FanHuiPanelUp(isLand); //天剑 Dic GetDic = null; Static.Instance.SaveTuDi.TryGetValue(Static.Instance.GetValue("d_id"), out GetDic); ShowDeadTime.text = GetDic.GetVaule("cf_jinbi"); TodaySY.text = GetDic.GetVaule("cf_jinbi"); //天剑 } }
public SentenceDetectorFactory(string languageCode, bool useTokenEnd, Dic abbreviationDictionary, char[] eosCharacters) { this.languageCode = languageCode; this.useTokenEnd = useTokenEnd; this.abbreviationDictionary = abbreviationDictionary; this.eosCharacters = eosCharacters; }
public ActionResult SubmitForm(Dic itemsEntity, string keyValue) { App.Submit(itemsEntity, keyValue); RedisCache.Remove(SysConsts.DATAITEMS); RedisCache.Set(SysConsts.DATAITEMS, DicItemApp.GetDataItemList()); return(Result.Success()); }
public int Compare(string x, string y) { var hash1 = Dic.ContainsKey(x) ? Dic[x] : 1; var hash2 = Dic.ContainsKey(y) ? Dic[y] : 1; return(hash1.CompareTo(hash2)); }
void I_UpdateStatus(N_EventCenter.Par par) { Dic dic = par._context as Dic; string status = dic[EventName.status] as string; this.toolStripStatusLabel1.Text = status; }
//GetMessageShopList public void ProcessingShop(JsonData jd) { JsonData GetData = jd ["data"]; List <string> NameGround = new List <string>(); Static.Instance.SaveShopType.Clear(); if (GetData != null) { for (int i = 0; i < GetData.Count; i++) { foreach (string name in GetData[i].Keys) { NameGround.Add(name); } Dic GroundData = new Dic(); for (int j = 0; j < GetData[i].Count; j++) { if (GetData[i][j] != null) { GroundData.DataDic.Add(NameGround[j], GetData[i][j].ToString()); } } string aa = GetData[i]["id"].ToString(); Static.Instance.AddShopList(aa, GroundData); NameGround.Clear(); } } }
void r_CheckedChanged(object sender, EventArgs e) { RadioButton r = (RadioButton)sender; if (r.Checked) { ((Port)r.Tag).Enabled = true; currentPort = (Port)r.Tag; #region ~通知主界面 Dic dic = new Dic(); string status = ""; if (currentPort.Isopen) { status = "打开"; } else { status = "关闭"; } dic[EventName.status] = string.Format("当前串口:{0} 波特率:{1} 状态:{2}", currentPort.portname, currentPort.baurate, status); EventCenter.GetInstance().PostNotification(EventName.Update_com_status, dic); #endregion } else { ((Port)r.Tag).Enabled = false; } }
//HttpMessageModel_E public void Processing_E(JsonData jd) { string td_num = jd.Keys.Contains("td_num") ? jd["td_num"].ToString() : ""; string total_sl = jd.Keys.Contains("tj_num") ? jd["tj_num"].ToString() : ""; Static.Instance.AddValue("td_num", td_num); Static.Instance.AddValue("tj_num", total_sl); JsonData GetData = jd["data"]; List <string> NameGround = new List <string> (); if (GetData != null) { for (int i = 0; i < GetData.Count; i++) { foreach (string name in GetData[i].Keys) { NameGround.Add(name); } Dic GroundData = new Dic(); for (int j = 0; j < GetData [i].Count; j++) { GroundData.DataDic.Add(NameGround [j], GetData [i] [j].ToString()); } Static.Instance.AddFriend(GetData [i] ["bianhao"].ToString(), GroundData); NameGround.Clear(); } } }
public SentenceDetectorFactory(string languageCode, bool useTokenEnd, Dic abbreviationDictionary, char[] eosCharacters) { this.languageCode = languageCode; this.useTokenEnd = useTokenEnd; this.abbreviationDictionary = abbreviationDictionary; this.eosCharacters = eosCharacters; }
public void AddShopType(string aaa, Dic bbb) { if (SaveShopType.ContainsKey(aaa)) { SaveShopType.Remove(aaa); } SaveShopType.Add(aaa, bbb); }
public void AddShopList(string Name, Dic GetDic) { if (SaveShopList.ContainsKey(Name)) { SaveShopList.Remove(Name); } SaveShopList.Add(Name, GetDic); }
public void SaveGrown(string aaa, Dic bbb) { if (SaveGrownInfo.ContainsKey(aaa)) { SaveGrownInfo.Remove(aaa); } SaveGrownInfo.Add(aaa, bbb); }
public void AddFriend(string aaa, Dic bbb) { if (SaveFriend.ContainsKey(aaa)) { SaveFriend.Remove(aaa); } SaveFriend.Add(aaa, bbb); }
public void AddTuDi(string name, Dic GetDic) { if (SaveTuDi.ContainsKey(name)) { SaveTuDi.Remove(name); } SaveTuDi.Add(name, GetDic); }
public override void CreateDic() { Dic.Add(CeWangStyleEnum.DengCha.ToString(), "等差"); Dic.Add(CeWangStyleEnum.DengFen.ToString(), "等分"); Dic.Add(CeWangStyleEnum.DuiShuZhengXiang.ToString(), "对数正向"); Dic.Add(CeWangStyleEnum.DuiShuFanXiang.ToString(), "对数反向"); Dic.Add(CeWangStyleEnum.None.ToString(), "无"); }
public R GetOrElse <R>(Point p, Func <T, R> extractor, R elze) { if (Dic.TryGetValue(p, out var v)) { return(extractor(v)); } return(elze); }
public DataManager(String path) { this.notes = new Dic<int, Note>(); this.filepath = path; this.idStack = new Stack<int>(); this.idCnt = 1; this.xmlP = new XMLProcessor(path); }
private void StackPanel_Tapped(object sender, TappedRoutedEventArgs e) { if (ResultListViewControl.SelectedItem is Dic dic) { Dic = dic; SelectedTarget.Text = $"Selected: {Dic.Id}"; SelectedTarget.Visibility = Visibility.Visible; } }
private void button1_Click(object sender, EventArgs e) { Dic dic = new Dic(); dic["msg"] = "哈哈,调用成功"; dic["color"] = Color.Red; dic["nextline"] = true; EventCenter.GetInstance().PostNotification(EventName.UpdateUI, dic); }
private async void SelectDic_Click(object sender, RoutedEventArgs e) { DicDialog dialog = new DicDialog(x => x.Status == DicStatusEnum.Dispatching.ToString()); ContentDialogResult button; bool isCompleted = false; bool isDispatching = false; using (var context = new Context()) { do { // if dialog displays more than 1 times if (dialog.Dic != null) { // if the order is not endorsed if (!isCompleted) { ContentDialog error = new ContentDialog { Title = "Alert", Content = "The DIC has not been completed, please wait till storemen completely assemble it.", CloseButtonText = "OK", Width = 400 }; await error.EnqueueAndShowIfAsync(); } else if (!isDispatching) { ContentDialog error = new ContentDialog { Title = "Alert", Content = "You are not permitted to complete a non-dispatching DIC delivery.", CloseButtonText = "OK", Width = 400 }; await error.EnqueueAndShowIfAsync(); } } button = await dialog.EnqueueAndShowIfAsync(); } while (button == ContentDialogResult.Primary && !((isDispatching = dialog.Dic.Status == DicStatusEnum.Dispatching.ToString()) && (isCompleted = context.DidSpare.Count(x => dialog.Dic.Did.Any(y => y.Id == x.DidId)) == dialog.Dic.Did.Sum(x => x.Quantity)))); } if (button == ContentDialogResult.Primary) { DicGUID.Text = (dic = dialog.Dic).Id.ToString(); SelectedDic.Text = $"Selected DIC: {dic.Id}"; SelectedDic.Visibility = Visibility.Visible; Submit.IsEnabled = true; } }