コード例 #1
0
        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;
            }
        }
コード例 #2
0
        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;
        }
コード例 #3
0
ファイル: MainWindow.xaml.cs プロジェクト: wafec/ml2m
        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);
            }
        }
コード例 #4
0
ファイル: FormMenu.cs プロジェクト: Hlib-Bakai/ShareP
 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);
     }
 }
コード例 #5
0
        static void Main(string[] args)
        {
            Board board = BoardController.Setup();

            Console.WriteLine(PresentationController.PresentBoard(board));
            InputController.InputCycle(board);
            Console.ReadLine();
        }
コード例 #6
0
 private void InitializeContexts()
 {
     this.DataContext = this;
     if (PresentationController != null)
     {
         PresentationController.Subscribe(this);
     }
 }
コード例 #7
0
        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;
            }
        }
コード例 #8
0
ファイル: FormMenu.cs プロジェクト: Hlib-Bakai/ShareP
 private void OnAppClosing()
 {
     if (Connection.CurrentRole == Role.Host)
     {
         ServerController.OnGroupClose();
         PresentationController.OnAppClosing();
     }
     else if (Connection.CurrentRole == Role.Client)
     {
         ViewerController.OnAppClosing();
         Connection.Disconnect();
     }
     CleanTempFiles();
 }
コード例 #9
0
        /// <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.");
        }
コード例 #10
0
 private void StopExecutingEverythingDueClosingEvent()
 {
     lock (_lock)
     {
         if (PresentationController != null && !_servicesStopped)
         {
             PresentationController.Unsubscribe(this);
             PresentationController.Stop();
             sbPresentation.Stop();
             WindowState      = WindowState.Normal;
             WindowStyle      = WindowStyle.ThreeDBorderWindow;
             _servicesStopped = true;
         }
     }
 }
コード例 #11
0
        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();
            }
        }
コード例 #12
0
        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);
                }
            }
        }
コード例 #13
0
        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;
            }
        }
コード例 #14
0
ファイル: MainWindow.xaml.cs プロジェクト: wafec/ml2m
        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"));
            }
        }
コード例 #15
0
        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;
            }
        }
コード例 #16
0
ファイル: FormMenu.cs プロジェクト: Hlib-Bakai/ShareP
        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);
        }
コード例 #17
0
        public PresentationView(PresentationController controller)
        {
            _controller = controller;

            InitializeComponent();
        }
コード例 #18
0
        /// <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;
        }
コード例 #19
0
ファイル: FormMenu.cs プロジェクト: Hlib-Bakai/ShareP
        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);
 }
コード例 #21
0
 public MainController()
 {
     _view = new MainView(this);
     _settingsController = new SettingsController(this);
     _presentationController = new PresentationController(this);
 }
コード例 #22
0
ファイル: MainWindow.xaml.cs プロジェクト: wafec/ml2m
 private void HandleFrenteClick(object sender, RoutedEventArgs e)
 {
     PresentationController.GoToNext();
 }
コード例 #23
0
        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);
                }
            }
        }
コード例 #24
0
 public void TestPresentationOnEventWhenNotConnected()
 {
     PresentationController.OnSlideShowEnd(null);
 }
コード例 #25
0
 public void TestOnClosingWhenNoAppLaunched()
 {
     PresentationController.OnAppClosing();
 }
コード例 #26
0
 public void TestCheckPresentationApp()
 {
     Assert.IsInstanceOfType(PresentationController.CheckApp(), typeof(bool));
 }
コード例 #27
0
ファイル: MainWindow.xaml.cs プロジェクト: wafec/ml2m
 private void HandlePararClick(object sender, RoutedEventArgs e)
 {
     PresentationController.Stop();
 }
コード例 #28
0
ファイル: MainWindow.xaml.cs プロジェクト: wafec/ml2m
 private void Window_Unloaded(object sender, RoutedEventArgs e)
 {
     PresentationController.Unsubscribe(this);
     PresentationController.Stop();
 }
コード例 #29
0
ファイル: FormMenu.cs プロジェクト: Hlib-Bakai/ShareP
 private void CleanTempFiles()
 {
     PresentationController.CleanTempFiles();
     ViewerController.CleanTempFiles();
 }
コード例 #30
0
ファイル: MainWindow.xaml.cs プロジェクト: wafec/ml2m
 private void HandleTrasClick(object sender, RoutedEventArgs e)
 {
     PresentationController.GoToPrevious();
 }
コード例 #31
0
ファイル: MainWindow.xaml.cs プロジェクト: wafec/ml2m
        private void HandleKeyClick(object sender, RoutedEventArgs e)
        {
            var songItem = ((FrameworkElement)sender).DataContext as SongItem;

            PresentationController.GoToByKey(songItem.Key);
        }
コード例 #32
0
ファイル: MainWindow.xaml.cs プロジェクト: wafec/ml2m
 private void HandleTrocarVideoClick(object sender, RoutedEventArgs e)
 {
     PresentationController.ChangeBackgroundVideoRandomly();
 }
コード例 #33
0
        /// <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;
        }
コード例 #34
0
 public PresentationModel(PresentationController cont)
 {
     _controller = cont;
 }
コード例 #35
0
        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;
        }
コード例 #36
0
        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;
        }