コード例 #1
0
ファイル: ContentView.cs プロジェクト: Catel/Catel
        /// <summary>
        ///     Initializes a new instance of the <see cref="ContentView" /> class.
        /// </summary>
        protected ContentView()
        {
            var dependencyResolver = this.GetDependencyResolver();
            _viewManager = dependencyResolver.Resolve<IViewManager>();

            DataContextChanged += OnDataContextChanged;
        }
コード例 #2
0
ファイル: ContentPage.cs プロジェクト: Catel/Catel
        /// <summary>
        /// Initializes a new instance of the <see cref="ContentPage"/> class.
        /// </summary>
        public ContentPage()
        {
            var dependencyResolver = this.GetDependencyResolver();
            _viewManager = dependencyResolver.Resolve<IViewManager>();

            DataContextChanged += OnDataContextChanged;
        }
コード例 #3
0
            public MyBootstrapperBase(IViewManager viewManager, IWindowManager windowManager)
            {
                this.viewManager = viewManager;
                this.windowManager = windowManager;

                this.Start(new string[0]);
            }
コード例 #4
0
ファイル: MainWindow.cs プロジェクト: Ricordanza/poderosa
        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();
        }
コード例 #5
0
 public ImprovedProcessor(Game game, IViewManager viewManager, PhysicsManager physics )
 {
     this._game = game;
     this._viewManager = viewManager;
     this._physics = physics;
     initialize();
 }
コード例 #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();
         }
     }
 }
コード例 #7
0
ファイル: Holodeck.cs プロジェクト: nagyistoce/flightsim
        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";
        }
コード例 #8
0
ファイル: FreeLookState.cs プロジェクト: nagyistoce/flightsim
        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;
        }
コード例 #9
0
ファイル: ViewExportService.cs プロジェクト: JaysonJG/Catel
        /// <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;
        }
コード例 #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);
		}
コード例 #11
0
 public BaseController(IViewManager viewManager,
                       IEventPublisher eventPublisher,
                       IDeploymentManagement deploymentManagement)
 {
     this.ViewManager = viewManager;
     this.EventPublisher = eventPublisher;
     this.DeploymentManagement = deploymentManagement;
 }
コード例 #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.");
		}
コード例 #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);
            }
コード例 #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);
        }
コード例 #15
0
        /// <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));
        }
コード例 #16
0
		private void BeforeDestroying()
		{
			_mediatorMap.UnmediateAll ();
			if (_injector.SatisfiesDirectly (typeof(IViewManager))) 
			{
				_viewManager = _injector.GetInstance (typeof(IViewManager)) as IViewManager;
				_viewManager.RemoveViewHandler (_mediatorMap);
			}
		}
コード例 #17
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);
			}
		}
コード例 #18
0
 private void BeforeDestroying()
 {
     _mediatorMap.UnmediateAll();
     if (_injector.SatisfiesDirectly(typeof(IViewManager)))
     {
         _viewManager = _injector.GetInstance(typeof(IViewManager)) as IViewManager;
         _viewManager.RemoveViewHandler(_mediatorMap);
     }
 }
コード例 #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);
            }
        }
コード例 #20
0
 public void AddViewManager(IViewManager viewManager)
 {
     if (viewManager == null)
     {
         throw new ArgumentNullException("viewManager");
     }
     _logger.Info("Adding view manager: {0}", viewManager);
     _viewManagers.Enqueue(viewManager);
 }
コード例 #21
0
        public TestContext AddViewManager(IViewManager viewManager)
        {
            WithEventDispatcherOfType <ViewManagerEventDispatcher>(x =>
            {
                x.AddViewManager(viewManager);
            });

            return(this);
        }
コード例 #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);
            }
コード例 #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>();
        }
コード例 #24
0
 public BuildsListView(
     IViewManager viewManager,
     IBuildTemplateManager buildTemplateManager)
 {
     this.viewManager          = viewManager.ThrowIfNull(nameof(viewManager));
     this.buildTemplateManager = buildTemplateManager.ThrowIfNull(nameof(buildTemplateManager));
     this.InitializeComponent();
     this.LoadBuilds();
 }
コード例 #25
0
        public ViewManagerTest()
        {
            statsComponent = new StatsComponent(new SimpleEventQueue());
            tagsComponent  = new TagsComponent();

            tagger        = tagsComponent.Tagger;
            viewManager   = statsComponent.ViewManager;
            statsRecorder = statsComponent.StatsRecorder;
        }
コード例 #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;
        }
コード例 #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();
 }
コード例 #28
0
        public NotesView(IViewManager viewManager, INoteService noteService)
        {
            this.InitializeComponent();

            PFNotesViewModel vm = (PFNotesViewModel)this.DataContext;

            vm.ViewManager = viewManager;
            vm.NoteService = noteService;
        }
コード例 #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;
 }
