Beispiel #1
0
        /// <summary>
        /// 撤销缓存区文本
        /// </summary>
        /// <param name="t"></param>
        /// <param name="keys"></param>
        public static object cancelTextBoxCache(Dictionary <Type, object> data)
        {
            TextBox t = (TextBox)data[typeof(TextBox)];

            // 非只读才能撤销
            if (!t.ReadOnly)
            {
                // 将文本框置于撤销状态
                TextBoxUtils.TextBoxAddTag(t, TextBoxTagKey.TEXTBOX_IS_CANCEL, true);
                TextBoxCache.cancelCache(t);
            }

            return(null);
        }
Beispiel #2
0
 /// <summary>
 /// 撤销缓存区文本
 /// </summary>
 /// <param name="t"></param>
 /// <param name="keys"></param>
 public static object cancelTextBoxCache(Dictionary <Type, object> data)
 {
     if (data.ContainsKey(typeof(TextBox)) && data[typeof(TextBox)] is TextBox)
     {
         TextBox t = (TextBox)data[typeof(TextBox)];
         // 非只读状态才能撤销
         if (!t.ReadOnly)
         {
             // 将文本框置于撤销状态
             TextBoxUtils.TextBoxAddTag(t, TextBoxTagKey.TEXTBOX_IS_CANCEL, true);
             TextBoxCache.cancelCache(t);
         }
     }
     else
     {
         MessageBox.Show("无法获取文本框");
     }
     return(null);
 }