コード例 #1
0
        protected override void OnResume()
        {
            // Handle when your app resumes
            base.OnResume();

            DependencyLocator.Resolve <INavigationService>().InitAfterResumeApp();
        }
コード例 #2
0
 public TranslateExtension()
 {
     if (Device.RuntimePlatform == Device.iOS || Device.RuntimePlatform == Device.Android)
     {
         ci = DependencyLocator.Get <ILocalize>().GetCurrentCultureInfo();
     }
 }
コード例 #3
0
    void Start()
    {
        this.timelineController = DependencyLocator.getTimelineController();
        this.timerLabel         = this.GetComponent <TextMeshProUGUI>();

        this.timelineController.Events.onTimerChange += this.RenderTimer;
    }
コード例 #4
0
        public void Test_Locator_finds_single_dependency()
        {
            _locator = new DependencyLocator(Path.Combine(TestDataExtracted, "x64"));

            var result = _locator.LocateDependencies(new [] { "DependencyA.dll" });

            Assert.That(result, Has.Exactly(1).Items);
        }
コード例 #5
0
    public ActivePlayableState(ActorFacade actor)
    {
        this.actor = actor;

        this.combatActionsMapping = DependencyLocator.GetActionsMapper <CombatActionsMapping>();
        this.skillQueueResolver   = DependencyLocator.GetSkillQueueResolver();
        this.tilemapManager       = DependencyLocator.getTilemapManager();
    }
コード例 #6
0
 public static void RegisterViews()
 {
     DependencyLocator.Register <MasterViewModel>(DependencyLocatorTarget.GlobalInstance);
     DependencyLocator.Register <MainViewModel>(DependencyLocatorTarget.GlobalInstance);
     DependencyLocator.Register <OldMainViewModel>(DependencyLocatorTarget.GlobalInstance);
     DependencyLocator.Register <DetailViewModel>(DependencyLocatorTarget.GlobalInstance);
     DependencyLocator.Register <CheckViewModel>(DependencyLocatorTarget.GlobalInstance);
 }
コード例 #7
0
 public void SetViewModel <T>(object initialData = null) where T : BasePageViewModel
 {
     try
     {
         BindingContext = ViewModel = DependencyLocator.Resolve <T>(initialData);
     }
     catch (Exception e)
     { }
 }
コード例 #8
0
        public void Test_Locator_accept_filter_include_rules()
        {
            var path = _createDummyStructure();

            _locator = new DependencyLocator(path);
            _locator.Includes.Add(@"\\B\\");

            Assert.That(() => _locator.LocateDependencies(new[] { "foo.dll" }), Throws.Nothing);
        }
コード例 #9
0
 public static Finder <TileFacade> getTileFinder()
 {
     if (instance.tileFinder == null)
     {
         TilemapManager tilemap = DependencyLocator.getTilemapManager();
         instance.tileFinder = new Finder <TileFacade>(tilemap.TilesMap);
     }
     return(instance.tileFinder);
 }
コード例 #10
0
        protected override void OnSleep()
        {
            base.OnSleep();

            BaseSingleton <GlobalSetting> .Instance.SaveState();

            MessagingCenter.Unsubscribe <object, INotificationMessage>(this, NotificationService.RESIDENT_VEHICLE_DETAIL_RECEIVED_NOTIFICATION);

            DependencyLocator.Resolve <INavigationService>().UnsubscribeAfterSleepApp();
        }
コード例 #11
0
    public CombatGameState(GameStateMachine gameStateMachine)
    {
        this.gameStateMachine = gameStateMachine;

        this.tilemapManager       = DependencyLocator.getTilemapManager();
        this.timelineController   = DependencyLocator.getTimelineController();
        this.skillQueueResolver   = DependencyLocator.GetSkillQueueResolver();
        this.combatActionsMapping = DependencyLocator.GetActionsMapper <CombatActionsMapping>();
        this.spawner = DependencyLocator.GetSpawner();
    }
