Exemplo n.º 1
0
        /// <summary>
        ///     Initializes a new instance of the <see cref="ContentView" /> class.
        /// </summary>
        protected ContentView()
        {
            var dependencyResolver = this.GetDependencyResolver();
            _viewManager = dependencyResolver.Resolve<IViewManager>();

            DataContextChanged += OnDataContextChanged;
        }
Exemplo n.º 2
0
        /// <summary>
        /// Initializes a new instance of the <see cref="ContentPage"/> class.
        /// </summary>
        public ContentPage()
        {
            var dependencyResolver = this.GetDependencyResolver();
            _viewManager = dependencyResolver.Resolve<IViewManager>();

            DataContextChanged += OnDataContextChanged;
        }
Exemplo n.º 3
0
            public MyBootstrapperBase(IViewManager viewManager, IWindowManager windowManager)
            {
                this.viewManager = viewManager;
                this.windowManager = windowManager;

                this.Start(new string[0]);
            }
Exemplo n.º 4
0
        private void InitContent() {
            this.SuspendLayout();

            IExtensionPoint creator_ext = WindowManagerPlugin.Instance.PoderosaWorld.PluginManager.FindExtensionPoint(WindowManagerConstants.MAINWINDOWCONTENT_ID);
            IViewManagerFactory f = ((IViewManagerFactory[])creator_ext.GetExtensions())[0];

            _toolStripContainer = new PoderosaToolStripContainer(this, _argument.ToolBarInfo);
            this.Controls.Add(_toolStripContainer);

            //ステータスバーその他の初期化
            //コントロールを追加する順番は重要!
            _viewManager = f.Create(this);
            Control main = _viewManager.RootControl;
            if (main != null) { //テストケースではウィンドウの中身がないこともある
                main.Dock = DockStyle.Fill;
                _toolStripContainer.ContentPanel.Controls.Add(main);
            }
            int rowcount = _argument.TabRowCount;
            _tabBarTable = new TabBarTable();
            _tabBarTable.Height = rowcount * TabBarTable.ROW_HEIGHT;
            _tabBarTable.Dock = DockStyle.Top;
            _tabBarManager = new TabBarManager(_tabBarTable);

            _statusBar = new PoderosaStatusBar();

            _toolStripContainer.ContentPanel.Controls.Add(_tabBarTable);
            this.Controls.Add(_statusBar); //こうでなく、_toolStripContainer.BottomToolStripPanelに_statusBarを追加してもよさそうだが、そうするとツールバー項目がステータスバーの上下に挿入可能になってしまう

            _tabBarTable.Create(rowcount);

            this.ResumeLayout();
        }
Exemplo n.º 5
0
 public ImprovedProcessor(Game game, IViewManager viewManager, PhysicsManager physics )
 {
     this._game = game;
     this._viewManager = viewManager;
     this._physics = physics;
     initialize();
 }
Exemplo n.º 6
0
 public void Draw(IViewManager view)
 {
     if (_thingType == 0 || _thingType == 1)
     {
         foreach (var mesh in _model.Meshes)
         {
             foreach (BasicEffect effect in mesh.Effects)
             {
                 effect.World = _meshTransforms[mesh.ParentBone.Index] * Transform.Combined;
                 effect.View = view.View;
                 effect.Projection = view.Projection;
                 if (_isColorRandom) effect.DiffuseColor = _diffuseColor;
                 if (_thingType == 1)
                     effect.DiffuseColor *= 0.5f;
                 /*if (!this.IsActive)
                 {
                     effect.DiffuseColor *= 0.5f;
                 }*/
                 if (_isSelected)
                 {
                     effect.DiffuseColor *= 4.0f;
                 }
             }
             mesh.Draw();
         }
     }
 }
Exemplo n.º 7
0
        public Holodeck()
        {
            var gdm = new GraphicsDeviceManager(this);
            gdm.SynchronizeWithVerticalRetrace = false;
            #if XBOX
            gdm.IsFullScreen = true;
            gdm.PreferredBackBufferHeight = 720;
            gdm.PreferredBackBufferWidth = 1280;
            #elif WINDOWS_PHONE
            gdm.IsFullScreen = true;
            gdm.PreferredBackBufferHeight = 800;
            gdm.PreferredBackBufferWidth = 400;
            #endif

            this.IsFixedTimeStep = false;
            TaskManager.IsThreadingEnabled = false;

            _viewManager = new ViewManager(this);
            _inputManager = new InputManager(this);
            _stateManager = new StateManager(this);
            _physics = new PhysicsManager(this);
            this.Components.Add(new PhysicsScene(this, _physics));

            Content.RootDirectory = "Content";
        }
