Beispiel #1
0
        protected override IXCustomControl HostNetControl(Control winCtrlHost, TControl ctrl, string title, IXImage image)
        {
            if (m_PmpCtrl.SetWindowHandlex64(winCtrlHost.Handle.ToInt64()))
            {
                if (ctrl is IXCustomControl)
                {
                    return((IXCustomControl)ctrl);
                }
                else
                {
                    if (ctrl is System.Windows.FrameworkElement)
                    {
                        return(new WpfCustomControl((System.Windows.FrameworkElement)(object) ctrl, winCtrlHost));
                    }

                    throw new NotSupportedException($"'{ctrl.GetType()}' must implement '{typeof(IXCustomControl).FullName}' or inherit '{typeof(System.Windows.FrameworkElement).FullName}'");
                }
            }
            else
            {
                throw new NetControlHostException(winCtrlHost.Handle);
            }
        }
 public bool SetWindowHandlex64(long WindowHandle)
 {
     return(handler.SetWindowHandlex64(WindowHandle));
 }