//outputs the scan information, only used for testing , //now pretty much depricated, wouldn't recommend using it private static void DisplayScan(Scan scan, IDs id) { StringBuilder writeOut = new StringBuilder(); writeOut.Append(scan.getDetailedString()); StringBuilder consoleOut = new StringBuilder(); switch (outputLevel) { case 0: consoleOut.Append(scan.getDetailedString()); break; case 1: consoleOut.Append(scan.getSimpleString()); break; case 2: if (scan.GetSpectra().getMSLevel() == 2) { if (id != null) { consoleOut.AppendLine(id.ToString()); writeOut.AppendLine(id.ToString()); } else { consoleOut.Append(String.Format("scanNum {0} cannot be matched to a peptide", id.getScanNum())); } } break; case 3: consoleOut.Append("available info: "); foreach (String name in scan.infoTable.Keys) { consoleOut.Append("\"" + name + "\" "); } break; } writeOut.AppendLine(); consoleOut.AppendLine(); WriterClass.writeln(writeOut.ToString()); if (scan.ID % GlobalVar.ScansPerOutput == 0) { log.Info(consoleOut.ToString()); } }
private static string FormatMessage(IDs id, params object[] args) { string message; try { message = ResourceManager.GetString(id.ToString()); if (message != null) { #if DEBUG if (Regex.Matches(message, @"\{[0-9]\}").Count > args.Length) { //TODO too many placeholders or too few args... } #endif message = String.Format(message, args); } else { message = "<<<error: message not found>>>"; } return(message); } catch (Exception ex) { message = "INTERNAL ERROR while formatting error message: " + ex; } return(message); }
private void dataGridView1_RowsAdded(object sender, DataGridViewRowsAddedEventArgs e) { CurrentRow = dataGridView1.CurrentRow.Index; IDs += 1; sCurrentRow = IDs.ToString(); dataGridView1.Rows[CurrentRow + 1].Cells["ID"].Value = sCurrentRow; }
private void ParserCommand(Hashtable has) { IDs _id = (IDs)has["id"].GetHashCode(); #if UNITY_EDITOR Debug.Log(Time.frameCount + " <Color=#fff000> GameUI::Parser - " + _id.ToString() + " </Color>"); #endif switch (_id) { case IDs.InGameHandle: { if (eventHandleMessage != null) { eventHandleMessage(has["msg"].ToString()); } } break; case IDs.ActiveShowInfo: _SubInfo.ShowInfo((bool)has["show"]); break; case IDs.UpdateShowInfo: _SubInfo.UpdateInfoText(has["info"].ToString()); break; case IDs.EventSpin: { ++_spin_count; if (_spin_count >= 50) { Main.I.AppsFlyerEvent(AFInAppEvents.GAME, AFInAppEvents.SPIN_COUNT, _spin_count.ToString()); _spin_count = 0; } } break; } base.remove(_id); }
static CSVLine FindLineForModel(CSVTable table, IDs skillID) { foreach (CSVLine l in table.Lines) { if (l[0].ParseText() == skillID.ToString()) { return(l); } } return(null); }
static _DATA_TYPE_ GetDataFromCSVTable <_DATA_TYPE_>(IRogueUI ui, CSVTable table, Func <CSVLine, _DATA_TYPE_> fn, IDs skillID) { // get line for id in table. CSVLine line = FindLineForModel(table, skillID); if (line == null) { throw new InvalidOperationException(String.Format("skill {0} not found", skillID.ToString())); } // get data from line. _DATA_TYPE_ data; try { data = fn(line); } catch (Exception e) { throw new InvalidOperationException(String.Format("invalid data format for skill {0}; exception : {1}", skillID.ToString(), e.ToString())); } // ok. return(data); }
private static string FormatMessage(IDs id, params object[] args) { string message; try { message = ResourceManager.GetString(id.ToString()); if (message != null) { #if DEBUG if (Regex.Matches(message, @"\{[0-9]\}").Count > args.Length) { //TODO too many placeholders or too few args... } #endif message = String.Format(message, args); } else message = "<<<error: message not found>>>"; return message; } catch (Exception ex) { message = "INTERNAL ERROR while formatting error message: " + ex.ToString(); } return message; }
private void ParserCommand(Hashtable has) { IDs _id = (IDs)has["id"].GetHashCode(); #if UNITY_EDITOR Debug.Log(Time.frameCount + " <Color=#fff000> UI::Parser - " + _id.ToString() + " </Color>"); #endif switch (_id) { case IDs.TouchLock: SetTouchLock(true); break; case IDs.TouchUnLock: SetTouchLock(false); break; case IDs.RQCheckDeal: RQCheckDeal(); return; case IDs.RQOutOfCoin: RQOutOfCoin(); return; case IDs.RQGetBuyCoins: RQGetBuyCoins(); return; case IDs.RQCoinsStore: RQCoinsStore(has["tag"].ToString(), has["promotion"].ToString()); return; case IDs.UpdateBuyButton: UpdateCoinsButton(); break; case IDs.PopCoinsStore: SetTouchLock(false); Main.I.AppsFlyerEvent(AFInAppEvents.SHOP, AFInAppEvents.OPEN_SHOP, "CoinsStore"); Coins.ShowShopCoins(true); break; case IDs.PopDailySpinShop: SetTouchLock(false); Main.I.AppsFlyerEvent(AFInAppEvents.SHOP, AFInAppEvents.OPEN_SHOP, "DailySpinShop"); Popup.ShowPopup <UIPopDailySpinShop>("DailySpinShop", (int)_id, null, null); break; case IDs.PopFirstPurchaseOffer: SetTouchLock(false); Main.I.AppsFlyerEvent(AFInAppEvents.SHOP, AFInAppEvents.OPEN_SHOP, "FirstPurchaseOffer"); Popup.ShowPopup <UIPopFirstPurchaseOffer>("FirstPurchaseOffer", (int)_id, null, null); break; case IDs.PopSweetOffer: SetTouchLock(false); Main.I.AppsFlyerEvent(AFInAppEvents.SHOP, AFInAppEvents.OPEN_SHOP, "SweetOffer"); Popup.ShowPopup <UIPopSweetOffer>("SweetOffer", (int)_id, null, null); break; case IDs.PopDailySpin: SetTouchLock(false); Popup.ShowPopup <UIPopDailySpin>("DailySpin", (int)_id, null); break; case IDs.PopGift: if (Facebook.Unity.FB.IsLoggedIn) //로그인상태일때는 친구갱신 후 팝업// { SetTouchLock(true); Main.FB.StartCoroutine(Main.FB.LoadAppFriends(() => { SetTouchLock(false); Gift.Initialize(); Gift.gameObject.SetActive(true); Gift.SetParamsData((int)_id, null, null); })); } else { Gift.Initialize(); Gift.gameObject.SetActive(true); Gift.SetParamsData((int)_id, null, null); } break; case IDs.PopSetting: SetTouchLock(false); Popup.ShowPopup <UIPopSettings>("Settings", (int)_id, null); break; case IDs.PopPurchaseSuccessful: SetTouchLock(false); if (has["first"] != null) { Popup.ShowPopup <UIPopPurchaseSuccessful>("PurchaseSuccessful", (int)_id, null, has["coins"], has["first"]); } else { Popup.ShowPopup <UIPopPurchaseSuccessful>("PurchaseSuccessful", (int)_id, null, has["coins"]); } break; } remove(_id); }
void ParserCommand(Hashtable has) { IDs _currentId = (IDs)has["id"].GetHashCode(); #if UNITY_EDITOR Debug.Log(Time.frameCount + " <Color=#fff000> BroadCastUI::ParserCommand - " + _currentId.ToString() + " </Color>"); #endif switch (_currentId) { case IDs.SendWinCast: SendWinCast(has["msg"].ToString()); break; case IDs.SendWinLike: if (eView.Game == Main.I.CurrentView) { SendWinLike(has["msg"].ToString()); } break; } remove(_currentId); }