Exemplo n.º 8
0
        public FreeLookState(IStateManager stateManager)
            : base(stateManager)
        {
            _camera = (IViewManager)stateManager.Game.Services.GetService(typeof(IViewManager));
            _input = (IInputManager)stateManager.Game.Services.GetService(typeof(IInputManager));

            _input.CaptureMouse = true;
        }
Exemplo n.º 9
0
        /// <summary>
        /// Initializes a new instance of the <see cref="ViewExportService" /> class.
        /// </summary>
        /// <param name="viewManager">The view manager.</param>
        /// <param name="saveFileService">The save file service.</param>
        /// <exception cref="ArgumentNullException">The <paramref name="viewManager" /> is <c>null</c>.</exception>
        /// <exception cref="ArgumentNullException">The <paramref name="saveFileService" /> is <c>null</c>.</exception>
        public ViewExportService(IViewManager viewManager, ISaveFileService saveFileService)
        {
            Argument.IsNotNull(() => viewManager);
            Argument.IsNotNull(() => saveFileService);

            _viewManager = viewManager;
            _saveFileService = saveFileService;
        }
Exemplo n.º 10
0
        public InputManager(Game game, IViewManager viewManager, PhysicsManager physics)
		{
            this._game = game;
            this._viewManager = viewManager;
            this._physics = physics;
            //_inputProcessor = new DefaultProcessor(game, viewManager, physics);
            _inputProcessor = new ImprovedProcessor(game, viewManager, physics);
		}
Exemplo n.º 11
0
 public BaseController(IViewManager viewManager,
                       IEventPublisher eventPublisher,
                       IDeploymentManagement deploymentManagement)
 {
     this.ViewManager = viewManager;
     this.EventPublisher = eventPublisher;
     this.DeploymentManagement = deploymentManagement;
 }
Exemplo n.º 12
0
		public override void Initialize()
		{
			base.Initialize();

			_view = this.Game.Services.GetService(typeof(IViewManager)) as IViewManager;
			if (_view == null)
				throw new Exception("No view manager is registered.");
		}
Exemplo n.º 13
0
            protected override object[] GetViewManagerArgs(IViewManager viewManager, DependencyObject view, ReactStylesDiffMap props)
            {
                var args = s_args.Value;

                args[0] = viewManager;
                args[1] = view;
                args[2] = ExtractProperty(props);
                return(args);
            }
Exemplo n.º 14
0
        /// <summary>
        /// Konstruktor.
        /// </summary>
        /// <param name="viewManager">Obiekt menadżera widoków.</param>
        /// <param name="view">Obiekt zarządzanego przez prezentera widoku.</param>
        /// <param name="appManager">Obiekt menadżera aplikacji.</param>
        public MainFormPresenter(IViewManager viewManager, IMainFormView view, ApplicationManager appManager)
            : base(viewManager, view)
        {
            this.applicationManager = appManager;

            this.View.ShowRequest     += new EventHandler(ViewShowRequestHandler);
            this.View.CloseRequest    += new EventHandler(ViewCloseRequestHandler);
            this.View.PreCloseRequest += new EventHandler <ViewPreCloseEventArgs>(ViewPreCloseRequestHandler);
        }
        /// <summary>
        /// Create a <see cref="Storyboard"/> to be used to animate the view,
        /// based on the animation configuration supplied at initialization
        /// time and the new view position and size.
        /// </summary>
        /// <param name="viewManager">The view manager for the view.</param>
        /// <param name="view">The view to create the animation for.</param>
        /// <param name="dimensions">The view dimensions.</param>
        /// <returns>The storyboard.</returns>
        public IObservable <Unit> CreateAnimation(IViewManager viewManager, FrameworkElement view, Dimensions dimensions)
        {
            if (!IsValid)
            {
                return(null);
            }

            return(CreateAnimationCore(viewManager, view, dimensions));
        }
		private void BeforeDestroying()
		{
			_mediatorMap.UnmediateAll ();
			if (_injector.SatisfiesDirectly (typeof(IViewManager))) 
			{
				_viewManager = _injector.GetInstance (typeof(IViewManager)) as IViewManager;
				_viewManager.RemoveViewHandler (_mediatorMap);
			}
		}
		/*============================================================================*/
		/* Private Functions                                                          */
		/*============================================================================*/

		private void BeforeInitializing()
		{
			_mediatorMap = _injector.GetInstance(typeof(IMediatorMap)) as MediatorMap;
			_viewManager = _injector.GetInstance(typeof(IViewManager)) as IViewManager;
			if (_viewManager != null)
			{
				_viewManager.AddViewHandler (_mediatorMap);
			}
		}
