示例#1
0
 public void ShowEdit(Form parent, Emoticon emoticon)
 {
     this.emoticon = emoticon;
     this.Text     = "Edit Emoticon";
     ShowInternal(parent);
 }
示例#2
0
        /// <summary>
        /// Reads database return values into a list of Emoticons.
        /// </summary>
        /// <param name="reader"></param>
        /// <returns></returns>
        public List <Emoticon> ParseEmoticonResult(DbDataReader reader)
        {
            List <Emoticon> emoticons = new List <Emoticon>();

            while (reader.Read())
            {
                Emoticon emot = new Emoticon();

                string guid     = ReadString(reader, "guid", "");
                string name     = ReadString(reader, "name", "");
                string category = ReadString(reader, "category", "");


                string parentGuid         = ReadString(reader, "parentGuid", "");
                string keyboardEquivalent = ReadString(reader, "keyboardEquivalent", "");
                string keyboardRegex      = ReadString(reader, "keyboardRegex", "");
                int    flags = ReadInt(reader, "flags", 0);

                object value = reader.GetValue(reader.GetOrdinal("data"));
                byte[] data;
                if (value == DBNull.Value)
                {
                    data = null;
                }
                else
                {
                    data = (byte[])value;
                }
                long lastUsed = ReadLong(reader, "lastUsed", 0);
                int  type     = ReadInt(reader, "type", -1);


                if (keyboardEquivalent != null)
                {
                    string[] keyboardEquivalentSplit = keyboardEquivalent.Split(';');

                    for (int i = 0; i < keyboardEquivalentSplit.Length; i++)
                    {
                        keyboardEquivalentSplit[i] = keyboardEquivalentSplit[i].Replace(":,", ";").Replace("::", ":");
                    }
                    emot.keyboardEquivalent = keyboardEquivalentSplit;
                }
                else
                {
                    emot.keyboardEquivalent = new string[0];
                }

                emot.guid          = guid;
                emot.name          = name;
                emot.category      = category;
                emot.type          = type;
                emot.data          = data;
                emot.lastUsed      = lastUsed;
                emot.parentGuid    = parentGuid;
                emot.keyboardRegex = keyboardRegex;
                emot.flags         = flags;

                emoticons.Add(emot);
            }
            return(emoticons);
        }
示例#3
0
 public Emoticon ShowNew(Form parent)
 {
     emoticon  = new Emoticon();
     this.Text = "New Emoticon";
     return(ShowInternal(parent));
 }