示例#1
0
 static WinceComponent FromWinComponent(WinComponent c)
 {
     if (WinceComboBox.Check(c))
     {
         return(new WinceComboBox(c.Handle));
     }
     else if (WinceButton.Check(c))
     {
         return(new WinceButton(c.Handle));
     }
     else if (WinceCheckBox.Check(c))
     {
         return(new WinceCheckBox(c.Handle));
     }
     else if (WinceTextBox.Check(c))
     {
         return(new WinceTextBox(c.Handle));
     }
     else if (WinceLabel.Check(c))
     {
         return(new WinceLabel(c.Handle));
     }
     else if (WinceRadio.Check(c))
     {
         return(new WinceRadio(c.Handle));
     }
     else if (WinceListBox.Check(c))
     {
         return(new WinceListBox(c.Handle));
     }
     else if (WinceContainer.Check(c))
     {
         return(new WinceContainer(c.Handle));
     }
     else
     {
         throw new NotImplementedException(string.Format("handle {0:X} unsupported", c.Handle));
     }
 }
示例#2
0
 public static bool Check(WinComponent e)
 {
     return(e.Class.ToLower().Contains("button") && !WinceCheckBox.Check(e) && !WinceRadio.Check(e));
 }