Exemplo n.º 18
0
 private void BeforeDestroying()
 {
     _mediatorMap.UnmediateAll();
     if (_injector.SatisfiesDirectly(typeof(IViewManager)))
     {
         _viewManager = _injector.GetInstance(typeof(IViewManager)) as IViewManager;
         _viewManager.RemoveViewHandler(_mediatorMap);
     }
 }
Exemplo n.º 19
0
        /*============================================================================*/
        /* Private Functions                                                          */
        /*============================================================================*/

        private void BeforeInitializing()
        {
            _mediatorMap = _injector.GetInstance(typeof(IMediatorMap)) as MediatorMap;
            _viewManager = _injector.GetInstance(typeof(IViewManager)) as IViewManager;
            if (_viewManager != null)
            {
                _viewManager.AddViewHandler(_mediatorMap);
            }
        }
Exemplo n.º 20
0
 public void AddViewManager(IViewManager viewManager)
 {
     if (viewManager == null)
     {
         throw new ArgumentNullException("viewManager");
     }
     _logger.Info("Adding view manager: {0}", viewManager);
     _viewManagers.Enqueue(viewManager);
 }
Exemplo n.º 21
0
        public TestContext AddViewManager(IViewManager viewManager)
        {
            WithEventDispatcherOfType <ViewManagerEventDispatcher>(x =>
            {
                x.AddViewManager(viewManager);
            });

            return(this);
        }
Exemplo n.º 22
0
            protected override object[] GetViewManagerArgs(IViewManager viewManager, object view, JObject props)
            {
                var args = s_args.Value;

                args[0] = viewManager;
                args[1] = view;
                args[2] = ExtractProp(props);
                return(args);
            }
Exemplo n.º 23
0
        /// <summary>
        /// Initializes static members of the <see cref="LogicBase"/> class.
        /// </summary>
        static LogicBase()
        {
            var dependencyResolver = IoCConfiguration.DefaultDependencyResolver;

            _viewModelLocator     = dependencyResolver.Resolve <IViewModelLocator>();
            _viewManager          = dependencyResolver.Resolve <IViewManager>();
            _viewPropertySelector = dependencyResolver.Resolve <IViewPropertySelector>();
            ViewLoadManager       = dependencyResolver.Resolve <IViewLoadManager>();
        }
Exemplo n.º 24
0
 public BuildsListView(
     IViewManager viewManager,
     IBuildTemplateManager buildTemplateManager)
 {
     this.viewManager          = viewManager.ThrowIfNull(nameof(viewManager));
     this.buildTemplateManager = buildTemplateManager.ThrowIfNull(nameof(buildTemplateManager));
     this.InitializeComponent();
     this.LoadBuilds();
 }
Exemplo n.º 25
0
        public ViewManagerTest()
        {
            statsComponent = new StatsComponent(new SimpleEventQueue());
            tagsComponent  = new TagsComponent();

            tagger        = tagsComponent.Tagger;
            viewManager   = statsComponent.ViewManager;
            statsRecorder = statsComponent.StatsRecorder;
        }
Exemplo n.º 26
0
        /// <summary>
        /// Konstruktor.
        /// </summary>
        /// <param name="viewManager">Obiekt menadżera widoków.</param>
        /// <param name="view">Obiekt zarządzanego przez prezentera widoku.</param>
        /// <param name="subtitlesManager">Obiekt menadżera zarządzającego obiektami reprezentującymi napisy.</param>
        /// <param name="editor">Obiekt menadżera zajmującego się edycjią napisów.</param>
        /// <param name="tool">Obiekt narzędzia odpowiadającego za synchronizację napisów.</param>
        public SynchronizationCommandPresenter(IViewManager viewManager, ICommandView view, SubtitlesManager subtitlesManager, SynchronizationTool tool)
            : base(viewManager, view)
        {
            this.subtitlesManager = subtitlesManager;

            this.tool = tool;

            this.View.IsExecutable = true;
        }
Exemplo n.º 27
0
 public SettingsView(
     ILiveUpdateableOptions <ApplicationConfiguration> liveUpdateableOptions,
     IViewManager viewManager)
 {
     this.liveUpdateableOptions = liveUpdateableOptions.ThrowIfNull(nameof(liveUpdateableOptions));
     this.viewManager           = viewManager.ThrowIfNull(nameof(viewManager));
     this.InitializeComponent();
     this.LoadSettings();
 }
