public class KeyboardHandler : IKeyboardHandler
{
public bool OnPreKeyEvent(IWebBrowser chromiumWebBrowser, IBrowser browser, KeyType type, int windowsKeyCode, int nativeKeyCode, CefEventFlags modifiers, bool isSystemKey, ref bool isKeyboardShortcut)
{
if (type == KeyType.KeyUp && Enum.IsDefined(typeof(Keys), windowsKeyCode))
{
var key = (Keys)windowsKeyCode;
switch (key)
{
case Keys.F5:
browser.Reload(true);
break;
}
}
return false;
}
public bool OnKeyEvent(IWebBrowser chromiumWebBrowser, IBrowser browser, KeyType type, int windowsKeyCode, int nativeKeyCode, CefEventFlags modifiers, bool isSystemKey)
{
var result = false;
return result;
}
}
}
[Serializable]
[XmlRoot(ElementName = "radiostation")]
public class Radiostation
{
[XmlElement(ElementName = "country")]
public string Country { get; set; }
[XmlElement(ElementName = "genre")]
public string Genre { get; set; }
[XmlElement(ElementName = "subgenre")]
public string Subgenre { get; set; }
[XmlElement(ElementName = "title")]
public string Title { get; set; }
[XmlElement(ElementName = "urlwww")]
public string Urlwww { get; set; }
[XmlElement(ElementName = "ico")]
public string Ico { get; set; }
[XmlAttribute(AttributeName = "name")]
public string Name { get; set; }
}
[Serializable]
[XmlRoot(ElementName = "users")]
public class Members
{
[XmlElement(ElementName = "radiostation")]
public Radiostation Radiostation { get; set; }
}
var fileStream = new FileStream(XMLFileName, FileMode.Open);
XmlSerializer serializer = new XmlSerializer(typeof(Radiostation));
var _nds = (Radiostation)serializer.Deserialize(fileStream);
editTitleRadiostation.Text = _nds.Name;
editCountryPanel.Text = _nds.Country;
editGenrePanel.Text = _nds.Genre;
editSubGenrePanel.Text = _nds.Subgenre;
editUrlPanel.Text = _nds.Urlwww;
editIcoPanel.Text = _nds.Ico;