コード例 #31
0
ファイル: PhysicsScene.cs プロジェクト: forestrf/Henge3D
        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.");
            }
        }
コード例 #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");
        }
コード例 #33
0
 public ModuleDefinitionController(IModuleManager moduleManager,
                                   ISecurityManager securityManager,
                                   IViewManager viewManager,
                                   IOptions <AppSettings> appSettings)
 {
     _moduleManager   = moduleManager;
     _securityManager = securityManager;
     _viewManager     = viewManager;
     _appSettings     = appSettings.Value;
 }
コード例 #34
0
 public LoginWindowVmFactory(IEventAggregator ea,
                             LoginModelViewModel loginModelVm,
                             RegisterViewModel registerVm,
                             IViewManager viewManager)
 {
     _ea           = ea;
     _loginModelVm = loginModelVm;
     _registerVm   = registerVm;
     _viewManager  = viewManager;
 }
コード例 #35
0
 public AssociationAddressController(
     ICommandProcessor commandProcessor,
     IViewManager <GetAddressesView> getAddressesView,
     IViewManager <GetAddressesWithResidentsView> getAddressesWithResidentsView
     )
 {
     _commandProcessor = commandProcessor;
     _getAddressesView = getAddressesView;
     _getAddressesWithResidentsView = getAddressesWithResidentsView;
 }
コード例 #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);
        }
コード例 #37
0
        private void BeforeDestroying()
        {
            _viewProcessorFactory.RunAllUnprocessors();

            if (_injector.SatisfiesDirectly(typeof(IViewManager)))
            {
                _viewManager = _injector.GetInstance(typeof(IViewManager)) as IViewManager;
                _viewManager.RemoveViewHandler(_viewProcessorMap as IViewHandler);
            }
        }
コード例 #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;
        }
コード例 #39
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);
			}
		}
コード例 #40
0
 public AssociationController(
     ICommandProcessor commandProcessor,
     IViewManager <GetAssociationsView> getAssociationsView,
     IViewManager <GetAssociationView> getAssociationView
     )
 {
     _commandProcessor    = commandProcessor;
     _getAssociationsView = getAssociationsView;
     _getAssociationView  = getAssociationView;
 }
コード例 #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);
            }
        }
コード例 #42
0
		private void BeforeDestroying()
		{
			_viewProcessorFactory.RunAllUnprocessors();

			if (_injector.SatisfiesDirectly(typeof(IViewManager)))
			{
				_viewManager = _injector.GetInstance(typeof(IViewManager)) as IViewManager;
				_viewManager.RemoveViewHandler(_viewProcessorMap as IViewHandler);
			}
		}
コード例 #43
0
 public TemplateController(IViewManager viewManager,
                           CacheEngine cacheEngine,
                           IViewComponentDescriptorCollectionProvider viewcomponents,
                           IParameterManager parameterManager)
 {
     _viewManager      = viewManager;
     _cacheEngine      = cacheEngine;
     _viewcomponents   = viewcomponents;
     _parameterManager = parameterManager;
 }
コード例 #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;
        }
コード例 #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);
        }
コード例 #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();
 }
コード例 #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);
                }
            };
        }
コード例 #48
0
 /// <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;
 }
コード例 #49
0
ファイル: NavigationState.cs プロジェクト: atczyc/castle
 /// <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);
         }
     }
 }
コード例 #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;
        }
コード例 #51
0
ファイル: OpenGLWindow.cs プロジェクト: veggielane/BlockRTS
        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);
                };
        }
コード例 #52
0
ファイル: ScaledCapsule.cs プロジェクト: nagyistoce/flightsim
 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();
     }
 }
コード例 #53
0
ファイル: Marker.cs プロジェクト: nagyistoce/flightsim
        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);
            }
        }
コード例 #54
0
        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;
        }
コード例 #55
0
ファイル: JengaMain.cs プロジェクト: jdddog/jengasimulatorp4p
        /// <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);

        }
コード例 #56
0
ファイル: TestNewNewSnapshotting.cs プロジェクト: dcga/Cirqus
        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();
        }
コード例 #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;
        }
コード例 #58
0
 public WindowManagerWithoutCreateWindow(IViewManager viewManager, Func<IMessageBoxViewModel> messageBoxViewModelFactory, IWindowManagerConfig config)
     : base(viewManager, messageBoxViewModelFactory, config) { }
コード例 #59
0
 public MyWindowManager(IViewManager viewManager, Func<IMessageBoxViewModel> messageBoxViewModelFactory, IWindowManagerConfig config)
     : base(viewManager, messageBoxViewModelFactory, config) { }
コード例 #60
0
ファイル: NullProfiler.cs プロジェクト: RichieYang/Cirqus
 public void RegisterTimeSpent(IViewManager viewManager, DomainEvent domainEvent, TimeSpan duration)
 {
 }