示例#1
0
 /// <summary>
 /// Hello
 /// </summary>
 /// <param name="message"></param>
 public void Hello(WinjsLib.Message message)
 {
     if (!this.CheckAccess())
     {
         this.Dispatcher.Invoke(DispatcherPriority.Send, new WinjsLib.EventControl.WinjsEvent(Hello), message);
         return;
     }
     Send(message.Response, "欢迎使用WinJs,如有建议或需求,请联系作者[email protected]");
 }
示例#2
0
 /// <summary>
 /// 开发者模式
 /// </summary>
 /// <param name="message"></param>
 public void ShowDevTools(WinjsLib.Message message)
 {
     if (!this.CheckAccess())
     {
         this.Dispatcher.Invoke(DispatcherPriority.Send, new WinjsLib.EventControl.WinjsEvent(ShowDevTools), message);
         return;
     }
     //WinMs ms = JsonConvert.DeserializeObject<WinMs>(message.Json);
     webBrowser.WebBrowser.ShowDevTools();
     Send(message.Response, null);
 }
示例#3
0
 /// <summary>
 /// 最小化
 /// </summary>
 /// <param name="message"></param>
 public void Minimize(WinjsLib.Message message)
 {
     if (!this.CheckAccess())
     {
         this.Dispatcher.Invoke(DispatcherPriority.Send, new WinjsLib.EventControl.WinjsEvent(Minimize), message);
         return;
     }
     //WinMs ms = JsonConvert.DeserializeObject<WinMs>(message.Json);
     this.WindowState = System.Windows.WindowState.Minimized;
     Send(message.Response, null);
 }
示例#4
0
        /// <summary>
        /// 设置高度
        /// </summary>
        /// <param name="message"></param>
        public void SetHeight(WinjsLib.Message message)
        {
            if (!this.CheckAccess())
            {
                this.Dispatcher.Invoke(DispatcherPriority.Send, new WinjsLib.EventControl.WinjsEvent(SetHeight), message);
                return;
            }
            WPFMs ms = JsonConvert.DeserializeObject <WPFMs>(message.Json);

            this.Height = ms.Height;
            Send(message.Response, null);
        }
示例#5
0
        /// <summary>
        /// 跳转
        /// </summary>
        /// <param name="message"></param>
        public void Url(WinjsLib.Message message)
        {
            if (!this.CheckAccess())
            {
                this.Dispatcher.Invoke(DispatcherPriority.Send, new WinjsLib.EventControl.WinjsEvent(Url), message);
                return;
            }
            WPFMs ms = JsonConvert.DeserializeObject <WPFMs>(message.Json);

            this.webBrowser.Load(ms.Url);
            Send(message.Response, null);
        }
示例#6
0
 /// <summary>
 /// 返回
 /// </summary>
 /// <param name="message"></param>
 public void Close(WinjsLib.Message message)
 {
     if (!this.CheckAccess())
     {
         this.Dispatcher.Invoke(DispatcherPriority.Send, new WinjsLib.EventControl.WinjsEvent(Close), message);
         return;
     }
     //WinMs ms = JsonConvert.DeserializeObject<WinMs>(message.Json);
     this.Hide();
     this.Close();
     System.Environment.Exit(0);
     Send(message.Response, null);
 }