void AddButtonClickListeners(OptionsView view) { view.AddListener_OnResumeClicked(Resume); view.AddListener_OnMusicClicked(ToggleMusic); view.AddListener_OnControlsClicked(ToggleControlsView); view.AddListener_OnQuitClicked(SaveAndQuit); }
private void AppLoop() { while (true) { Clear(); switch (_currentView) { case View.Main: MainMenuView.ShowMainMenu(); _currentView = MainMenuView.MainMenuSelection(UserInput.OptionSelection()); break; case View.Stats: StatsView.ShowStats(); _currentView = StatsView.StatsSelection(); break; case View.AddDay: AddDayView.ShowAddDay(); _currentView = AddDayView.AddDaySelection(); break; case View.Options: OptionsView.ShowOptions(); _currentView = OptionsView.OptionsSelection(); break; default: WriteLine("Invalid input."); MainMenuView.MainMenuSelection(UserInput.OptionSelection()); break; } } }
/// <summary> /// Shows the options. /// </summary> public void ShowOptions() { TraceService.WriteLine("ApplicationController::ShowOptions"); OptionsView view = new OptionsView(); ResourceDictionary resourceDictionary = this.GetLanguageDictionary(); OptionsViewModel viewModel = this.ResolverService.Resolve <OptionsViewModel>(); viewModel.LanguageDictionary = resourceDictionary; view.DataContext = viewModel; view.ShowDialog(); //// in case any of the setting have changed to do with logging reset them! TraceService.Initialize( this.SettingsService.LogToTrace, false, //// log to console. this.SettingsService.LogToFile, this.SettingsService.ExtendedLogging, this.SettingsService.LogFilePath, this.SettingsService.DisplayErrors, this.SettingsService.ErrorFilePath); }
protected void Page_InIt(object sender, EventArgs e) { switch (OptionsView.ToUpper()) { case "DROPDOWN": BuyProductDialog1.Visible = true; BuyProductDialog1.ShowAddAndUpdateButtons = ShowAddAndUpdateButtons; BuyProductDialog1.ShowPartNumber = ShowPartNumber; BuyProductDialog1.ShowGTIN = ShowGTIN; BuyProductDialog1.GTINName = GTINName; BuyProductDialogOptionsList1.Visible = false; ProductDetailsPanel.CssClass = "simpleProduct"; break; case "TABULAR": BuyProductDialog1.Visible = false; BuyProductDialogOptionsList1.Visible = true; BuyProductDialogOptionsList1.ShowThumbnail = ShowVariantThumbnail; BuyProductDialogOptionsList1.ShowPartNumber = ShowPartNumber; BuyProductDialogOptionsList1.ShowGTIN = ShowGTIN; BuyProductDialogOptionsList1.GTINName = GTINName; ProductDetailsPanel.CssClass = "optionProduct"; break; default: BuyProductDialog1.Visible = true; BuyProductDialog1.ShowAddAndUpdateButtons = ShowAddAndUpdateButtons; BuyProductDialog1.ShowPartNumber = ShowPartNumber; BuyProductDialog1.ShowGTIN = ShowGTIN; BuyProductDialog1.GTINName = GTINName; BuyProductDialogOptionsList1.Visible = false; ProductDetailsPanel.CssClass = "simpleProduct"; break; } }
private void ShowOptionsViewCommand_OnExecute() { var optionsWindow = new OptionsView(this); optionsWindow.WindowStyle = System.Windows.WindowStyle.ToolWindow; optionsWindow.WindowStartupLocation = System.Windows.WindowStartupLocation.CenterScreen; optionsWindow.ShowDialog(); }
private OptionsModel Model; // Model attached to the Presenter public OptionsPresenter(View view, Model model) { this.View = (OptionsView)view; this.Model = (OptionsModel)model; this.View.Presenter = this; this.Model.Presenter = this; }
static private DataSet GreateSchemaDs() { DataSet ds = new DataSet("PivotGridLayout"); ds.Tables.AddRange(new DataTable[] { FieldProperty.GreateSchemaDt(), OptionsView.GreateSchemaDt() }); return(ds); }
OptionsView InstantiateOptionsView(GameObject prefab) { Transform parent = CommonObjects.ActiveCanvas.OptionsViewContainer; GameObject g = ZeldaViewController.InstantiateView(prefab, parent); OptionsView v = g.GetComponent <OptionsView>(); AddButtonClickListeners(v); return(v); }
private void ShowOptions(OptionsViewModel vm) { var view = new OptionsView { DataContext = vm }; view.ShowDialog(); }
public MainForm() { editorView = new EditorView(this); optionsView = new OptionsView(this); mainMenuView = new MainMenuView(this); InitializeComponent(); SwapView(currentView = mainMenuView); }
private void OptionsCommandExecuted(object obj) { OptionsViewModel model = new OptionsViewModel(); OptionsView view = new OptionsView { DataContext = model }; view.ShowDialog(); }
private void Button_Click(object sender, RoutedEventArgs e) { try { var optionsWindow = new OptionsView(Window.GetWindow(this)); optionsWindow.DataContext = new OptionsViewModel(); optionsWindow.ShowDialog(); } catch (Exception ex) { Console.WriteLine(ex); } }
static public void ApplyLayOutFromPivotGrid(PivotGridControl pivotGrid, DataSet ds) { try { if (ds == null) { return; } FieldProperty.LoadXml_FieldProperty(pivotGrid, ds); OptionsView.LoadXml_OtionsView(pivotGrid, ds); } catch { } }
private void OpenOptions() { Logger.Log.Debug("Opened"); OptionsView optionsView = new OptionsView(); optionsView.DataContext = OptionsViewModel; optionsView.WindowStartupLocation = WindowStartupLocation.CenterOwner; optionsView.Owner = Application.Current.MainWindow; optionsView.ShowDialog(); Logger.Log.Debug("Closed"); }
void ReleaseDesignerOutlets() { if (CancelButton != null) { CancelButton.Dispose(); CancelButton = null; } if (CanvelView != null) { CanvelView.Dispose(); CanvelView = null; } if (CarButton != null) { CarButton.Dispose(); CarButton = null; } if (CategoriasCollectionView != null) { CategoriasCollectionView.Dispose(); CategoriasCollectionView = null; } if (OptionsView != null) { OptionsView.Dispose(); OptionsView = null; } if (SearchTableView != null) { SearchTableView.Dispose(); SearchTableView = null; } if (SearchTextField != null) { SearchTextField.Dispose(); SearchTextField = null; } if (UserButton != null) { UserButton.Dispose(); UserButton = null; } }
private void ShowOptionsView() { if (optionsView == null) { OptionsView view = new OptionsView(options.ToArray(), new PropertyGrid()); view.Closed += view_Closed; optionsView = view; hostServices.Show(optionsView, DockState.Document); } else { optionsView.Activate(); } }
public void Option_Test() { var consoleMock = new Mock <IShell>(); consoleMock.Setup(c => c.WriteLine("1\tCreate Account")); consoleMock.Setup(c => c.WriteLine("2\tTransfer")); consoleMock.Setup(c => c.WriteLine("3\tDeposit")); consoleMock.Setup(c => c.WriteLine("4\tWithDrawal")); consoleMock.Setup(c => c.WriteLine("5\tExit")); consoleMock.Setup(c => c.WriteLine("-----------------------------------")); consoleMock.Setup(c => c.Write("Enter Choice : ")); var optionsView = new OptionsView("fool", consoleMock.Object); optionsView.Show(); consoleMock.VerifyAll(); }
/** * Konstruktor */ public NormalTetrisView(OptionsView ov, IndexView iv) { this.iv = iv; this.ov = ov; this.boardModel = App.getInstance().getBoardModel(); InitializeComponent(); /*Hier werden die Grids initialisiert*/ initBoard(); /* Hier kommen die Event Listener fuers Spiel*/ boardModel.BoardChanged += new BoardChangedEventHandler(OnBoardChanged); boardModel.ScoreChanged += new ScoreChangedEventHandler(OnScoreChanged); boardModel.LineChanged += new LineChangedEventHandler(OnLineChanged); App.getInstance().GameOverEvent += new GameOverEventHandler(OnGameOver); App.getInstance().FigureFallenEvent += new FigureFallenEventHandler(OnFigureFallen); playerName = "Unbekannt"; }
private void ShowOptions() { var options = new OptionsView { WindowStartupLocation = WindowStartupLocation.CenterScreen }; options.Show(); void EventHandler(object sender, EventArgs e) { BuildMenuItems(); options.Closed -= EventHandler; } options.Closed += EventHandler; }
static public DataSet GetLayOutFromPivotGrid(PivotGridControl pivotGrid) { try { DataSet ds = GreateSchemaDs(); FieldProperty.GetPivotGridFieldProperty(pivotGrid, ds); OptionsView.GetPivotGridOtionsView(pivotGrid, ds); return(ds); } catch { return(null); } }
public void Execute(object parameter) { string param = (string)parameter; switch (param) { case "Options": var view = new OptionsView(); var viewModel = ViewModelLocater.OptionsViewModel; viewModel.BackupValues(); view.DataContext = viewModel; view.WindowStartupLocation = WindowStartupLocation.CenterOwner; view.WindowStyle = WindowStyle.ToolWindow; view.Owner = App.Current.MainWindow; ViewModelLocater.MainWindowViewModel.OptionsWindow = view; view.ShowDialog(); break; } }
//konstruktor przyjmuje jako parametr referencje do wywolujacej go gry public Controller(Game g, SpriteBatch s, ContentManager c) { spriteBatch = s; contentManager = c; morningstar = g; nickname = generateNickname(); //stworzenie listy widokow - domyslnie jej pierwszym elementem jest menuView views = new Dictionary <viewKeys, BasicView>(); MenuView menu = new MenuView(spriteBatch, contentManager, this); BadLoginView badLogView = new BadLoginView(spriteBatch, contentManager, this); GameView gameView = new GameView(spriteBatch, contentManager, this); OptionsView optionsView = new OptionsView(spriteBatch, contentManager, this); menu.isActive = true; views.Add(viewKeys.GAME, gameView); views.Add(viewKeys.MENU, menu); views.Add(viewKeys.BAD_JOIN, badLogView); views.Add(viewKeys.OPTIONS, optionsView); }
private static void Main(string[] args) { var projects = new List <Project>(); projects.Add(CreateSolutionFolder("UnitTests", CreateProject(@"UnitTests\Company.Project.Assembly1\Company.Project.Assembly1.UnitTests.csproj"), CreateProject(@"UnitTests\Company.Project.Assembly2\Company.Project.Assembly2.UnitTests.csproj"), CreateProject(@"UnitTests\Company.Project.Assembly3\Company.Project.Assembly3.UnitTests.csproj"))); projects.Add(CreateProject(@"Company.Project.Assembly1\Company.Project.Assembly1.csproj")); projects.Add(CreateProject(@"Company.Project.Assembly3\Company.Project.Assembly3.csproj")); projects.Add(CreateProject(@"Company.Project.Assembly2\Company.Project.Assembly2.csproj")); var configuration = new SolutionConfiguration(); configuration.TargetDirectory = @"C:\Temp"; configuration.IsEnabled = true; configuration.Projects.Add(CreateProjectConfiguration(@"Company.Project.Assembly1\Company.Project.Assembly1.csproj", true, false)); configuration.Projects.Add(CreateProjectConfiguration(@"Company.Project.Assembly3\Company.Project.Assembly3.csproj", false, true)); var dteMock = new Mock <DTE2> { DefaultValue = DefaultValue.Mock }; Mock.Get(dteMock.Object.Solution.Projects) .As <IEnumerable>() .Setup(p => p.GetEnumerator()) .Returns(() => projects.GetEnumerator()); Mock.Get(dteMock.Object.Solution.SolutionBuild) .Setup(p => p.StartupProjects) .Returns(new object[] { projects[1].UniqueName }); var optionsViewModel = new OptionsViewModel(dteMock.Object, configuration); var optionsView = new OptionsView(optionsViewModel); optionsView.ShowDialog(); }
public void Init(OptionsView view, Fade fade, bool duringLevel) { m_view = view; m_fade = fade; var options = Pix.Game.GetInstance().Options; m_view.BackPressed += HandleBackPressed; m_view.SoundPressed += HandleSoundPressed; m_view.MusicPressed += HandleMusicPressed; m_view.RestorePurchasesPressed += HandleRestorePurchasesPressed; m_view.GPGSPressed += HandleGPGSPressed; m_view.SetVersion(Application.version); m_view.SetSoundEnabled(options.IsSoundEnabled()); m_view.SetMusicEnabled(options.IsMusicEnabled()); bool restorePurchaseAvailable = !duringLevel && Pix.Game.GetInstance().Purchaser.IsRestoreAvailable(); m_view.SetRestorePurchasesEnabled(restorePurchaseAvailable); UpdateSocial(); }
public MainWindow() { InitializeComponent(); Messenger.Default.Register <MainViewCloseMessage>(this, message => { this.Close(); }); Messenger.Default.Register <SetAddingCommentDirection>(this, message => { _addingCommentToTop = message.IsTop; }); Messenger.Default.Register <SetPostCommentPanel>(this, message => { PostCommentPanelPlaceHolder.Children.Clear(); var newPanel = message.Panel; if (newPanel == null) { PostCommentPanelPlaceHolder.IsEnabled = false; } else { PostCommentPanelPlaceHolder.IsEnabled = true; newPanel.Margin = new Thickness(0); newPanel.VerticalAlignment = VerticalAlignment.Stretch; newPanel.HorizontalAlignment = HorizontalAlignment.Stretch; newPanel.Width = double.NaN; newPanel.Height = double.NaN; PostCommentPanelPlaceHolder.Children.Add(newPanel); } }); Messenger.Default.Register <ShowOptionsViewMessage>(this, message => { try { if (optionsView == null) { optionsView = new OptionsView(); optionsView.Owner = this; } optionsView.Clear(); foreach (var tab in message.Tabs) { optionsView.AddTabPage(tab); } var showPos = Tools.GetShowPos(Tools.GetMousePos(), optionsView); optionsView.Left = showPos.X; optionsView.Top = showPos.Y; optionsView.Show(); } catch (Exception ex) { Debug.WriteLine(ex.Message); Debugger.Break(); } }); Messenger.Default.Register <Common.AutoUpdate.ShowUpdateDialogMessage>(this, message => { try { var updateView = new Common.AutoUpdate.UpdateView(); var showPos = Tools.GetShowPos(Tools.GetMousePos(), updateView); updateView.Left = showPos.X; updateView.Top = showPos.Y; updateView.IsUpdateExists = message.IsUpdateExists; updateView.CurrentVersion = message.CurrentVersion; updateView.LatestVersionInfo = message.LatestVersionInfo; updateView.Owner = this; updateView.Logger = message.Logger; updateView.ShowDialog(); } catch (Exception ex) { Debug.WriteLine(ex.Message); } }); Messenger.Default.Register <ShowUserViewMessage>(this, message => { try { var uvm = message.Uvm; var userView = new UserView { DataContext = uvm }; userView.Show(); } catch (Exception ex) { Debug.WriteLine(ex.Message); } }); }
public void Execute() { var optionsWindow = new OptionsView(this.config); optionsWindow.Show(); }
/// <summary> /// Shows the options. /// </summary> public void ShowOptions() { TraceService.WriteLine("ApplicationController::ShowOptions"); OptionsView view = new OptionsView(); ResourceDictionary resourceDictionary = this.GetLanguageDictionary(); view.SetLanguageDictionary(resourceDictionary); OptionsViewModel viewModel = this.ResolverService.Resolve<OptionsViewModel>(); viewModel.LanguageDictionary = resourceDictionary; view.DataContext = viewModel; viewModel.VisualViewModel.Colors = translator.Translate(view.Colors); //// use weak references. WeakEventManager<VisualViewModel, ThemeChangedEventArgs> .AddHandler(viewModel.VisualViewModel, "ThemeChanged", view.ThemeChanged); //// set the theme. view.ChangeTheme( this.CurrentTheme, this.SettingsService.ThemeColor); view.ShowDialog(); WeakEventManager<VisualViewModel, ThemeChangedEventArgs> .RemoveHandler(viewModel.VisualViewModel, "ThemeChanged", view.ThemeChanged); //// in case any of the setting have changed to do with logging reset them! TraceService.Initialize( this.SettingsService.LogToTrace, false, //// log to console. this.SettingsService.LogToFile, this.SettingsService.LogFilePath, this.SettingsService.DisplayErrors); }
/// <inheritdoc/> public override IDock CreateDefaultLayout() { // Dashboard var dashboardView = new DashboardView { Dock = "", Width = double.NaN, Height = double.NaN, Title = "Dashboard" }; // Page var pageView = new PageView { Dock = "", Width = double.NaN, Height = double.NaN, Title = "Page" }; // Left / Top var projectView = new ProjectView { Dock = "", Width = double.NaN, Height = double.NaN, Title = "Project" }; var optionsView = new OptionsView { Dock = "", Width = 200, Height = 200, Title = "Options" }; var imagesView = new ImagesView { Dock = "", Width = double.NaN, Height = double.NaN, Title = "Images" }; // Left / Bottom var groupsView = new GroupsView { Dock = "", Width = double.NaN, Height = double.NaN, Title = "Groups" }; var databasesView = new DatabasesView { Dock = "", Width = double.NaN, Height = double.NaN, Title = "Databases" }; // Right / Top var stylesView = new StylesView { Dock = "", Width = double.NaN, Height = double.NaN, Title = "Styles" }; var templatesView = new TemplatesView { Dock = "", Width = double.NaN, Height = double.NaN, Title = "Templates" }; var containerView = new ContainerView { Dock = "", Width = double.NaN, Height = double.NaN, Title = "Container" }; var zoomView = new ZoomView { Dock = "", Width = double.NaN, Height = double.NaN, Title = "Zoom" }; // Right / Bottom var toolsView = new ToolsView { Dock = "", Width = double.NaN, Height = double.NaN, Title = "Tools" }; var shapeView = new ShapeView { Dock = "", Width = double.NaN, Height = double.NaN, Title = "Shape" }; var dataView = new DataView { Dock = "", Width = double.NaN, Height = double.NaN, Title = "Data" }; var styleView = new StyleView { Dock = "", Width = double.NaN, Height = double.NaN, Title = "Style" }; var templateView = new TemplateView { Dock = "", Width = double.NaN, Height = double.NaN, Title = "Template" }; // Left var leftPane = new DockLayout { Dock = "Left", Width = 200, Height = double.NaN, Title = "EditorLeft", CurrentView = null, Views = new ObservableCollection <IDock> { new DockStrip { Dock = "Top", Width = double.NaN, Height = 340, Title = "EditorLeftTop", CurrentView = projectView, Views = new ObservableCollection <IDock> { projectView, optionsView, imagesView } }, new DockSplitter() { Dock = "Top", Title = "LeftTopSplitter" }, new DockStrip { Dock = "Bottom", Width = double.NaN, Height = double.NaN, Title = "EditorLeftBottom", CurrentView = groupsView, Views = new ObservableCollection <IDock> { groupsView, databasesView } } } }; // Right var rightPane = new DockLayout { Dock = "Right", Width = 240, Height = double.NaN, Title = "EditorRight", CurrentView = null, Views = new ObservableCollection <IDock> { new DockStrip { Dock = "Top", Width = double.NaN, Height = 340, Title = "EditorRightTop", CurrentView = stylesView, Views = new ObservableCollection <IDock> { stylesView, templatesView, containerView, zoomView } }, new DockSplitter() { Dock = "Top", Title = "RightTopSplitter" }, new DockStrip { Dock = "Bottom", Width = double.NaN, Height = double.NaN, Title = "EditorRightBottom", CurrentView = toolsView, Views = new ObservableCollection <IDock> { toolsView, shapeView, dataView, styleView, templateView } } } }; // Editor var editorLayout = new DockLayout { Dock = "", Width = double.NaN, Height = double.NaN, Title = "EditorLayout", CurrentView = null, Views = new ObservableCollection <IDock> { leftPane, new DockSplitter() { Dock = "Left", Title = "LeftSplitter" }, rightPane, new DockSplitter() { Dock = "Right", Title = "RightSplitter" }, pageView } }; var editorView = new EditorView { Dock = "", Width = double.NaN, Height = double.NaN, Title = "Editor", CurrentView = editorLayout, Views = new ObservableCollection <IDock> { editorLayout } }; // About var aboutView = new AboutView { Dock = "", Width = double.NaN, Height = double.NaN, Title = "About" }; // Browser var browserView = new BrowserView { Dock = "", Width = double.NaN, Height = double.NaN, Title = "Browser" }; // Document var documentView = new DocumentView { Dock = "", Width = double.NaN, Height = double.NaN, Title = "Document" }; // Main var layout = new DockRoot { Dock = "", Width = double.NaN, Height = double.NaN, CurrentView = dashboardView, Views = new ObservableCollection <IDock> { dashboardView, editorView, aboutView, browserView, documentView } }; return(layout); }
/// <summary> /// Shows the options. /// </summary> public void ShowOptions() { TraceService.WriteLine("ApplicationController::ShowOptions"); OptionsView view = new OptionsView(); ResourceDictionary resourceDictionary = this.GetLanguageDictionary(); OptionsViewModel viewModel = this.ResolverService.Resolve<OptionsViewModel>(); viewModel.LanguageDictionary = resourceDictionary; view.DataContext = viewModel; view.ShowDialog(); //// in case any of the setting have changed to do with logging reset them! TraceService.Initialize( this.SettingsService.LogToTrace, false, //// log to console. this.SettingsService.LogToFile, this.SettingsService.ExtendedLogging, this.SettingsService.LogFilePath, this.SettingsService.DisplayErrors, this.SettingsService.ErrorFilePath); }
private void OpenOptions(object sender, RoutedEventArgs e) { var v = new OptionsView(); ShowChild(v); }
private void Options() { OptionsView view = new OptionsView(); view.Show(); }
private void Expander_Expanded(object sender, RoutedEventArgs e) { OptionsView.ScrollToEnd(); }