Esempio n. 1
0
        /// <summary>
        ///     Read the saved Xml to load the hotkey
        /// </summary>
        /// <param name="reader">XmlReader</param>
        public void ReadXml(XmlReader reader)
        {
            reader.MoveToContent();

            if (reader.IsEmptyElement)
            {
                reader.Read();
                return;
            }

            reader.Read();
            while (reader.EOF == false)
            {
                if (reader.IsStartElement())
                {
                    switch (reader.Name)
                    {
                    case "modifiers":
                        Modifiers = (WinAPI.KeyModifiers)BitConverter.ToInt32(
                            Authenticator.StringToByteArray(reader.ReadElementContentAsString()), 0);
                        break;

                    case "key":
                        Key = (WinAPI.VirtualKeyCode)BitConverter.ToUInt16(
                            Authenticator.StringToByteArray(reader.ReadElementContentAsString()), 0);
                        break;

                    case "action":
                        Action = (HotKeyActions)Enum.Parse(typeof(HotKeyActions),
                                                           reader.ReadElementContentAsString(), true);
                        break;

                    case "window":
                        Window = reader.ReadElementContentAsString();
                        break;

                    case "advanced":
                        Advanced = reader.ReadElementContentAsString();
                        break;

                    default:
                        reader.Skip();
                        break;
                    }
                }
                else
                {
                    reader.Read();
                    break;
                }
            }
        }
Esempio n. 2
0
		/// <summary>
		/// Read the saved Xml to load the hotkey
		/// </summary>
		/// <param name="reader">XmlReader</param>
    public void ReadXml(XmlReader reader)
    {
      reader.MoveToContent();

      if (reader.IsEmptyElement)
      {
        reader.Read();
        return;
      }

      reader.Read();
      while (reader.EOF == false)
      {
        if (reader.IsStartElement())
        {
          switch (reader.Name)
          {
            case "modifiers":
      				Modifiers = (WinAPI.KeyModifiers)BitConverter.ToInt32(Authenticator.StringToByteArray(reader.ReadElementContentAsString()), 0);
              break;

            case "key":
              Key = (WinAPI.VirtualKeyCode)BitConverter.ToUInt16(Authenticator.StringToByteArray(reader.ReadElementContentAsString()), 0);
              break;

						case "action":
							Action = (HotKeyActions)Enum.Parse(typeof(HotKeyActions), reader.ReadElementContentAsString(), true);
							break;

						case "window":
							Window = reader.ReadElementContentAsString();
							break;

						case "advanced":
							Advanced = reader.ReadElementContentAsString();
							break;

						default:
              reader.Skip();
              break;
          }
        }
        else
        {
          reader.Read();
          break;
        }
      }
    }
Esempio n. 3
0
 /// <summary>
 ///     Create a new HotKey
 /// </summary>
 public HotKey()
 {
     Action = HotKeyActions.Notify;
 }
Esempio n. 4
0
		/// <summary>
		/// Create a new HotKey
		/// </summary>
		public HotKey()
		{
			Action = HotKeyActions.Notify;
		}