// Use this for initialization void Start() { menu = FindObjectOfType <PopupMenu>(); dictionary = FindObjectOfType <GlobalDictionary>(); thisSprite = GetComponent <SpriteRenderer>(); Lock = FindObjectOfType <Canvas>().GetComponentInChildren <InteractionLock>(); originalColor = thisSprite.color; }
/// <summary> /// Use the Damage Popup Manager ID to get the Damage Popup Manager. /// </summary> public void SetDamagePopupManagerUsingID() { if (m_DamagePopupManagerID < 0) { return; } m_DamagePopupManager = GlobalDictionary.Get <DamagePopupManager>((uint)m_DamagePopupManagerID); }
// Use this for initialization void Start() { dictionary = FindObjectOfType <GlobalDictionary>(); Text[] menus = GetComponentsInChildren <Text>(); Menu = GetComponent <CanvasGroup>(); QuestBoard = menus[0]; Inventory = menus[1]; Menu.alpha = 0; Menu.interactable = false; Menu.blocksRaycasts = false; invis = true; UpdateMenus(); }
public HttpResponseMessage UpdatePayOrder() { HttpResponseMessage response = null; var result = false; try { PayOrder payOrder = new PayOrder(); using (var ms = new MemoryStream()) { HttpContext.Current.Request.GetBufferlessInputStream().CopyTo(ms); if (ms.Length != 0) { var cText = WebCommom.HttpRequestBodyConvertToStr(ms);//密文 var pText = AES.AESDecrypt(cText, AESKey); payOrder = JsonConvert.DeserializeObject <PayOrder>(pText); } } result = payOrderBll.Value.UdpatePayOrder(payOrder); #region 如果支付成功则通知店家发货(此处可改为异步处理) if (payOrder.TradeStatus == "") { for (int i = 0; i < payOrder.Orders.Count; i++) { var storeStaff = storeStaffBll.Value.GetReceiveDeliveryStaff(payOrder.Orders[i].BuyProduct.Store.StoreID); var phoneList = new List <string>(); for (int j = 0; j < storeStaff.Count; j++) { phoneList.Add(storeStaff[j].Phone); } SMS sms = new SMS { }; // sms.ReceiveNo = phoneList; // sms.MSGContent = ""; CommomClass.HttpPost(GlobalDictionary.GetSysConfVal("AccountApiAddr"), JsonConvert.SerializeObject(sms));//通知店铺员工发货 } } #endregion } catch (Exception ex) { } response = WebCommom.GetResponse(result); return(response); }
/// <summary> /// Remove the selected word from the user dictionary /// </summary> /// <param name="sender">The sender of the event</param> /// <param name="e">The event arguments</param> private void btnRemoveWord_Click(object sender, EventArgs e) { int idx = lbUserDictionary.SelectedIndex; if (idx != -1) { lbUserDictionary.Items.RemoveAt(idx); } if (lbUserDictionary.Items.Count != 0) { if (idx < 0) { idx = 0; } else if (idx >= lbUserDictionary.Items.Count) { idx = lbUserDictionary.Items.Count - 1; } lbUserDictionary.SelectedIndex = idx; } CultureInfo culture = (CultureInfo)cboDefaultLanguage.SelectedItem; string filename = Path.Combine(SpellCheckerConfiguration.ConfigurationFilePath, culture.Name + "_Ignored.dic"); try { File.WriteAllLines(filename, lbUserDictionary.Items.OfType <string>()); GlobalDictionary.LoadIgnoredWordsFile(culture); } catch (Exception ex) { MessageBox.Show("Unable to save user dictionary. Reason: " + ex.Message, Constants.AppName, MessageBoxButtons.OK, MessageBoxIcon.Exclamation); } }
//Awake is always called before any Start functions void Awake() { Quests = new List <Quest>(); Items = new List <Item>(); //Check if instance already exists if (instance == null) { //if not, set instance to this instance = this; } //If instance already exists and it's not this: else if (instance != this) { //Then destroy this. This enforces our singleton pattern, meaning there can only ever be one instance of a GameManager. Destroy(gameObject); } //Sets this to not be destroyed when reloading scene DontDestroyOnLoad(gameObject); }
/// <summary> /// This creates an instance of the WPF spell checker for the given text box /// </summary> /// <param name="textBox">The text box to initialize</param> private static void AddWpfSpellChecker(TextBox textBox) { // Don't do anything if the default spell checker is enabled or it's read-only if (!textBox.SpellCheck.IsEnabled && !textBox.IsReadOnly) { lock (syncRoot) { // Create the shared configuration and dictionary on first use if (configuration == null) { configuration = new SpellCheckerConfiguration(); configuration.Load(SpellingConfigurationFile.GlobalConfigurationFilename); var globalDictionaries = configuration.DictionaryLanguages.Select(l => GlobalDictionary.CreateGlobalDictionary(l, null, configuration.AdditionalDictionaryFolders, configuration.RecognizedWords)).Where( d => d != null).Distinct().ToList(); dictionary = new SpellingDictionary(globalDictionaries, configuration.IgnoredWords); } // Ignore it if disabled or it's an excluded text box string name = ElementName(textBox); if (!configuration.EnableWpfTextBoxSpellChecking || configuration.VisualStudioExclusions.Any( v => v.IsMatch(name))) { return; } } var wsc = new WpfTextBoxSpellChecker(textBox); wpfSpellCheckers.AddOrUpdate(textBox, wsc, (k, v) => wsc); } }
//===================================================================== /// <summary> /// Spell check the current document and start showing suggestions for replacement /// </summary> private bool SpellCheckCurrentDocument() { bool success = false; try { Cursor.Current = Cursors.WaitCursor; // Use the language from the current project to do the spell checking var projectExplorer = this.FindProjectExplorerWindow(); if (dictionary == null || (projectExplorer != null && projectExplorer.CurrentProject.Language != dictionary.Language)) { dictionary = GlobalDictionary.CreateGlobalDictionary(projectExplorer?.CurrentProject.Language); } if (dictionary == null) { lblMisspelledWord.Text = "Unable to create dictionary!"; } else { var speller = new FileSpellChecker(dictionary); speller.MisspelledWord += new EventHandler <SpellingEventArgs>(speller_MisspelledWord); speller.DoubledWord += new EventHandler <SpellingEventArgs>(speller_DoubledWord); string text = currentTopicWindow.GetAllText(); string ext = Path.GetExtension(currentTopicWindow.Filename).ToLowerInvariant(); switch (ext) { case ".aml": case ".axml": case ".ascx": case ".asp": case ".aspx": case ".config": case ".content": case ".htm": case ".html": case ".items": case ".sitemap": case ".snippets": case ".tokens": case ".xaml": case ".xml": case ".xsl": case ".xslt": case ".xamlcfg": using (var ms = new MemoryStream(Encoding.UTF8.GetBytes(text))) using (var reader = XmlReader.Create(ms, new XmlReaderSettings { DtdProcessing = DtdProcessing.Ignore })) { speller.SpellCheckXmlReader(reader); } break; default: speller.SpellCheckText(text); break; } success = true; } } catch (Exception ex) { System.Diagnostics.Debug.WriteLine(ex); lblMisspelledWord.Text = "Unable to spell check file: " + ex.Message; } finally { Cursor.Current = Cursors.Default; } return(success); }
/// <summary> /// Initailizes the default values. /// </summary> protected virtual void Awake() { GlobalDictionary.Set(this, m_ID); }