protected virtual void InitializeComponents() { if (ServiceProvider == null) { // if we have a kernel, then let's create a "depency-injection service provider". if (Kernel != null) { ServiceProvider = new DIServiceProvider(Kernel); } // otherwise, create a regular, plain service provider else { ServiceProvider = new ServiceProvider(); } } if (PresentationController == null) { PresentationController = new PresentationController(); } if (ApplicationModuleManager == null) { ApplicationModuleManager = new ApplicationModuleManager(); } ApplicationModuleManager.PresentationController = PresentationController; // if the Kernel is present, then link both module managers (from Foundation and from Ninject). if (Kernel != null) { ApplicationModuleManager.ModuleManager = Kernel.Components.ModuleManager; } }
private void adjustHeight() { double height; if (UIDevice.CurrentDevice.UserInterfaceIdiom == UIUserInterfaceIdiom.Phone) { height = nonScrollableContentHeight + ScrollViewContent.Bounds.Height; if (UIDevice.CurrentDevice.CheckSystemVersion(11, 0)) { height += UIApplication.SharedApplication.KeyWindow.SafeAreaInsets.Bottom; } } else { var errorHeight = ErrorView.Hidden ? 0 : ErrorView.SizeThatFits(UIView.UILayoutFittingCompressedSize).Height; var titleHeight = DescriptionView.SizeThatFits(UIView.UILayoutFittingCompressedSize).Height; var isBillableHeight = BillableView.Hidden ? 0 : 56; var timeFieldsHeight = ViewModel.IsEditingGroup ? 0 : 167; height = preferredIpadHeight + errorHeight + titleHeight + timeFieldsHeight + isBillableHeight; } var newSize = new CGSize(0, height); if (newSize != PreferredContentSize) { PreferredContentSize = newSize; PresentationController.ContainerViewWillLayoutSubviews(); } ScrollView.ScrollEnabled = ScrollViewContent.Bounds.Height > ScrollView.Bounds.Height; }
private void HandleMostrarMusicaClick(object sender, RoutedEventArgs e) { object selected = lvSelecionadas.SelectedItem; if (selected != null) { SongListItem songListItem = selected as SongListItem; PlayingSong = PlayingSong.CreateInstance(songListItem.Song); dpPlayingSong.DataContext = PlayingSong; if (PresentationWindow == null) { PresentationWindow = new PresentationWindow(PresentationController, ResourceConfiguration, StateConfiguration); PresentationController.SetKeyEvents(PresentationWindow); StateConfiguration.UpdatePresentationWindowPosition(Left, Top, ActualWidth, ActualHeight, PresentationWindow.Width, PresentationWindow.Height); PresentationWindow.Left = StateConfiguration.PresentationWindowLeft; PresentationWindow.Top = StateConfiguration.PresentationWindowTop; PresentationWindow.Show(); } PresentationWindow.Visibility = Visibility.Visible; PresentationHidden = false; HandlePresentationWindowButtons(); PresentationController.ChangeSong(PlayingSong); } }
private void Disconnect(bool force = false) { if (Connection.CurrentRole == Role.Host) { int overlay = Helper.ShowOverlay(this); FormAlert formAlert = new FormAlert("Confirmation", "Close the group?"); if (force || formAlert.ShowDialog() == DialogResult.OK) { Helper.HideOverlay(overlay); ServerController.OnGroupClose(); PresentationController.OnAppClosing(); ViewerController.OnAppClosing(); Connection.Disconnect(); LoadConnectionTab(); buttonJoin.Enabled = true; } Helper.HideOverlay(overlay); } else if (Connection.CurrentRole == Role.Client) { int overlay = Helper.ShowOverlay(this); FormAlert formAlert = new FormAlert("Confirmation", "Disconnect from the group?"); if (force || formAlert.ShowDialog() == DialogResult.OK) { Helper.HideOverlay(overlay); ViewerController.OnAppClosing(); PresentationController.OnAppClosing(); Connection.Disconnect(); LoadConnectionTab(); buttonJoin.Enabled = true; } Helper.HideOverlay(overlay); } }
static void Main(string[] args) { Board board = BoardController.Setup(); Console.WriteLine(PresentationController.PresentBoard(board)); InputController.InputCycle(board); Console.ReadLine(); }
private void InitializeContexts() { this.DataContext = this; if (PresentationController != null) { PresentationController.Subscribe(this); } }
public override void ViewWillLayoutSubviews() { var newSize = new CGSize(0, nonScrollableContentHeight + ScrollViewContent.Bounds.Height); if (newSize != PreferredContentSize) { PreferredContentSize = newSize; PresentationController.ContainerViewWillLayoutSubviews(); ScrollView.ScrollEnabled = ScrollViewContent.Bounds.Height > ScrollView.Bounds.Height; } }
private void OnAppClosing() { if (Connection.CurrentRole == Role.Host) { ServerController.OnGroupClose(); PresentationController.OnAppClosing(); } else if (Connection.CurrentRole == Role.Client) { ViewerController.OnAppClosing(); Connection.Disconnect(); } CleanTempFiles(); }
/// <summary> /// Starts the application. That method should be one of the first being called when the program starts. The method /// accepts an existing configuration object. See <see cref="StartApplication()"/> for default configuration. /// </summary> /// <param name="config">Loaded application object.</param> public void StartApplication(ApplicationConfiguration config) { Logger.Info("Starting application..."); _config = config; InitializeComponents(); // Load services and modules from the config file. Logger.Info("Loading services and modules from config."); if (_config != null) { ConfigManager.LoadAndConfigureServices(ServiceProvider, _config); ConfigManager.LoadModules(ApplicationModuleManager, _config); } // start services Logger.Info("Starting services."); foreach (IService service in ServiceProvider.AllServices) { IStartable startable; startable = service as IStartable; if (startable != null) { startable.Start(); } } // Display the Shell, if any. if (Shell != null) { Logger.Info("Displaying the Shell."); foreach (IViewController ctrl in Shell.CreateViewControllers()) { PresentationController.RegisterViewController(ctrl); } foreach (IPresenter presenter in Shell.CreatePresenters()) { PresentationController.RegisterPresenter(presenter); } Shell.Show(); } // Activate modules Logger.Info("Activating modules."); ApplicationModuleManager.ActivateAll(); _started = true; Logger.Info("Application started."); }
private void StopExecutingEverythingDueClosingEvent() { lock (_lock) { if (PresentationController != null && !_servicesStopped) { PresentationController.Unsubscribe(this); PresentationController.Stop(); sbPresentation.Stop(); WindowState = WindowState.Normal; WindowStyle = WindowStyle.ThreeDBorderWindow; _servicesStopped = true; } } }
private void adjustHeight() { if (viewDidAppear) { return; } var frame = View.ConvertRectFromView(WheelView.Frame, WheelView.Superview); var height = frame.Bottom + bottomOffset; var newSize = new CGSize(0, height); if (newSize != PreferredContentSize) { PreferredContentSize = newSize; PresentationController.ContainerViewWillLayoutSubviews(); } }
private void adjustHeight() { double height; nfloat coveredByKeyboard = 0; if (TraitCollection.HorizontalSizeClass == UIUserInterfaceSizeClass.Compact) { height = nonScrollableContentHeight + ScrollViewContent.Bounds.Height; height += UIApplication.SharedApplication.KeyWindow.SafeAreaInsets.Bottom; } else { var errorHeight = ErrorView.Hidden ? 0 : ErrorView.SizeThatFits(UIView.UILayoutFittingCompressedSize).Height; var titleHeight = DescriptionView.SizeThatFits(UIView.UILayoutFittingCompressedSize).Height; var isBillableHeight = BillableView.Hidden ? 0 : 56; var timeFieldsHeight = ViewModel.IsEditingGroup ? 0 : 167; height = preferredIpadHeight + errorHeight + titleHeight + timeFieldsHeight + isBillableHeight; } var newSize = new CGSize(0, height); if (newSize != PreferredContentSize) { PreferredContentSize = newSize; PresentationController.ContainerViewWillLayoutSubviews(); } ScrollView.ScrollEnabled = ScrollViewContent.Bounds.Height > ScrollView.Bounds.Height; if (TraitCollection.HorizontalSizeClass == UIUserInterfaceSizeClass.Regular) { if (ScrollView.ScrollEnabled && keyboardHeight > 0) { nfloat scrollViewContentBottomPadding = ViewModel.IsEditingGroup ? coveredByKeyboard : 0; ScrollView.ContentSize = new CGSize(ScrollView.ContentSize.Width, ScrollViewContent.Bounds.Height + scrollViewContentBottomPadding); ScrollView.SetContentOffset(new CGPoint(0, ScrollView.ContentSize.Height - ScrollView.Bounds.Height), false); } else { ScrollView.ContentSize = new CGSize(ScrollView.ContentSize.Width, ScrollViewContent.Bounds.Height); } } }
public override void ViewWillLayoutSubviews() { var height = nonScrollableContentHeight + ScrollViewContent.Bounds.Height; if (UIDevice.CurrentDevice.CheckSystemVersion(11, 0)) { height += UIApplication.SharedApplication.KeyWindow.SafeAreaInsets.Bottom; } var newSize = new CGSize(0, height); if (newSize != PreferredContentSize) { PreferredContentSize = newSize; PresentationController.ContainerViewWillLayoutSubviews(); ScrollView.ScrollEnabled = ScrollViewContent.Bounds.Height > ScrollView.Bounds.Height; } }
private void InitializeThis() { PresentationController = new PresentationController(); SongController = new SongController(); ResourceConfiguration = ResourceConfiguration.CreateInstance(); PresentationController.Subscribe(this); PresentationController.SetKeyEvents(this); ProgressControl = new MainProgressControl(); sbiProgress.DataContext = ProgressControl; StateConfiguration = StateConfiguration.CreateInstance(); tbPesquisar.Text = StateConfiguration.Keywords ?? ""; gPreferences.DataContext = this; if (PropertyChanged != null) { PropertyChanged(this, new PropertyChangedEventArgs("ResourceConfiguration")); } }
protected virtual void InitializeComponents() { if (Logger == null) { TextLogWriter writer = new TextLogWriter(new System.IO.MemoryStream()); writer.AutoflushLevel = LogLevel.Fatal; writer.IsEnabled = false; Logger = new StandardLogger(writer); } if (ServiceProvider == null) { //if we have a kernel, then let's create a "depency-injection service provider". if (Kernel != null) { ServiceProvider = new DIServiceProvider(Kernel); } //otherwise, create a regular, plain service provider else { ServiceProvider = new ServiceProvider(); } } if (PresentationController == null) { PresentationController = new PresentationController(); } if (ApplicationModuleManager == null) { ApplicationModuleManager = new ApplicationModuleManager(); } ApplicationModuleManager.PresentationController = PresentationController; //if the Kernel is present, then link both module managers (from Foundation and from Ninject). if (Kernel != null) { ApplicationModuleManager.ModuleManager = Kernel.Components.ModuleManager; } }
public async void StartPresentation(string name) // Server side { this.Hide(); FormLoading formLoading = new FormLoading("Presentation is preparing for sharing. Please, wait..."); formLoading.Show(); PresentationController.StartApp(); await Task.Run(() => PresentationController.ExportImages(Helper.GetCurrentFolder())); formLoading.Close(); Connection.CurrentPresentation = new Presentation() { Name = name, CurrentSlide = 1, Author = Connection.CurrentUser.Username }; LoadConnectionTab(); PresentationController.StartSlideShow(checkBoxCheater.Checked); }
public PresentationView(PresentationController controller) { _controller = controller; InitializeComponent(); }
/// <summary> /// Starts the application. That method should be one of the first being called when the program starts. The method /// accepts an existing configuration object. See <see cref="StartApplication()"/> for default configuration. /// </summary> /// <param name="config">Loaded application object.</param> public void StartApplication(ApplicationConfiguration config) { _config = config; if (ServiceProvider == null) { ServiceProvider = new ServiceProvider(); } if (PresentationController == null) { PresentationController = new PresentationController(); } if (ObjectContainer == null) { ObjectContainer = new ObjectContainer(); } if (ExtensionPortManager == null) { ExtensionPortManager = new ExtensionPortManager(ObjectContainer); } if (_config != null) { ConfigManager.ConfigureContainer(ObjectContainer, _config); ConfigManager.ConfigureServices(ServiceProvider, _config); ConfigManager.ConfigureModules(ObjectContainer, _config); } //start services foreach (IService service in ServiceProvider.AllServices) { IStartable startable; startable = service as IStartable; if (startable != null) { startable.Start(); } } //Display the Shell if (Shell != null) { foreach (IViewController ctrl in Shell.CreateViewControllers()) { PresentationController.ViewControllers.Add(ctrl); } foreach (IPresenter presenter in Shell.CreatePresenters()) { PresentationController.RegisterPresenter(presenter); } Shell.Show(); } //Start modules foreach (object obj in ObjectContainer.AllObjects) { IModule module = obj as IModule; if (module != null) { module.PresentationController = PresentationController; IStartable start; start = module as IStartable; if (start != null) { start.Start(); } } } _started = true; }
private async void button5_Click_1(object sender, EventArgs e) { if (!CheckLengthPresentationName()) { return; } if (!PresentationController.CheckApp()) { int ov = Helper.ShowOverlay(this); FormAlert formAlert = new FormAlert("PowerPoint error", "Make sure You have installed PowerPoint 2007 or newer", true); formAlert.ShowDialog(); Helper.HideOverlay(ov); return; } if ((Connection.CurrentRole == Role.Client && !Connection.clientConnection.ClRequestPresentationStart()) || (Connection.CurrentRole == Role.Host && Connection.ReservePresentation)) { int ov = Helper.ShowOverlay(this); FormAlert formAlert = new FormAlert("Error", "Someone in the group has already started presentation", true); formAlert.ShowDialog(); Helper.HideOverlay(ov); return; } string file = textBoxFile.Text; string name = textBoxPresentationName.Text; int overlay = Helper.ShowOverlay(); if (file.Length < 1) { (new FormAlert("No file", "Please, choose presentation file.", true)).ShowDialog(); } else { var formLoading = new FormLoading("Loading presentation. Please wait..."); try { if (Connection.CurrentRole == Role.Host) { Connection.ReservePresentation = true; } formLoading.Show(); await Task.Run(() => PresentationController.LoadPPT(file)); formLoading.Close(); StartPresentation(name); } catch (Exception ex) { if (formLoading != null) { formLoading.Close(); } Log.LogException(ex, "Can't load presentation"); (new FormAlert("Error", "Problem occured while opening the file", true)).ShowDialog(); if (Connection.CurrentRole == Role.Host) { Connection.ReservePresentation = false; } } } Helper.HideOverlay(overlay); }
public MainController() { _view = new MainView(this); _settingsController = new SettingsController(this); _presentationController = new PresentationController(this); }
private void HandleFrenteClick(object sender, RoutedEventArgs e) { PresentationController.GoToNext(); }
private void adjustHeight() { double height; nfloat coveredByKeyboard = 0; if (UIDevice.CurrentDevice.UserInterfaceIdiom == UIUserInterfaceIdiom.Phone) { height = nonScrollableContentHeight + ScrollViewContent.Bounds.Height; if (UIDevice.CurrentDevice.CheckSystemVersion(11, 0)) { height += UIApplication.SharedApplication.KeyWindow.SafeAreaInsets.Bottom; } if (keyboardHeight > 0) { // this bit of code depends on the knowledge of the component tree: // - description label is inside of a container view which is placed in a stack view // - we want to know the vertical location of the container view in the whole view // - we actually want to know the Y coordinate of the bottom of the container and make // sure we don't overaly it with the keyboard var container = DescriptionTextView.Superview; var absoluteLocation = View.ConvertPointFromView(container.Frame.Location, container.Superview.Superview); var minimumVisibleContentHeight = View.Frame.Height - absoluteLocation.Y - container.Frame.Height; coveredByKeyboard = keyboardHeight - minimumVisibleContentHeight; var safeAreaOffset = UIDevice.CurrentDevice.CheckSystemVersion(11, 0) ? Math.Max(UIApplication.SharedApplication.KeyWindow.SafeAreaInsets.Top, UIApplication.SharedApplication.StatusBarFrame.Height) : 0; var distanceFromTop = Math.Max(safeAreaOffset, View.Frame.Y - coveredByKeyboard); height = UIScreen.MainScreen.Bounds.Height - distanceFromTop; } } else { var errorHeight = ErrorView.Hidden ? 0 : ErrorView.SizeThatFits(UIView.UILayoutFittingCompressedSize).Height; var titleHeight = DescriptionView.SizeThatFits(UIView.UILayoutFittingCompressedSize).Height; var isBillableHeight = BillableView.Hidden ? 0 : 56; var timeFieldsHeight = ViewModel.IsEditingGroup ? 0 : 167; height = preferredIpadHeight + errorHeight + titleHeight + timeFieldsHeight + isBillableHeight; } var newSize = new CGSize(0, height); if (newSize != PreferredContentSize) { PreferredContentSize = newSize; PresentationController.ContainerViewWillLayoutSubviews(); } ScrollView.ScrollEnabled = ScrollViewContent.Bounds.Height > ScrollView.Bounds.Height; if (UIDevice.CurrentDevice.UserInterfaceIdiom == UIUserInterfaceIdiom.Phone) { if (ScrollView.ScrollEnabled && keyboardHeight > 0) { nfloat scrollViewContentBottomPadding = ViewModel.IsEditingGroup ? coveredByKeyboard : 0; ScrollView.ContentSize = new CGSize(ScrollView.ContentSize.Width, ScrollViewContent.Bounds.Height + scrollViewContentBottomPadding); ScrollView.SetContentOffset(new CGPoint(0, ScrollView.ContentSize.Height - ScrollView.Bounds.Height), false); } else { ScrollView.ContentSize = new CGSize(ScrollView.ContentSize.Width, ScrollViewContent.Bounds.Height); } } }
public void TestPresentationOnEventWhenNotConnected() { PresentationController.OnSlideShowEnd(null); }
public void TestOnClosingWhenNoAppLaunched() { PresentationController.OnAppClosing(); }
public void TestCheckPresentationApp() { Assert.IsInstanceOfType(PresentationController.CheckApp(), typeof(bool)); }
private void HandlePararClick(object sender, RoutedEventArgs e) { PresentationController.Stop(); }
private void Window_Unloaded(object sender, RoutedEventArgs e) { PresentationController.Unsubscribe(this); PresentationController.Stop(); }
private void CleanTempFiles() { PresentationController.CleanTempFiles(); ViewerController.CleanTempFiles(); }
private void HandleTrasClick(object sender, RoutedEventArgs e) { PresentationController.GoToPrevious(); }
private void HandleKeyClick(object sender, RoutedEventArgs e) { var songItem = ((FrameworkElement)sender).DataContext as SongItem; PresentationController.GoToByKey(songItem.Key); }
private void HandleTrocarVideoClick(object sender, RoutedEventArgs e) { PresentationController.ChangeBackgroundVideoRandomly(); }
/// <summary> /// Starts the application. That method should be one of the first being called when the program starts. The method /// accepts an existing configuration object. See <see cref="StartApplication()"/> for default configuration. /// </summary> /// <param name="config">Loaded application object.</param> public void StartApplication(ApplicationConfiguration config) { _config = config; if (ServiceProvider == null) ServiceProvider = new ServiceProvider(); if (PresentationController == null) PresentationController = new PresentationController(); if (ObjectContainer == null) ObjectContainer = new ObjectContainer(); if (ExtensionPortManager == null) ExtensionPortManager = new ExtensionPortManager(ObjectContainer); if (_config != null) { ConfigManager.ConfigureContainer(ObjectContainer, _config); ConfigManager.ConfigureServices(ServiceProvider, _config); ConfigManager.ConfigureModules(ObjectContainer, _config); } //start services foreach (IService service in ServiceProvider.AllServices) { IStartable startable; startable = service as IStartable; if (startable != null) startable.Start(); } //Display the Shell if (Shell != null) { foreach (IViewController ctrl in Shell.CreateViewControllers()) { PresentationController.ViewControllers.Add(ctrl); } foreach (IPresenter presenter in Shell.CreatePresenters()) { PresentationController.RegisterPresenter(presenter); } Shell.Show(); } //Start modules foreach (object obj in ObjectContainer.AllObjects) { IModule module = obj as IModule; if (module != null) { module.PresentationController = PresentationController; IStartable start; start = module as IStartable; if (start != null) start.Start(); } } _started = true; }
public PresentationModel(PresentationController cont) { _controller = cont; }
protected virtual void InitializeComponents() { if (ServiceProvider == null) { // if we have a kernel, then let's create a "depency-injection service provider". if (Kernel != null) ServiceProvider = new DIServiceProvider(Kernel); // otherwise, create a regular, plain service provider else ServiceProvider = new ServiceProvider(); } if (PresentationController == null) PresentationController = new PresentationController(); if (ApplicationModuleManager == null) ApplicationModuleManager = new ApplicationModuleManager(); ApplicationModuleManager.PresentationController = PresentationController; // if the Kernel is present, then link both module managers (from Foundation and from Ninject). if (Kernel != null) ApplicationModuleManager.ModuleManager = Kernel.Components.ModuleManager; }
protected virtual void InitializeComponents() { if (Logger == null) { TextLogWriter writer = new TextLogWriter(new System.IO.MemoryStream()); writer.AutoflushLevel = LogLevel.Fatal; writer.IsEnabled = false; Logger = new StandardLogger(writer); } if (ServiceProvider == null) { //if we have a kernel, then let's create a "depency-injection service provider". if (Kernel != null) ServiceProvider = new DIServiceProvider(Kernel); //otherwise, create a regular, plain service provider else ServiceProvider = new ServiceProvider(); } if (PresentationController == null) PresentationController = new PresentationController(); if (ApplicationModuleManager == null) ApplicationModuleManager = new ApplicationModuleManager(); ApplicationModuleManager.PresentationController = PresentationController; //if the Kernel is present, then link both module managers (from Foundation and from Ninject). if (Kernel != null) ApplicationModuleManager.ModuleManager = Kernel.Components.ModuleManager; }