public void OpenExecute() { var openWindow = new OpenWindow(); openWindow.Show(); CloseWindow(); }
public override void ClientSide(FormCollection OpenWindows, CreateClientWindow CreateWindow, Connection ThisConnection) { //CLOSE THE STATUS WINDOW ONCE THE FILE GET IS COMPLETE foreach (Form OpenWindow in OpenWindows) { if (OpenWindow.Text == "Get Status") { OpenWindow.Invoke((MethodInvoker) delegate { OpenWindow.Close(); }); break; } } //IF THE USER SELECTED A DOWNLOAD LOCATION THEN SAVE THE FILE, OTHERWISE OPEN WITH INTERNET EXPLORER if (string.IsNullOrEmpty(this.SaveLocation)) { string tmpFileName = Path.Combine(Path.GetTempPath(), this.FileName); File.WriteAllBytes(tmpFileName, this.FileBytes); //CREATE AN IE PROCESS AND LAUNCH IT WITH THE FILE AS THE PARAMETER Process tmpProc = new Process(); tmpProc.StartInfo = new ProcessStartInfo("IExplore.exe", tmpFileName); tmpProc.Start(); } else { //SAVE THE FILE TO THE SAVE LOCATION AND LET THE USER KNOW IT IS DONE File.WriteAllBytes(this.SaveLocation, this.FileBytes); MessageBox.Show("File Download Complete"); } }
public void OpenProject() { var open = new OpenWindow() { Owner = this }; open.OpenProject(EditorController.Runtime); Task.Factory.StartNew(() => { if (open.LoadTask != null) { OperationProgressing progressing = null; Dispatcher.Invoke(new Action(() => { progressing = new OperationProgressing() { Owner = this }; })); Dispatcher.BeginInvoke(new Action(() => { progressing.ShowDialog(); })); open.LoadTask.Wait(); Dispatcher.BeginInvoke(new Action(() => { progressing.Close(); })); } EditProject(open.ProjectSession); }); }
public void Handle(OpenWindow <Location> message) { var vm = message.ViewModel; var activatedFeatures = repository.GetActivatedFeatures(vm); OpenWindow(vm.ToDetailViewModel(activatedFeatures)); }
[MenuItem("Help/将Dll放进来 %q")] //Ctrl + Q static void PullDllComeIn() { string savePath = Application.dataPath; string firstDllPath; if (OpenWindow.ChooseFile(@"F:\MyNewDll", out firstDllPath)) { string fileName = MyAssetUtil.GetFileNameByFullName(firstDllPath); if (!MyAssetUtil.GetFileSuffix(fileName).Equals("dll")) { MyLog.Orange("选择的文件不是dll ——" + fileName); return; } string saveDllPath; if (OpenWindow.ChooseFloder(savePath, out saveDllPath)) { saveDllPath = saveDllPath + "/" + fileName; MyIO.FileCopy(firstDllPath, saveDllPath); } else { MyLog.Green("取消操作"); } } else { MyLog.Green("取消操作"); } AssetDatabase.Refresh(); }
public void ShowDetails() { if (ActiveItem != null) { var message = new OpenWindow <T>(ActiveItem.Item); eventAggregator.BeginPublishOnUIThread(message); } }
private void OnGUI() { GUILayout.BeginHorizontal("Box"); if (GUILayout.Button("新建脚本", GUILayout.Width(250), GUILayout.Height(50))) { //新建脚本 Debug.Log("新建脚本"); Rect rect = new Rect(50, 50, 520, 500); EditWindow window = (EditWindow)GetWindowWithRect(typeof(EditWindow), rect, true); GlobalState.datas = new List <BaseData>(); } if (GUILayout.Button("打开上次编辑的脚本", GUILayout.Width(250), GUILayout.Height(50))) { //打开脚本 Debug.Log("打开脚本"); string path = null; if (File.Exists(GlobalState.editSaveData)) { StreamReader sr = new StreamReader(GlobalState.editSaveData); while (!sr.EndOfStream) { path = sr.ReadLine(); } sr.Dispose(); sr.Close(); OpenWindow window = (OpenWindow)GetWindow(typeof(OpenWindow), true); window.openScenario = AssetDatabase.LoadAssetAtPath(path, typeof(TextAsset)) as TextAsset; window.Show(); } else { Debug.LogError("未找到存档文件"); } } GUILayout.EndHorizontal(); GUILayout.BeginHorizontal("Box"); if (GUILayout.Button("保存脚本", GUILayout.Width(250), GUILayout.Height(50))) { //保存脚本 Debug.Log("保存脚本"); SaveWindow window = (SaveWindow)GetWindowWithRect(typeof(SaveWindow), new Rect(0, 0, 500, 50), true); window.Show(); } if (GUILayout.Button("查看脚本", GUILayout.Width(250), GUILayout.Height(50))) { //查看脚本 Debug.Log("查看脚本"); OpenWindow window = (OpenWindow)GetWindow(typeof(OpenWindow), true); window.Show(); } GUILayout.EndHorizontal(); }
protected void ToSave(object sender, EventArgs e) { sSQL = "select * from _LookUpType where iID='" + TextBox1.Text + "'"; DataTable dt = clsSQLCommond.ExecQuery(sSQL); if (YxBtn.HidID != "" && dt.Rows.Count > 0) { OpenWindow ow = new OpenWindow(); ow.Alert(Page, "序号重复"); } else { SqlConnection con = new SqlConnection(clsSQLCommond.Online); SqlCommand cmd = new SqlCommand(); SqlTransaction trans; con.Open(); cmd.Connection = con; trans = con.BeginTransaction(); cmd.Transaction = trans; try { #region 主表 Sql sc = new Sql(); if (YxBtn.HidID == "") { sc.Get(tablename, tableid, TextBox1.Text, true); } else { sc.Get(tablename, tableid, TextBox1.Text, false); } sc.ToString("iType", TextBox2.Text); sc.ToString("iType2", TextBox3.Text); sc.ToString("Remark", TextBox7.Text); cmd.CommandText = sc.ReturnSql(); cmd.ExecuteNonQuery(); #endregion trans.Commit(); } catch { trans.Rollback(); Response.Redirect("../ErrorPage.aspx"); } finally { if (con.State == ConnectionState.Open) { con.Close(); } Response.Redirect("LookUpType_Index.aspx"); } } }
protected override void OnExecute(object parameter) { OpenWindow openWindow = new OpenWindow(); if (openWindow.ShowDialog().Value) { ProjectMgr.Instance.OpenProject(openWindow.File); } }
public Controller(Canvas canvas) { _roomView = new RoomView(canvas); _eventView = new EventView(); _model = Model.Model.GetModel(_roomView, _eventView); _roomView.Draw(); var w = new OpenWindow(); w.ShowDialog(); }
private void OnNewOpenWindowMessage(OpenWindow obj) { switch (obj.WindowName) { case "NewContact": AddContactWindow w = new AddContactWindow(); w.ShowDialog(); break; } }
public override void ClientSide(FormCollection OpenWindows, CreateClientWindow CreateWindow, Connection ThisConnection) { //FIND THE WINDOW WHICH HAS THE CORRECT TAG AND UPDATE THE STATUS SO THE USER KNOWS THEY HAVE ENTERED IN TEXT foreach (Form OpenWindow in OpenWindows) { if ((string)OpenWindow.Tag == this.ConversationID) { OpenWindow.Invoke((MethodInvoker) delegate { ((IConversationWindow)OpenWindow).EnteredText(this.Sender); }); } } }
// Check if the Add New Download window is already open public static bool IsWindowAlreadyOpen(Type WindowType) { foreach (Window OpenWindow in Application.Current.Windows) { if (OpenWindow.GetType() == WindowType) { return(true); } } return(false); }
public override void ClientSide(FormCollection OpenWindows, CreateClientWindow CreateWindow, Connection ThisConnection) { //FIND THE WINDOW ASSOCIATED TO THIS CONVERSATION ID AND UPDATES ITS TITLE foreach (Form OpenWindow in OpenWindows) { if ((string)OpenWindow.Tag == this.ConversationID) { OpenWindow.Invoke((MethodInvoker) delegate { OpenWindow.Text = string.Format("{0} - Conversation", string.Join("; ", this.Recipients)); }); } } }
public void ShowDetails() { if (ActiveItem != null) { var vm = new DetailViewModel( string.Format("{0}: {1}", ActiveItem.GetType().Name, ActiveItem.DisplayName), ActiveItem.GetAsPropertyList() ); var message = new OpenWindow(vm); eventAggregator.BeginPublishOnUIThread(message); } }
static int Close(IntPtr L) { try { ToLua.CheckArgsCount(L, 1); OpenWindow obj = (OpenWindow)ToLua.CheckObject <OpenWindow>(L, 1); obj.Close(); return(0); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e)); } }
static int Open(IntPtr L) { try { ToLua.CheckArgsCount(L, 2); OpenWindow obj = (OpenWindow)ToLua.CheckObject <OpenWindow>(L, 1); string arg0 = ToLua.CheckString(L, 2); obj.Open(arg0); return(0); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e)); } }
private static void _notifyIcon_BalloonTipClicked(object sender, EventArgs e) { // Если это системное сообщение if (_notifyIcon.BalloonTipTitle == Settings.TitleUpdate) { CheckUpdates?.Invoke(null, EventArgs.Empty); } string windowTitle = _notifyIcon.Tag as string; if (windowTitle != null && windowTitle.Length > 0) { OpenWindow?.Invoke(null, new WindowEventArgs(windowTitle)); } }
/// <summary>Tries to return a previously-initialised window of type <typeparamref name="T"/>.</summary> /// <typeparam name="T"></typeparam> /// <param name="App">The application.</param> /// <param name="Found">The found <see cref="Window"/> (of type <typeparamref name="T"/>).</param> /// <returns><see cref="bool"/></returns> public static bool TryGetWindow <T>(this Application App, out T Found) where T : Window { // ReSharper disable once LoopCanBePartlyConvertedToQuery foreach (Window OpenWindow in App.Windows) { if (OpenWindow.GetType() == typeof(T)) { Found = (T)OpenWindow; return(true); } } Found = null; return(false); }
public override void ClientSide(FormCollection OpenWindows, CreateClientWindow CreateWindow, Connection ThisConnection) { new Message_Private() { ConversationID = this.ConversationID, Sender = this.Sender, SenderID = this.SenderID, Message = string.Format(@"Has sent you a file: <a href=""getfile://{0}"">{1}</a>", this.FileID, this.FileName) }.Send(ThisConnection); foreach (Form OpenWindow in OpenWindows) { if (OpenWindow.Text == "Send Status") { OpenWindow.Invoke((MethodInvoker) delegate { OpenWindow.Close(); }); break; } } }
static int get_destroyTime(IntPtr L) { object o = null; try { o = ToLua.ToObject(L, 1); OpenWindow obj = (OpenWindow)o; float ret = obj.destroyTime; LuaDLL.lua_pushnumber(L, ret); return(1); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e, o, "attempt to index destroyTime on a nil value")); } }
static int get_backgroundColor(IntPtr L) { object o = null; try { o = ToLua.ToObject(L, 1); OpenWindow obj = (OpenWindow)o; UnityEngine.Color ret = obj.backgroundColor; ToLua.Push(L, ret); return(1); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e, o, "attempt to index backgroundColor on a nil value")); } }
private void Application_Startup(object sender, StartupEventArgs e) { Current.ShutdownMode = ShutdownMode.OnExplicitShutdown; //TODO: Add default settings, load them. var openWindow = new OpenWindow(new OpenSettings { MapsetPath = string.Empty, Method = StartMethod.Open, Remember = false }); openWindow.ShowDialog(); if (!(openWindow.Tag is OpenSettings result)) { Current.Shutdown(-1); }
static int set_destroyTime(IntPtr L) { object o = null; try { o = ToLua.ToObject(L, 1); OpenWindow obj = (OpenWindow)o; float arg0 = (float)LuaDLL.luaL_checknumber(L, 2); obj.destroyTime = arg0; return(0); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e, o, "attempt to index destroyTime on a nil value")); } }
static int set_backgroundColor(IntPtr L) { object o = null; try { o = ToLua.ToObject(L, 1); OpenWindow obj = (OpenWindow)o; UnityEngine.Color arg0 = ToLua.ToColor(L, 2); obj.backgroundColor = arg0; return(0); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e, o, "attempt to index backgroundColor on a nil value")); } }
public void OpenNewWindow(string uri, int screenNumber) { try { var popup = new OpenWindow(); var chromiumBrowser = new ChromiumWebBrowser { Address = uri }; chromiumBrowser.LifeSpanHandler = new LifeSpanHandler(); chromiumBrowser.DownloadHandler = new DownloadHandler(); chromiumBrowser.ShowPromptEvent += (count, type) => { EventAggregator.GetEvent <ShowPromptEventSignal>().Publish(new ShowPromptEventArgs() { Count = count, Type = type }); }; //IntPtr hwnd = new WindowInteropHelper(popup).Handle; chromiumBrowser.RegisterJsObject("afpbrowser", new Browser.DS_AFP_Browser_Common(chromiumBrowser, chromiumBrowser.OnStartProcess, chromiumBrowser.OnMinimize, chromiumBrowser.OnMaximize, chromiumBrowser.OnShowPrompt, chromiumBrowser.OnStartPlayer)); AddBrowser(chromiumBrowser); popup.SetBrowser(chromiumBrowser); popup.Closed += (o, e) => { var w = o as OpenWindow; if (w != null && w.Content is IWebBrowser) { (w.Content as IWebBrowser).Dispose(); w.Content = null; } }; SetScreen(popup, screenNumber); popup.Show(); } catch (Exception ex) { Logger.Error(ex); } }
private void AddButton_OnClick(object sender, RoutedEventArgs e) { IOpenWindowViewModel openWindowViewModel = ((ILapSelectionViewModel)DataContext).AddWindowViewModel; if (_addWindow == null) { openWindowViewModel.IsOpenWindowVisible = true; _addWindow = new OpenWindow { WindowStartupLocation = WindowStartupLocation.CenterScreen, Owner = Window.GetWindow(this), DataContext = openWindowViewModel }; _addWindow.Closed += AddWindowOnClosed; openWindowViewModel.RefreshRecentCommand.Execute(null); _addWindow.Show(); return; } openWindowViewModel.RefreshRecentCommand.Execute(null); openWindowViewModel.IsOpenWindowVisible = true; _openWindow.Focus(); }
public void OpenModelSystem() { OpenWindow openWindow = new OpenWindow() { Owner = this }; openWindow.OpenModelSystem(EditorController.Runtime); Task.Factory.StartNew(() => { if (openWindow.LoadTask != null) { OperationProgressing progressing = null; Dispatcher.Invoke(new Action(() => { progressing = new OperationProgressing() { Owner = this }; })); Dispatcher.BeginInvoke(new Action(() => { progressing.ShowDialog(); })); openWindow.LoadTask.Wait(); Dispatcher.BeginInvoke(new Action(() => { progressing.Close(); })); } var session = openWindow.ModelSystemSession; if (session != null) { Dispatcher.BeginInvoke(new Action(() => { EditModelSystem(session); SetStatusText("Ready"); })); } }); }
protected void ToDel(object sender, EventArgs e) { if (IsUsed(hidiType.Value, YxBtn.HidID) == false || CheckBox5.Checked == true) { OpenWindow ow = new OpenWindow(); ow.Alert(Page, "已使用或系统项,不可删除"); } else { SqlConnection con = new SqlConnection(clsSQLCommond.Online); SqlCommand cmd = new SqlCommand(); SqlTransaction trans; con.Open(); cmd.Connection = con; trans = con.BeginTransaction(); cmd.Transaction = trans; try { sSQL = "delete from " + tablename + " where " + tableid + "='" + YxBtn.HidID + "' and iType='" + hidiType.Value + "'"; cmd.CommandText = sSQL; cmd.ExecuteNonQuery(); trans.Commit(); } catch { trans.Rollback(); Response.Redirect("../ErrorPage.aspx"); } finally { if (con.State == ConnectionState.Open) { con.Close(); } Response.Redirect("LookUpData_Index.aspx"); } } }
// GET: Command public ActionResult Index() { //Remote remote = new Remote(); Window w1 = new Window(); Window w2 = new Window(); Window w3 = new Window(); OpenWindow ow = new OpenWindow(w1); Remote.InsertOnCommand(ow); Remote.InsertOffCommand(CloseGate.Instance()); Remote.InsertOffCommand(CloseGate.Instance()); Remote.PressButtonOn(0); return(View()); }
public static void Notify(object sender, GameEventArgs e) { switch (e.type) { case OPEN_WINDOW: OpenWindow?.Invoke(sender, e); break; case CLOSE_WINDOW: CloseWindow?.Invoke(sender, e); break; case HOLD_WINDOW: HoldWindow?.Invoke(sender, e); break; case RESUME_WINDOW: ResumeWindow?.Invoke(sender, e); break; case WINDOW_OPENED: OnWindowOpened?.Invoke(sender, e); break; case WINDOW_CLOSED: OnWindowClosed?.Invoke(sender, e); break; case WINDOW_HOLDED: OnWindowHolded?.Invoke(sender, e); break; case WINDOW_RESUMED: OnWindowResumed?.Invoke(sender, e); break; } }