Exemplo n.º 28
0
        public NotesView(IViewManager viewManager, INoteService noteService)
        {
            this.InitializeComponent();

            PFNotesViewModel vm = (PFNotesViewModel)this.DataContext;

            vm.ViewManager = viewManager;
            vm.NoteService = noteService;
        }
Exemplo n.º 29
0
 public void SubsequentViewPersistence(
     IRepository <string, SomeData> repository,
     View view,
     ISequenceResolver sequenceResolver,
     IRepository <string, Snapshot> snapshotRepository,
     IViewManager viewManager,
     SomeEvent firstEvent,
     SomeEvent secondEvent,
     SomeData initialData,
     SomeData actualInitialData,
     SomeData subsequentData)
 {
     "Given a view repository"._(() => repository = new MemoryRepository <string, SomeData>());
     "and some intial data"._(
         () => initialData = new SomeData
     {
         LastEventId = "test2",
         EventCount  = 2,
     });
     "and the repository contains the initial data"._(() => repository.AddOrUpdate("root", initialData));
     "and a view"._(() => view = new SomeView(repository));
     "and a sequence resolver"._(() => sequenceResolver     = new CustomSequenceResolver());
     "and a snapshot repository"._(() => snapshotRepository = new MemoryRepository <string, Snapshot>());
     "and the snapshot repository contains the initial snapshot data"._(
         () => snapshotRepository.AddOrUpdate(
             view.GetType().FullName,
             new Snapshot
     {
         ViewName = view.GetType().FullName,
         PersistedSequenceNumber = 2,
     }));
     "and a view manager"._(ctx => viewManager =
                                ViewManager.ForViews(view)
                                .OrderEventsUsing(sequenceResolver)
                                .SnapshotViewsUsing(snapshotRepository).WithAQuietTimeTimeoutOf(2)
                                .Create().Using(ctx));
     "and a third event"._(() => firstEvent = new SomeEvent {
         Sequence = 3, Id = "test3"
     });
     "and a fourth event"._(() => secondEvent = new SomeEvent {
         Sequence = 4, Id = "test4"
     });
     "when those events are dispatched"._(
         () =>
     {
         viewManager.QueueForDispatch(firstEvent);
         viewManager.QueueForDispatch(secondEvent);
     });
     "and the operation is given time to process"._(() => Thread.Sleep(1000));
     "and the repository is queried initially"._(() => actualInitialData = repository.Get("root"));
     "and the snapshot is given time to process"._(() => Thread.Sleep(2000));
     "and the repository is queried subsequently"._(() => subsequentData = repository.Get("root"));
     "then the initial query should be empty"._(() => actualInitialData.Should().Be(initialData));
     "and the view received the second event last"._(() => subsequentData.LastEventId.Should().Be(secondEvent.Id));
     "and the view received two events"._(() => subsequentData.EventCount.Should().Be(4));
 }
 public InteractionExtensionCrossnetModule(IObjectContainer container, IViewManager viewManager, IInteractionManager interactionManager, ICommandManager commandManager, IViewEventManager viewEventManager, ICase caseIdentifier)
 {
     _container          = container;
     _viewManager        = viewManager;
     _interactionManager = interactionManager;
     _viewEventManager   = viewEventManager;
     _metodos            = new LogicaNegocio();
     _commandManager     = commandManager;
     _caseIdentifier     = caseIdentifier;
 }
Exemplo n.º 31
0
        public override void Initialize()
        {
            base.Initialize();

            _view = this.Game.Services.GetService(typeof(IViewManager)) as IViewManager;
            if (_view == null)
            {
                throw new Exception("No view manager is registered.");
            }
        }
Exemplo n.º 32
0
        private static void RegisterViews()
        {
            IViewManager viewManager = MvpApplication.ViewManager;

            viewManager.RegisterView <IEditTaskView, EditTaskForm>("SaveTask", "Save Task");
            viewManager.RegisterView <ITaskListView, TaskListForm>("TaskList", "Task List");
            viewManager.RegisterView <IStartProcessTaskCreatorConfigurationView, StartProcessTaskCreatorConfigurationForm>("StartProcessTaskConfiguration", "Start Process Task Configuration");
            viewManager.RegisterView <IReflectionTaskCreatorConfigurationView, ReflectionTaskCreatorConfigurationForm>("ReflectionTaskConfiguration", "Reflection Task Configuration");
            viewManager.RegisterView <IBuiltInTaskConfigurationView, BuiltInTaskConfigurationForm>("BuiltInTaskConfiguration", "Built-in Task Configuration");
        }
 public ModuleDefinitionController(IModuleManager moduleManager,
                                   ISecurityManager securityManager,
                                   IViewManager viewManager,
                                   IOptions <AppSettings> appSettings)
 {
     _moduleManager   = moduleManager;
     _securityManager = securityManager;
     _viewManager     = viewManager;
     _appSettings     = appSettings.Value;
 }