コード例 #12
0
        public void Test_Locator_accept_filter_exclude_and_include_regex_rules()
        {
            // Create a valid exclude and a valid include
            var path = _createDummyStructure();

            _locator = new DependencyLocator(path);
            _locator.Excludes.Add(@".*B\\");
            _locator.Includes.Add(@".*");

            Assert.That(() => _locator.LocateDependencies(new[] { "foo.dll" }), Throws.Nothing);
        }
コード例 #13
0
        public static void PrioritizeAndThrottleDataJobs(int maxJobs = 5)
        {
            var jm = DependencyLocator.Get <JobManager>();

            //jm.AddQueueWithPrioritizer<HistoricalDataJobPrioritizer>();
            jm.AddQueue(new JobQueue
            {
                MaxConcurrentJobs = 5,
                Prioritizer       = new HistoricalDataJobPrioritizer(),
            });
        }
コード例 #14
0
        /// <summary>
        ///     ctor().
        /// </summary>
        public StepBaseViewModel()
        {
            _validationObjectFactory = DependencyLocator.Resolve <IValidationObjectFactory>();

            ActionBarViewModel = DependencyLocator.Resolve <IdentityAccountingActionBarViewModel>();
            ((IdentityAccountingActionBarViewModel)ActionBarViewModel).InitializeAsync(this);

            _mainInput = _validationObjectFactory.GetValidatableObject <string>();

            ResetValidationObjects();
        }
コード例 #15
0
 private void Awake()
 {
     if (instance != null && instance != this)
     {
         Destroy(this);
     }
     else
     {
         instance = this;
     }
 }
コード例 #16
0
        public NewPostViewModel(
            IPickMediaService pickMediaService,
            IValidationObjectFactory validationObjectFactory)
        {
            _pickMediaService        = pickMediaService;
            _validationObjectFactory = validationObjectFactory;

            ResetValidationObjects();
            AttachedPostMedias = new ObservableCollection <AttachedAnnounceMediaBase>();

            ActionBarViewModel = DependencyLocator.Resolve <NewPostActionBarViewModel>();
        }
コード例 #17
0
        /// <summary>
        ///     ctor();
        /// </summary>
        public DriveAutoDetailsViewModel(IPickMediaService pickMediaService,
                                         IVisionService visionService,
                                         IDriveAutoService driveAutoService)
        {
            _visionService    = visionService;
            _pickMediaService = pickMediaService;
            _driveAutoService = driveAutoService;

            ActionBarViewModel = DependencyLocator.Resolve <CommonActionBarViewModel>();

            IsBackButtonAvailable = NavigationService.IsBackButtonAvailable;
        }
コード例 #18
0
        /// <summary>
        ///     ctor().
        /// </summary>
        public App()
        {
            InitializeComponent();

            InitApp();

#if DEBUG
            //TrackMemoryUsage();
#endif

            MessagingCenter.Subscribe <object, INotificationMessage>(this, NotificationService.RESIDENT_VEHICLE_DETAIL_RECEIVED_NOTIFICATION, (sender, args) => {
                DependencyLocator.Resolve <INotificationService>().InvokeReceivedResidentVehicleDetailInfo(args);
            });
        }
コード例 #19
0
    public SkillEffect(SkillInput skillInput, Skill skill, int effectDuration)
    {
        this.skillQueueResolver = DependencyLocator.GetSkillQueueResolver();
        this.timelineController = DependencyLocator.getTimelineController();

        this.uniqId = (this.timelineController.CurrentPassAgent.UniqId.groupId, ++SkillEffect.selfIdCount);

        int atb = (int)Mathf.Floor(100 - this.timelineController.CurrentPassPriorityScore * this.Speed) % 100;

        atb      = (atb + 100) % 100;
        this.Atb = atb;

        this.skillInput     = skillInput;
        this.skill          = skill;
        this.effectDuration = effectDuration;
    }
