void Show(bool fullFade) { windowModel.Hide <AsyncLoaderWindow>(); AsyncLoaderWindowConstructor constructor = new AsyncLoaderWindowConstructor(fullFade); windowFactory.CreateWindow <AsyncLoaderWindow, AsyncLoaderWindowConstructor>(constructor).Show(); }
private void UpdateRules(object obj) { var sendToAmazon = false; var viewModel = new AwsSettingsViewModel(RuleApplicationService.RuleApplicationDef); var window = WindowFactory.CreateWindow("Service Settings", new AwsSettingsView(viewModel), false, Strings.OK, Strings.Cancel); window.ButtonClicked += delegate(object sender, WindowButtonClickedEventArgs <AwsSettingsView> args) { if (args.ClickedButtonText == Strings.OK) { _awsServiceInfo.TopEntityName = viewModel.EntityName; _awsServiceInfo.AwsFunctionName = viewModel.AwsFunctionName; _awsServiceInfo.ReturnDefinition = viewModel.ReturnDefinition; sendToAmazon = true; } window.Close(); }; window.Show(); if (sendToAmazon) { var waitWindow = new BackgroundWorkerWaitWindow("Beaming rules...", "Creating temporary rule application file...", true, false, true); waitWindow.DoWork += delegate { InRuleJavaScriptDistributionService.GenerateIndexFile(_awsServiceInfo); var javaScript = InRuleJavaScriptDistributionService.GetJavaScriptRules(RuleApplicationService.RuleApplicationDef); AwsConnection.UpdateLambdaFunction(_awsServiceInfo.AwsFunctionName, javaScript); }; waitWindow.RunWorkerCompleted += delegate(object sender, RunWorkerCompletedEventArgs e) { var error = e.Error; if (error != null) { var text = $"The following error occurred:\n\n{error.Message}"; MessageBoxFactory.Show(text, "Error getting JavaScript", MessageBoxFactoryImage.Warning); } else if (e.Result != null) { var lines = ((string)e.Result).Split(new[] { Environment.NewLine }, StringSplitOptions.RemoveEmptyEntries); WindowFactory.ShowLabeledListWindow("Output", "The following information was returned:", lines); } }; waitWindow.ShowDialog(); } }
protected TWindow CreateWindow <TWindow>(Func <TWindow> func, string title) where TWindow : WindowCore { var constructionParams = new FrameWindowConstructionParams(); WindowExStyles exStyles = WindowExStyles.WS_EX_APPWINDOW | WindowExStyles.WS_EX_NOREDIRECTIONBITMAP; TWindow window = windowFactory.CreateWindow(func, title, constructionParams: constructionParams, exStyles: exStyles); windows.Add(window); return(window); }
static int Main(string[] args) { string startUrl = "https://www.google.com/"; ChromelyConfiguration config = ChromelyConfiguration.Create().WithAppArgs(args).WithHostSize(1000, 600).WithCustomSetting(CefSettingKeys.SingleProcess, true).WithStartUrl(startUrl); WindowFactory factory = WinapiHostFactory.Init(); using (CefGlueBrowserHost window = factory.CreateWindow(() => new CefGlueBrowserHost(config), "chromely", constructionParams: new FrameWindowConstructionParams())) { window.SetSize(config.HostWidth, config.HostHeight); window.CenterToScreen(); window.Show(); return(new EventLoop().Run(window)); } }
public async void CompareData() { DateTime point = await DataPlot.Pick(); var data = DataPlot.Data.Where(d => d.IsComparable && d.Maximum > point && d.Minimum < point) .Select(d => d.GetDataPoint(point)); if (data.Count() > 0) { string format = "HH:mm:ss on ddd dd'/'MM'/'yyyy"; var model = new PieModel("Power production comparison at " + point.ToString(format, CultureInfo.CreateSpecificCulture("en-US"))); foreach (var d in data) { model.Data.Add(d); } WindowFactory.CreateWindow(model); } }
/// <summary> /// Creates and adds the specified game Windows to the simulation if it does not already exist in the list of /// modes. /// </summary> /// <param name="window">Enumeration value of the Windows which should be created.</param> public void Add(Type window) { lock (windowList) { // Check if any other modes match the one we are adding. if (windowList.ContainsKey(window)) { // If Windows is attempted to be added we will fire activate for it so Windows knows it was added again without having to call post create. windowList[window].OnWindowActivate(); return; } // Create the game Windows using factory. var modeProduct = windowFactory.CreateWindow(window); // Add the game Windows to the simulation now that we know it does not exist in the stack yet. windowList.Add(window, modeProduct); OnWindowAdded(); } }
protected override void OnClick() { windowFactory.CreateWindow <SettingsWindow>().Show(); }
private void Login(string loginUrl) { Window NextWindow = WindowFactory.CreateWindow(loginUrl); WindowFactory.Show(this, NextWindow); }
protected override void OnClick() { windowFactory.CreateWindow <AvatarsWindow, AvatarsWindowConstructor>().Show(); }
private void OnEnterLogin(object parametr) { int count = 0; foreach (var item in Users) { if (item.UserLogin.Equals(_login) && item.Password.Equals(_password)) { if (item.UserLogin.Equals("Admin")) { var windowAdmin = WindowFactory.CreateWindow(new WindowCreationOptions() { WindowSize = new WindowSize(new Size(800, 450)), Title = "Admin menu", Tag = "AdminWindow", SizeToContent = SizeToContent.Height }); var adminControl = new AdminControl(); windowAdmin.Content = adminControl; Application.Current.MainWindow.Hide(); var resultAdmin = windowAdmin.ShowDialog(); Application.Current.MainWindow.Show(); if (!resultAdmin != true) { return; } break; } else { var windowDispatcher = WindowFactory.CreateWindow(new WindowCreationOptions() { WindowSize = new WindowSize(new Size(800, 450)), Title = "Dispatcher menu", Tag = "DispatcherWindow", SizeToContent = SizeToContent.Height, }); var dispatcharControl = new DispatcherControl(); windowDispatcher.Content = dispatcharControl; Application.Current.MainWindow.Hide(); var resultDispatcher = windowDispatcher.ShowDialog(); Application.Current.MainWindow.Show(); if (!resultDispatcher != true) { return; } break; } } else { count++; } if (Users.Count == count) { IsConnectedAdmin = false; IsConnectedDispatcher = false; MessageBox.Show("Не верно введены данные!!!"); } } //var login = Users.Select(x => new { Login = x.UserLogin, Password = x.Password }).Where(x => x.Login.Equals(Login) && x.Password.Equals(Password));//.Where(x=> x.Equals(Password)); //if (login.Count() != 0) //{ //} }
protected override void OnClick() { windowFactory.CreateWindow <CustomizationWindow, CustomizationWindowConstructor>().Show(); }
protected override void OnClick() { windowFactory.CreateWindow <AboutWindow>().Show(); }
public void AddData() { WindowFactory.CreateWindow(new AddWindowModel(DataPlot)); }
public void CreateWindow(WindowEnum winEnum) { windowFactory.CreateWindow(winEnum).Show(); }
public override void Execute() { var constructor = new CurrencyBonusWindowConstructor(amount); windowFactory.CreateWindow <CurrencyBonusWindow, CurrencyBonusWindowConstructor>(constructor).Show(); }
protected override void OnClick() { windowFactory.CreateWindow <LeaderboardWindow>().Show(); }
protected override void OnClick() { var window = windowFactory.CreateWindow <ClearDataWindow>(); window.Show(); }
/// <summary> /// Get visible window /// </summary> /// <param name="title">Title text of window displayed on desktop</param> /// <param name="option">Option which would be used to initialize the window.</param> /// <returns></returns> /// <exception cref="UIItemSearchException">The application type is not supported by White</exception> public virtual Window GetWindow(string title, InitializeOption option) { WindowSession windowSession = applicationSession.WindowSession(option); return(windowFactory.CreateWindow(title, process, option, windowSession)); }
public override void Execute() { var constructor = new RetentionBonusWindowConstructor(Icon); windowFactory.CreateWindow <RetentionBonusWindow, RetentionBonusWindowConstructor>(constructor).Show(); }