Exemplo n.º 34
0
 public LoginWindowVmFactory(IEventAggregator ea,
                             LoginModelViewModel loginModelVm,
                             RegisterViewModel registerVm,
                             IViewManager viewManager)
 {
     _ea           = ea;
     _loginModelVm = loginModelVm;
     _registerVm   = registerVm;
     _viewManager  = viewManager;
 }
 public AssociationAddressController(
     ICommandProcessor commandProcessor,
     IViewManager <GetAddressesView> getAddressesView,
     IViewManager <GetAddressesWithResidentsView> getAddressesWithResidentsView
     )
 {
     _commandProcessor = commandProcessor;
     _getAddressesView = getAddressesView;
     _getAddressesWithResidentsView = getAddressesWithResidentsView;
 }
Exemplo n.º 36
0
        /// <summary>
        /// Creates the appropiate <see cref="Microsoft.ApplicationBlocks.UIProcess.IViewManager"/> for a wizard.
        /// <remarks>For the WizardNavigator, the IViewManager is always a <see cref="Microsoft.ApplicationBlocks.UIProcess.WizardViewManager"/></remarks>
        /// </summary>
        /// <param name="name">The name of the IViewManager to create.</param>
        /// <returns>A WizardViewManager.</returns>
        protected override IViewManager CreateViewManager(string name)
        {
            IViewManager viewManager = ViewManagerFactory.Create(name, new object[] { this.NavigationSettings.Views() });

            if (!(viewManager is WizardViewManager))
            {
                throw new UIPException(Resource.ResourceManager.FormatMessage(Resource.Exceptions.RES_ExceptionWizardViewManagerIsRequired));
            }
            return(viewManager);
        }
Exemplo n.º 37
0
        private void BeforeDestroying()
        {
            _viewProcessorFactory.RunAllUnprocessors();

            if (_injector.SatisfiesDirectly(typeof(IViewManager)))
            {
                _viewManager = _injector.GetInstance(typeof(IViewManager)) as IViewManager;
                _viewManager.RemoveViewHandler(_viewProcessorMap as IViewHandler);
            }
        }
Exemplo n.º 38
0
        public ExpensesView(IViewManager viewManager, IInvoiceService invoiceService, IPaymentService paymentService)
        {
            InitializeComponent();

            var vm = (PFExpensesViewModel)this.DataContext; // this creates an instance of the ViewModel

            vm.ViewManager    = viewManager;
            vm.InvoiceService = invoiceService;
            vm.PaymentService = paymentService;
        }
		/*============================================================================*/
		/* Private Functions                                                          */
		/*============================================================================*/

		private void BeforeInitializing()
		{
			_viewProcessorMap = _injector.GetInstance(typeof(IViewProcessorMap)) as IViewProcessorMap;
			_viewProcessorFactory = _injector.GetInstance(typeof(IViewProcessorFactory)) as IViewProcessorFactory;
			if (_injector.SatisfiesDirectly(typeof(IViewManager)))
			{
				_viewManager = _injector.GetInstance(typeof(IViewManager)) as IViewManager;
				_viewManager.AddViewHandler(_viewProcessorMap as IViewHandler);
			}
		}
Exemplo n.º 40
0
 public AssociationController(
     ICommandProcessor commandProcessor,
     IViewManager <GetAssociationsView> getAssociationsView,
     IViewManager <GetAssociationView> getAssociationView
     )
 {
     _commandProcessor    = commandProcessor;
     _getAssociationsView = getAssociationsView;
     _getAssociationView  = getAssociationView;
 }
Exemplo n.º 41
0
        /*============================================================================*/
        /* Private Functions                                                          */
        /*============================================================================*/

        private void BeforeInitializing()
        {
            _viewProcessorMap     = _injector.GetInstance(typeof(IViewProcessorMap)) as IViewProcessorMap;
            _viewProcessorFactory = _injector.GetInstance(typeof(IViewProcessorFactory)) as IViewProcessorFactory;
            if (_injector.SatisfiesDirectly(typeof(IViewManager)))
            {
                _viewManager = _injector.GetInstance(typeof(IViewManager)) as IViewManager;
                _viewManager.AddViewHandler(_viewProcessorMap as IViewHandler);
            }
        }
		private void BeforeDestroying()
		{
			_viewProcessorFactory.RunAllUnprocessors();

			if (_injector.SatisfiesDirectly(typeof(IViewManager)))
			{
				_viewManager = _injector.GetInstance(typeof(IViewManager)) as IViewManager;
				_viewManager.RemoveViewHandler(_viewProcessorMap as IViewHandler);
			}
		}