コード例 #20
0
ファイル: App.xaml.cs プロジェクト: ydanila/SpectreTool
        /// <summary>
        /// Invoked when the application is launched normally by the end user.  Other entry points
        /// will be used such as when the application is launched to open a specific file.
        /// </summary>
        /// <param name="e">Details about the launch request and process.</param>
        protected override void OnLaunched(LaunchActivatedEventArgs e)
        {
            Frame rootFrame = Window.Current.Content as Frame;

            // Do not repeat app initialization when the Window already has content,
            // just ensure that the window is active
            if (rootFrame == null)
            {
                // Create a Frame to act as the navigation context and navigate to the first page
                rootFrame = new Frame();

                rootFrame.NavigationFailed += OnNavigationFailed;

                var rendererAssemblies = new[]
                {
                    typeof(HtmlLabelRenderer).GetTypeInfo().Assembly
                };
                Xamarin.Forms.Forms.Init(e, rendererAssemblies);
                HtmlLabelRenderer.Initialize();

                DependencyLocator.Register <IInfoProvider, InfoProvider>();

                if (e.PreviousExecutionState == ApplicationExecutionState.Terminated)
                {
                    //TODO: Load state from previously suspended application
                }

                // Place the frame in the current Window
                Window.Current.Content = rootFrame;
            }

            if (rootFrame.Content == null)
            {
                // When the navigation stack isn't restored navigate to the first page,
                // configuring the new page by passing required information as a navigation
                // parameter
                rootFrame.Navigate(typeof(MainPage), e.Arguments);
            }
            // Ensure the current window is active
            Window.Current.Activate();
        }
コード例 #21
0
 public override bool Process()
 {
     DependencyLocator.getTimelineController().EndPass();
     return(true);
 }
コード例 #22
0
 public ClassActivator(DependencyLocator activator, DependencyInjector injector)
 {
     Activator = activator;
     Injector  = injector;
 }
コード例 #23
0
 public BaseViewModel()
 {
     navigationService = DependencyLocator.Resolve <INavigationService>();
     userDialogService = DependencyLocator.Resolve <IUserDialogService>();
 }
コード例 #24
0
 public override bool Process()
 {
     DependencyLocator.getTimelineController().AddAgentInPasses(new SkillEffect(this.skillInput, this.skill, this.effectDuration));
     return(true);
 }
コード例 #25
0
        public MapPage()
        {
            InitializeComponent();

            BindingContext = DependencyLocator.Resolve <MapViewModel>();
        }
コード例 #26
0
 void Start()
 {
     this.timelineController = DependencyLocator.getTimelineController();
     this.timelineController.Events.onPassesChange += this.RenderTurns;
 }
コード例 #27
0
    public MoveProcess(ActorFacade actor, TileFacade dest, ITopology topology, IFilter filter)
    {
        HashSet <TileFacade> path = DependencyLocator.getTileFinder().findPath(actor.GetTile(), dest, topology, filter);

        this.moveAlongPathProcess = new MoveAlongPathProcess(actor, path, null, this.moveSpeed, this.treshold);
    }
コード例 #28
0
ファイル: MainActivity.cs プロジェクト: ydanila/SpectreTool
 public void RegisterTypes()
 {
     DependencyLocator.Register <ILocalize, Localize>(DependencyLocatorTarget.GlobalInstance);
 }
コード例 #29
0
 public void SetUp()
 {
     _locator = new DependencyLocator(TestDataExtracted);
 }
コード例 #30
0
        public void Test_Locator_throws_if_no_dependencies_found()
        {
            _locator = new DependencyLocator(Path.Combine(TestDataExtracted, "x64"));

            Assert.That(() => _locator.LocateDependencies(new[] { "Does_not_Exist.dll" }), Throws.TypeOf <DependencyLocatorException>());
        }