Exemplo n.º 43
0
 public TemplateController(IViewManager viewManager,
                           CacheEngine cacheEngine,
                           IViewComponentDescriptorCollectionProvider viewcomponents,
                           IParameterManager parameterManager)
 {
     _viewManager      = viewManager;
     _cacheEngine      = cacheEngine;
     _viewcomponents   = viewcomponents;
     _parameterManager = parameterManager;
 }
Exemplo n.º 44
0
        /// <summary>
        ///     Initializes a new instance of the <see cref="ContentView" /> class.
        /// </summary>
        protected ContentView()
        {
            var dependencyResolver = this.GetDependencyResolver();

            _viewManager = dependencyResolver.Resolve <IViewManager>();

            // TODO: Subscribe to Loaded / Unloaded from XF
            // TODO: Shouldn't this be BindingContextChanged?
            DataContextChanged += OnDataContextChanged;
        }
Exemplo n.º 45
0
        private void OnServiceChequePrinted(IOrder order, IOperationService service, IViewManager manager)
        {
            PluginContext.Log.Info("Printed precheck");
            var json = OrderHelper.GetOrderPackageJson(order);

            HttpSender.AddTask(new HttpSenderTask {
                Url = HttpSender.PostChequeUrl, Json = json
            });
            PluginContext.Log.Info(json);
        }
Exemplo n.º 46
0
 public RequestElevationView(
     IApplicationLauncher applicationLauncher,
     IViewManager viewManager,
     ILogger <RequestElevationView> logger)
 {
     this.applicationLauncher = applicationLauncher.ThrowIfNull(nameof(applicationLauncher));
     this.viewManager         = viewManager.ThrowIfNull(nameof(viewManager));
     this.logger = logger.ThrowIfNull(nameof(logger));
     this.InitializeComponent();
 }
Exemplo n.º 47
0
        public NotifyIconManager(
            IViewManager viewManager,
            NotifyIconViewModel viewModel,
            IApplicationState application,
            IApplicationWindowState applicationWindowState,
            ISyncThingManager syncThingManager)
        {
            this.viewManager = viewManager;
            this.viewModel = viewModel;
            this.application = application;
            this.applicationWindowState = applicationWindowState;
            this.syncThingManager = syncThingManager;

            this.taskbarIcon = (TaskbarIcon)this.application.FindResource("TaskbarIcon");
            // Need to hold off until after the application is started, otherwise the ViewManager won't be set
            this.application.Startup += (o, e) => this.viewManager.BindViewToModel(this.taskbarIcon, this.viewModel);

            this.applicationWindowState.RootWindowActivated += this.RootViewModelActivated;
            this.applicationWindowState.RootWindowDeactivated += this.RootViewModelDeactivated;
            this.applicationWindowState.RootWindowClosed += this.RootViewModelClosed;

            this.viewModel.WindowOpenRequested += (o, e) =>
            {
                this.applicationWindowState.EnsureInForeground();
            };
            this.viewModel.WindowCloseRequested += (o, e) =>
            {
                // Always minimize, regardless of settings
                this.application.ShutdownMode = ShutdownMode.OnExplicitShutdown;
                this.applicationWindowState.CloseToTray();
            };
            this.viewModel.ExitRequested += (o, e) => this.application.Shutdown();

            this.syncThingManager.TransferHistory.FolderSynchronizationFinished += this.FolderSynchronizationFinished;

            this.syncThingManager.DeviceConnected += (o, e) =>
            {
                if (this.ShowDeviceConnectivityBalloons &&
                    DateTime.UtcNow - this.syncThingManager.StartedTime > syncedDeadTime)
                {
                    this.taskbarIcon.HideBalloonTip();
                    this.taskbarIcon.ShowBalloonTip(Resources.TrayIcon_Balloon_DeviceConnected_Title, String.Format(Resources.TrayIcon_Balloon_DeviceConnected_Message, e.Device.Name), BalloonIcon.Info);
                }
            };

            this.syncThingManager.DeviceDisconnected += (o, e) =>
            {
                if (this.ShowDeviceConnectivityBalloons &&
                    DateTime.UtcNow - this.syncThingManager.StartedTime > syncedDeadTime)
                {
                    this.taskbarIcon.HideBalloonTip();
                    this.taskbarIcon.ShowBalloonTip(Resources.TrayIcon_Balloon_DeviceDisconnected_Title, String.Format(Resources.TrayIcon_Balloon_DeviceDisconnected_Message, e.Device.Name), BalloonIcon.Info);
                }
            };
        }
 /// <summary>
 ///     Initializes a new instance of the <see cref="ApplicationStateManager" /> class.
 /// </summary>
 public ApplicationStateManager([NotNull] ISerializer serializer, [NotNull] IViewModelProvider viewModelProvider,
     [NotNull] IViewManager viewManager, [NotNull] IViewModelPresenter viewModelPresenter)
 {
     Should.NotBeNull(serializer, "serializer");
     Should.NotBeNull(viewModelProvider, "viewModelProvider");
     Should.NotBeNull(viewManager, "viewManager");
     Should.NotBeNull(viewModelPresenter, "viewModelPresenter");
     _serializer = serializer;
     _viewModelProvider = viewModelProvider;
     _viewManager = viewManager;
     _viewModelPresenter = viewModelPresenter;
 }
Exemplo n.º 49
0
 /// <summary>
 /// Initializes a new instance of the <see cref="NavigationState"/> class.
 /// </summary>
 public NavigationState(IViewManager viewManager)
 {
     HttpContext currentContext = HttpContext.Current;
     if (currentContext != null)
     {
         _currentView = viewManager.GetView(currentContext.Request.Path);
             //ConfigUtil.Settings.GetView(currentContext.Request.Path);
         if (currentContext.Request.UrlReferrer != null)
         {
             _previousView = viewManager.GetView(currentContext.Request.UrlReferrer.LocalPath);
                 //ConfigUtil.Settings.GetView(currentContext.Request.UrlReferrer.LocalPath);
         }
     }
 }
Exemplo n.º 50
0
        public DefaultProcessor(Game game, IViewManager viewManager, PhysicsManager physics )
        {
            this.game = game;
            this.viewManager = viewManager;
            this.physics = physics;

            Manipulations2D enabledManipulations = Manipulations2D.Rotate | Manipulations2D.Scale | Manipulations2D.Translate;
            manipulationProcessor = new ManipulationProcessor2D(enabledManipulations);

            manipulationProcessor.Pivot = new ManipulationPivot2D();
            manipulationProcessor.Pivot.Radius = 10;

            manipulationProcessor.Started += OnManipulationStarted;
            manipulationProcessor.Delta += OnManipulationDelta;
            manipulationProcessor.Completed += OnManipulationCompleted;
        }
Exemplo n.º 51
0
        public OpenGLWindow(IMessageBus bus, ITimer timer, ICamera camera, IViewManager viewManager,
                            IAssetManager assetManager, IGameObjectFactory factory)
            : base(1280, 720, new GraphicsMode(32, 0, 0, 4), "Test")
        {
            Bus = bus;
            Timer = timer;
            _camera = camera;
            _viewManager = viewManager;
            _assetManager = assetManager;
            _factory = factory;

            VSync = VSyncMode.On;

            Mouse.WheelChanged += (sender, args) =>
                {
                    _camera.Eye += new Vect3(0, 0, args.DeltaPrecise *-2.0);
                };
        }
Exemplo n.º 52
0
 public void Draw(IViewManager view)
 {
     foreach (var mesh in _model.Meshes)
     {
         foreach (BasicEffect effect in mesh.Effects)
         {
             effect.World = _meshTransform * Transform.Combined;
             effect.View = view.View;
             effect.Projection = view.Projection;
             effect.DiffuseColor = _diffuseColor;
             if (!this.IsActive)
             {
                 effect.DiffuseColor *= 0.5f;
             }
         }
         mesh.Draw();
     }
 }
Exemplo n.º 53
0
        public void Draw(IViewManager view)
        {
            _effect.Projection = view.Projection;
            _effect.View = view.View;
            _effect.World = Matrix.CreateScale(0.2f) *
                Matrix.CreateRotationX(_rotation) *
                Matrix.CreateTranslation(_position);

            foreach (EffectPass pass in _effect.CurrentTechnique.Passes)
            {
                pass.Apply();
                view.Device.DrawUserPrimitives(PrimitiveType.TriangleList,
                    new VertexPositionColor[] {
                    new VertexPositionColor(new Vector3(0.0f, -1.0f, 0.0f), _color),
                    new VertexPositionColor(new Vector3(0.0f, 1.0f, 0.0f), _color),
                    new VertexPositionColor(new Vector3(0.0f, 0.0f, 1.0f), _color),
                }, 0, 1);
            }
        }
        public ReactComponentData(IViewManager manager)
        {
            Manager = manager;

            var managerType = manager.GetType();
            var moduleAttr = managerType.GetCustomAttribute<ReactModuleAttribute>();
            var name = moduleAttr.Name;

            if (string.IsNullOrWhiteSpace(name))
            {
                name = managerType.Name;

                if (name.EndsWith("Manager"))
                {
                    name = name.Substring(0, name.Length - "Manager".Length);
                }
            }

            Name = name;
        }
Exemplo n.º 55
0
        /// <summary>
        /// Default constructor.
        /// </summary>
        public App1()
        {
            this.IsFixedTimeStep = false;
            TaskManager.IsThreadingEnabled = false;
            instance = this;

            Content.RootDirectory = "Content";

            graphics = new GraphicsDeviceManager(this);
            graphics.SynchronizeWithVerticalRetrace = false;

            _viewManager = new ViewManager(this);
            _viewManager.BackgroundColor = backgroundColor;

            _physics = new PhysicsManager(this);
            this.Components.Add(new PhysicsScene(this, _physics));

            _inputManager = new InputManager(this, _viewManager, _physics);
            _tangibles = new Tangibles(this, _viewManager, _physics);

        }
Exemplo n.º 56
0
        ICommandProcessor CreateCommandProcessor(bool enableSnapshotting, IViewManager viewManager, ConcurrentQueue<DispatchStats> handleTimes)
        {
            return CommandProcessor.With()
                .EventStore(e => e.UseMongoDb(_database, "Events"))
                .EventDispatcher(e =>
                {
                    var items = new Dictionary<string, object> { { "stats", handleTimes } };

                    e.UseViewManagerEventDispatcher(viewManager)
                        .WithViewContext(items);
                })
                .Options(o =>
                {
                    if (enableSnapshotting)
                    {
                        Console.WriteLine("Enabling snapshotting");

                        o.EnableExperimentalMongoDbSnapshotting(_database, "Snapshots");
                    }
                })
                .Create();
        }
Exemplo n.º 57
0
        public NotifyIconManager(
            IViewManager viewManager,
            NotifyIconViewModel viewModel,
            IApplicationState application,
            IApplicationWindowState applicationWindowState,
            ISyncthingManager syncthingManager)
        {
            this.viewManager = viewManager;
            this.viewModel = viewModel;
            this.application = application;
            this.applicationWindowState = applicationWindowState;
            this.syncthingManager = syncthingManager;

            this.taskbarIcon = (TaskbarIcon)this.application.FindResource("TaskbarIcon");
            // Need to hold off until after the application is started, otherwise the ViewManager won't be set
            this.application.Startup += this.ApplicationStartup;

            this.applicationWindowState.RootWindowActivated += this.RootViewModelActivated;
            this.applicationWindowState.RootWindowDeactivated += this.RootViewModelDeactivated;
            this.applicationWindowState.RootWindowClosed += this.RootViewModelClosed;

            this.viewModel.WindowOpenRequested += (o, e) =>
            {
                this.applicationWindowState.EnsureInForeground();
            };
            this.viewModel.WindowCloseRequested += (o, e) =>
            {
                // Always minimize, regardless of settings
                this.application.ShutdownMode = ShutdownMode.OnExplicitShutdown;
                this.applicationWindowState.CloseToTray();
            };
            this.viewModel.ExitRequested += (o, e) => this.application.Shutdown();

            this.syncthingManager.TransferHistory.FolderSynchronizationFinished += this.FolderSynchronizationFinished;
            this.syncthingManager.Devices.DeviceConnected += this.DeviceConnected;
            this.syncthingManager.Devices.DeviceDisconnected += this.DeviceDisconnected;
        }
Exemplo n.º 58
0
 public WindowManagerWithoutCreateWindow(IViewManager viewManager, Func<IMessageBoxViewModel> messageBoxViewModelFactory, IWindowManagerConfig config)
     : base(viewManager, messageBoxViewModelFactory, config) { }
Exemplo n.º 59
0
 public MyWindowManager(IViewManager viewManager, Func<IMessageBoxViewModel> messageBoxViewModelFactory, IWindowManagerConfig config)
     : base(viewManager, messageBoxViewModelFactory, config) { }
Exemplo n.º 60
0
 public void RegisterTimeSpent(IViewManager viewManager, DomainEvent domainEvent, TimeSpan duration)
 {
 }