Exemplo n.º 1
0
        static async Task <List <ITick> > GetTicksAsync <ITick>(
            string symbol,
            DateTime?startTime,
            DateTime?endTime,
            Period period,
            ShowOption showOption,
            Func <string[], ITick> instanceFunction,
            CancellationToken token
            )
        {
            using (var stream = await GetResponseStreamAsync(symbol, startTime, endTime, period, showOption.Name(), token).ConfigureAwait(false))
                using (var sr = new StreamReader(stream))
                    using (var csvReader = new CsvReader(sr))
                    {
                        // It seems CsvReader does not skip the header.
                        // Until this gets fixed:
                        csvReader.Configuration.HasHeaderRecord = true;
                        csvReader.Read();

                        var ticks = new List <ITick>();

                        while (csvReader.Read())
                        {
                            var tick = instanceFunction(csvReader.Context.Record);
                            if (!tick.Equals(default(ITick)))
                            {
                                ticks.Add(tick);
                            }
                        }

                        return(ticks);
                    }
        }
Exemplo n.º 2
0
 public static void LoadDefaults()
 {
     GlobalStartUp      = (ShowOption)EditorPrefs.GetInt(PrefStartUp, 0);
     GlobalAutoSRP      = EditorPrefs.GetBool(PrefAutoSRP, true);
     GlobalUseMacros    = EditorPrefs.GetBool(PrefUseMacros, false);
     GlobalDefineSymbol = EditorPrefs.GetBool(PrefDefineSymbol, true);
 }
Exemplo n.º 3
0
        public void CreateLaunchSdkWarningSetting(ShowOption sdkShowOption, string[] versionsToHide,
                                                  bool showSdkWarning)
        {
            SetupSdkCompatibility(GameletSdkCompatibilityResult.NotCompatibleOutsideOfRange);
            var launchRequest = new LaunchGameRequest();

            SetupParamsParser(launchRequest, ConfigStatus.OkStatus());
            var launchGameResponse = new LaunchGameResponse
            {
                GameLaunchName = _gameLaunchName, RequestId = launchRequest.RequestId
            };

            SetupGameLaunchApi(launchRequest, launchGameResponse);
            _yetiVsiService.Options.SdkCompatibilityWarningOption.Returns(sdkShowOption);
            _yetiVsiService.Options
            .SdkVersionsAreHidden(Arg.Any <string>(), Arg.Any <string>(), Arg.Any <string>())
            .Returns(false);
            foreach (string versions in versionsToHide)
            {
                string gameletVersion = versions.Split('/')[0];
                string localVersion   = versions.Split('/')[1];
                _yetiVsiService.Options
                .SdkVersionsAreHidden(gameletVersion, localVersion, _gameletName).Returns(true);
            }

            IVsiGameLaunch result = _target.CreateLaunch(_launchParams);

            Assert.That(result, Is.Not.Null);
            _dialogUtil.DidNotReceiveWithAnyArgs().ShowError(default);
        private static async Task <List <ITick> > GetTicksAsync <ITick>(
            string symbol,
            DateTime?startTime,
            DateTime?endTime,
            Period period,
            ShowOption showOption,
            Func <string[], ITick> instanceFunction,
            CancellationToken token
            )
        {
            using (var stream = await GetResponseStreamAsync(symbol, startTime, endTime, period, showOption.Name(), token).ConfigureAwait(false))
                using (var sr = new StreamReader(stream))
                    using (var csvReader = new CsvReader(sr))
                    {
                        csvReader.Read(); // skip header

                        var ticks = new List <ITick>();

                        while (csvReader.Read())
                        {
                            var tick = instanceFunction(csvReader.Context.Record);
#pragma warning disable RECS0017 // Possible compare of value type with 'null'
                            if (tick != null)
#pragma warning restore RECS0017 // Possible compare of value type with 'null'
                            {
                                ticks.Add(tick);
                            }
                        }

                        return(ticks);
                    }
        }
Exemplo n.º 5
0
 public static void LoadDefaults()
 {
     GlobalStartUp      = (ShowOption)EditorPrefs.GetInt(PrefStartUp, 0);
     GlobalAutoSRP      = EditorPrefs.GetBool(PrefAutoSRP, true);
     GlobalDefineSymbol = EditorPrefs.GetBool(PrefDefineSymbol, true);
     GlobalClearLog     = EditorPrefs.GetBool(PrefClearLog, true);
 }
Exemplo n.º 6
0
        public ProgramOfferingListViewModel(
            IAsyncRequestDispatcherFactory asyncRequestDispatcherFactory,
            IAccessControlManager accessControlManager,
            IUserDialogService userDialogService,
            IPopupService popupService,
            ICommandFactory commandFactory)
            : base(accessControlManager, commandFactory)
        {
            _asyncRequestDispatcherFactory = asyncRequestDispatcherFactory;
            _pagedCollectionViewWrapper    = new PagedCollectionViewWrapper <ProgramOfferingDto> ();
            _userDialogService             = userDialogService;
            _popupService = popupService;

            var commandFactoryHelper = CommandFactoryHelper.CreateHelper(this, commandFactory);

            _showAllCommand              = commandFactoryHelper.BuildDelegateCommand(() => ShowAllCommand, ExecuteShowAll);
            _showActiveOnlyCommand       = commandFactoryHelper.BuildDelegateCommand(() => ShowActiveOnlyCommand, ExecuteShowActiveOnly);
            ToggleActiveIndicatorCommand = commandFactoryHelper.BuildDelegateCommand <ProgramOfferingDto> (
                () => ToggleActiveIndicatorCommand, ExecuteToggleActiveIndicator);
            ShowProgramOfferingAddCommand = commandFactoryHelper.BuildDelegateCommand <object> (
                () => ShowProgramOfferingAddCommand, ExecuteShowProgramOfferingAddCommand);
            ShowProgramOfferingEditCommand = commandFactoryHelper.BuildDelegateCommand <ProgramOfferingDto> (
                () => ShowProgramOfferingEditCommand, ExecuteShowProgramOfferingEditCommand);
            DeleteProgramOfferingCommand = commandFactoryHelper.BuildDelegateCommand <ProgramOfferingDto> (
                () => DeleteProgramOfferingCommand, ExecuteDeleteProgramOfferingCommand);

            _showOption = ShowOption.ShowActive;
            _filter     = FilterByActiveStatus;
            InitializeGroupingDescriptions();
        }
 private void ExecuteShowAll()
 {
     if (_showOption != ShowOption.ShowAll)
     {
         _showOption = ShowOption.ShowAll;
         PagedCollectionViewWrapper.SetFilter(_filter);
     }
 }
Exemplo n.º 8
0
        public static void PreferencesGUI()
        {
            if (!PrefsLoaded)
            {
                LoadDefaults();
                PrefsLoaded = true;
            }

            var cache = EditorGUIUtility.labelWidth;

            EditorGUIUtility.labelWidth = 250;
            EditorGUI.BeginChangeCheck();
            GlobalStartUp = (ShowOption)EditorGUILayout.EnumPopup(StartUp, GlobalStartUp);
            if (EditorGUI.EndChangeCheck())
            {
                EditorPrefs.SetInt(PrefStartUp, (int)GlobalStartUp);
            }

            EditorGUI.BeginChangeCheck();
            GlobalAutoSRP = EditorGUILayout.Toggle(AutoSRP, GlobalAutoSRP);
            if (EditorGUI.EndChangeCheck())
            {
                EditorPrefs.SetBool(PrefAutoSRP, GlobalAutoSRP);
            }

            EditorGUI.BeginChangeCheck();
            GlobalDefineSymbol = EditorGUILayout.Toggle(DefineSymbol, GlobalDefineSymbol);
            if (EditorGUI.EndChangeCheck())
            {
                EditorPrefs.SetBool(PrefDefineSymbol, GlobalDefineSymbol);
                if (GlobalDefineSymbol)
                {
                    IOUtils.SetAmplifyDefineSymbolOnBuildTargetGroup(EditorUserBuildSettings.selectedBuildTargetGroup);
                }
                else
                {
                    IOUtils.RemoveAmplifyDefineSymbolOnBuildTargetGroup(EditorUserBuildSettings.selectedBuildTargetGroup);
                }
            }

            EditorGUILayout.BeginHorizontal();
            GUILayout.FlexibleSpace();
            if (GUILayout.Button("Reset and Forget All"))
            {
                EditorPrefs.DeleteKey(PrefStartUp);
                GlobalStartUp = ShowOption.Always;

                EditorPrefs.DeleteKey(PrefAutoSRP);
                GlobalAutoSRP = true;

                EditorPrefs.DeleteKey(PrefDefineSymbol);
                GlobalDefineSymbol = true;
                IOUtils.SetAmplifyDefineSymbolOnBuildTargetGroup(EditorUserBuildSettings.selectedBuildTargetGroup);
            }
            EditorGUILayout.EndHorizontal();
            EditorGUIUtility.labelWidth = cache;
        }
Exemplo n.º 9
0
        private void ExecuteShowActiveOnly()
        {
            if (_showOption == ShowOption.ShowActive)
            {
                return;
            }
            _showOption = ShowOption.ShowActive;

            PagedCollectionViewWrapper.SetFilter(_filter);
        }
Exemplo n.º 10
0
        public static void LoadDefaults()
        {
            GlobalStartUp           = (ShowOption)EditorPrefs.GetInt(PrefStartUp, 0);
            GlobalAutoSRP           = EditorPrefs.GetBool(PrefAutoSRP, true);
            GlobalDefineSymbol      = EditorPrefs.GetBool(PrefDefineSymbol, true);
            GlobalClearLog          = EditorPrefs.GetBool(PrefClearLog, true);
            GlobalUpdateOnSceneSave = EditorPrefs.GetBool(PrefUpdateOnSceneSave, true);
#if UNITY_2019_4_OR_NEWER
            GlobalShowAsyncMsg = EditorPrefs.GetBool(PrefShowAsyncMsg, true);
#endif
        }
Exemplo n.º 11
0
    void AddUI(UIBasePanel basePanel, UIType _uiType, ShowOption _showOpt)
    {
        SetToProperParent(basePanel);

        // 관리되기를 원하지 않으면, 리스트에 추가는 하지 않는다.
        if (!basePanel.Managed)
        {
            return;
        }

        AddShowingList(basePanel);
    }
Exemplo n.º 12
0
        public CaseProblemListViewModel(
            IUserDialogService userDialogService,
            IEventAggregator eventAggregator,
            IAsyncRequestDispatcherFactory asyncRequestDispatcherFactory,
            IAccessControlManager accessControlManager,
            IPopupService popupService,
            ICommandFactory commandFactory)
            : base(accessControlManager, commandFactory)
        {
            _popupService = popupService;
            _showOption   = ShowOption.ShowActive;
            _filter       = FilterByActiveStatus;

            _userDialogService             = userDialogService;
            _eventAggregator               = eventAggregator;
            _asyncRequestDispatcherFactory = asyncRequestDispatcherFactory;

            var requestDispatcher = _asyncRequestDispatcherFactory.CreateAsyncRequestDispatcher();

            IsLoading = true;
            requestDispatcher
            .AddLookupValuesRequest(ProblemTypeLookupName)
            .AddLookupValuesRequest(ProblemStatusLookupName)
            .ProcessRequests(HandleGetLookupValuesCompleted, HandleGetLookupValuesException);

            _pagedCollectionViewWrapper = new PagedCollectionViewWrapper <ProblemDto> ();

            InitializeGroupingDescriptions();

            var commandFactoryHelper = CommandFactoryHelper.CreateHelper(this, commandFactory);

            ShowAllCommand        = commandFactoryHelper.BuildDelegateCommand(() => ShowAllCommand, ExecuteShowAll);
            ShowActiveOnlyCommand = commandFactoryHelper.BuildDelegateCommand(() => ShowActiveOnlyCommand, ExecuteShowActiveOnly);
            DeleteProblemCommand  = commandFactoryHelper.BuildDelegateCommand <ProblemDto> (
                () => DeleteProblemCommand, ExecuteDeleteProblem, CanExecuteDeleteProblem);

            _eventAggregator.GetEvent <ClinicalCaseChangedEvent> ().Subscribe(
                ClinicalCaseChangedEventHandler,
                ThreadOption.BackgroundThread,
                false,
                FilterClinicalCaseChangedEvents);

            EditProblemCommand        = commandFactoryHelper.BuildDelegateCommand <ProblemDto> (() => EditProblemCommand, ExecuteEditProblemCommand);
            DragQueryCommand          = commandFactoryHelper.BuildDelegateCommand <DragDropQueryEventArgs> (() => DragQueryCommand, ExecuteDragQueryCommand);
            GenerateHL7ProblemCommand = commandFactoryHelper.BuildDelegateCommand <ProblemDto> (
                () => GenerateHL7ProblemCommand, ExecuteGenerateHL7ProblemCommand);
        }
Exemplo n.º 13
0
        public ProgramEnrollmentListViewModel(
            IUserDialogService userDialogService,
            IEventAggregator eventAggregator,
            IAsyncRequestDispatcherFactory asyncRequestDispatcherFactory,
            IAccessControlManager accessControlManager,
            IPopupService popupService,
            ICommandFactory commandFactory)
            : base(accessControlManager, commandFactory)
        {
            _popupService = popupService;
            _showOption   = ShowOption.ShowActive;
            _filter       = FilterByActiveStatus;

            _userDialogService             = userDialogService;
            _eventAggregator               = eventAggregator;
            _asyncRequestDispatcherFactory = asyncRequestDispatcherFactory;

            _pagedCollectionViewWrapper = new PagedCollectionViewWrapper <ProgramEnrollmentDto> ();

            InitializeGroupingDescriptions();

            var commandFactoryHelper = CommandFactoryHelper.CreateHelper(this, commandFactory);

            ShowAllCommand        = commandFactoryHelper.BuildDelegateCommand(() => ShowAllCommand, ExecuteShowAll);
            ShowActiveOnlyCommand = commandFactoryHelper.BuildDelegateCommand(() => ShowActiveOnlyCommand, ExecuteShowActiveOnly);

            CreateProgramEnrollmentCommand = commandFactoryHelper.BuildDelegateCommand(
                () => CreateProgramEnrollmentCommand, ExecuteCreateProgramEnrollmentCommand);
            EditProgramEnrollmentCommand = commandFactoryHelper.BuildDelegateCommand <ProgramEnrollmentDto> (
                () => EditProgramEnrollmentCommand, ExecuteEditProgramEnrollmentCommand);
            DisenrollProgramEnrollmentCommand =
                commandFactoryHelper.BuildDelegateCommand <ProgramEnrollmentDto> (
                    () => DisenrollProgramEnrollmentCommand, ExecuteDisenrollProgramEnrollmentCommand);
            DeleteProgramEnrollmentCommand = commandFactoryHelper.BuildDelegateCommand <ProgramEnrollmentDto> (
                () => DeleteProgramEnrollmentCommand, ExecuteDeleteProgramEnrollment, CanExecuteDeleteProgramEnrollment);
            DragQueryCommand = commandFactoryHelper.BuildDelegateCommand <DragDropQueryEventArgs> (() => DragQueryCommand, ExecuteDragQueryCommand);

            _eventAggregator.GetEvent <ClinicalCaseChangedEvent> ()
            .Subscribe(ClinicalCaseChangedEventHandler, ThreadOption.BackgroundThread, false, FilterClinicalCaseChangedEvents);

            _eventAggregator.GetEvent <ProgramEnrollmentChangedEvent> ()
            .Subscribe(ProgramEnrollmentChangedEventHandler, ThreadOption.BackgroundThread, false, FilterProgramEnrollmentChangedEvents);
        }
Exemplo n.º 14
0
        public MedicationListViewModel(
            IAsyncRequestDispatcherFactory asyncRequestDispatcherFactory,
            IUserDialogService userDialogService,
            IEventAggregator eventAggregator,
            IAccessControlManager accessControlManager,
            INavigationService navigationService,
            ICommandFactory commandFactory)
            : base(accessControlManager, commandFactory)
        {
            _asyncRequestDispatcherFactory = asyncRequestDispatcherFactory;
            _userDialogService             = userDialogService;
            _eventAggregator   = eventAggregator;
            _navigationService = navigationService;

            _pagedCollectionViewWrapper = new PagedCollectionViewWrapper <MedicationDto> ();

            var commandFactoryHelper = CommandFactoryHelper.CreateHelper(this, commandFactory);

            _showAllCommand              = commandFactoryHelper.BuildDelegateCommand(() => ShowAllCommand, ExecuteShowAll);
            _showActiveOnlyCommand       = commandFactoryHelper.BuildDelegateCommand(() => ShowActiveOnlyCommand, ExecuteShowActiveOnly);
            ToggleActiveIndicatorCommand = commandFactoryHelper.BuildDelegateCommand <MedicationDto> (
                () => ToggleActiveIndicatorCommand, ExecuteToggleActiveIndicator);

            ShowMedicationCommand = commandFactoryHelper.BuildDelegateCommand <MedicationDto> (
                () => ShowMedicationCommand, ExecuteShowMedicationCommand);

            _showOption = ShowOption.ShowActive;
            _filter     = FilterByActiveStatus;

            InitializeGroupingDescriptions();
            _pagedCollectionViewWrapper.SortDescription = new SortDescription("StartDate", ListSortDirection.Ascending);

            _eventAggregator.GetEvent <MedicationChangedEvent> ().Subscribe(
                MedicationChangedEventHandler,
                ThreadOption.BackgroundThread,
                false,
                FilterMedicationChangedEvents);
        }
Exemplo n.º 15
0
        public ProgramListViewModel(
            IAsyncRequestDispatcherFactory asyncRequestDispatcherFactory,
            IAccessControlManager accessControlManager,
            IUserDialogService userDialogService,
            IPopupService popupService,
            IEventAggregator eventAggregator,
            ICommandFactory commandFactory)
            : base(accessControlManager, commandFactory)
        {
            _asyncRequestDispatcherFactory = asyncRequestDispatcherFactory;
            _pagedCollectionViewWrapper    = new PagedCollectionViewWrapper <ProgramDto> ();
            _userDialogService             = userDialogService;
            _popupService    = popupService;
            _eventAggregator = eventAggregator;

            var commandFactoryHelper = CommandFactoryHelper.CreateHelper(this, commandFactory);

            _showAllCommand              = commandFactoryHelper.BuildDelegateCommand(() => ShowAllCommand, ExecuteShowAll);
            _showActiveOnlyCommand       = commandFactoryHelper.BuildDelegateCommand(() => ShowActiveOnlyCommand, ExecuteShowActiveOnly);
            ToggleActiveIndicatorCommand = commandFactoryHelper.BuildDelegateCommand <ProgramDto> (
                () => ToggleActiveIndicatorCommand, ExecuteToggleActiveIndicator);
            ShowProgramAddCommand  = commandFactoryHelper.BuildDelegateCommand <object> (() => ShowProgramAddCommand, ExecuteShowProgramAddCommand);
            ShowProgramEditCommand = commandFactoryHelper.BuildDelegateCommand <ProgramDto> (
                () => ShowProgramEditCommand, ExecuteShowProgramEditCommand);
            DeleteProgramCommand = commandFactoryHelper.BuildDelegateCommand <ProgramDto> (() => DeleteProgramCommand, ExecuteDeleteProgramCommand);

            _showOption = ShowOption.ShowActive;
            _filter     = FilterByActiveStatus;
            InitializeGroupingDescriptions();

            _eventAggregator.GetEvent <ProgramChangedEvent> ().Subscribe(
                ProgramChangedEventHandler,
                ThreadOption.BackgroundThread,
                false,
                FilterProgramChangedEvents);
        }
Exemplo n.º 16
0
        private static async Task <List <ITick> > GetTicksAsync <ITick>(
            string symbol,
            DateTime?startTime,
            DateTime?endTime,
            Period period,
            ShowOption showOption,
            Func <string[], ITick> instanceFunction,
            Func <ITick, ITick> postprocessFunction,
            CancellationToken token
            )
        {
            var csvConfig = new CsvHelper.Configuration.CsvConfiguration(CultureInfo.InvariantCulture)
            {
                NewLine           = "\n", // instead of the default Environment.NewLine
                Delimiter         = ",",
                Quote             = '\'',
                MissingFieldFound = null  // ignore CsvHelper.MissingFieldException, because SplitTick 2 computed fields will be missing.
            };
            var ticks = new List <ITick>();

            const int nMaxTries = 3;    // YF server is unreliable, as all web queries. It is worth repeating the download at least 3 times.
            int       nTries    = 0;

            do
            {
                try
                {
                    nTries++;

                    using (var stream = await GetResponseStreamAsync(symbol, startTime, endTime, period, showOption.Name(), token).ConfigureAwait(false))
                        using (var sr = new StreamReader(stream))
                            using (var csvReader = new CsvReader(sr, csvConfig))
                            {
                                // string result = sr.ReadToEnd();
                                // https://joshclose.github.io/CsvHelper/getting-started/
                                csvReader.Read(); // skip header
                                csvReader.ReadHeader();
                                while (csvReader.Read())
                                {
                                    // 2021-06-18T15:00 : exception thrown CsvHelper.TypeConversion.TypeConverterException
                                    // because https://finance.yahoo.com/quote/SPY/history returns RawRecord: "2021-06-17,null,null,null,null,null,null"
                                    // YF has intermittent data problems for yesterday.
                                    // TODO: future work. We need a backup data source, like https://www.nasdaq.com/market-activity/funds-and-etfs/spy/historical
                                    // or IbGateway in cases when YF doesn't give data.
                                    var record = csvReader.GetRecord <ITick>();
                                    var recordPostprocessed = postprocessFunction(record);
                                    // Do something with the record.
#pragma warning disable RECS0017 // Possible compare of value type with 'null'
                                    if (recordPostprocessed != null)
#pragma warning restore RECS0017 // Possible compare of value type with 'null'
                                    {
                                        ticks.Add(recordPostprocessed);
                                    }
                                }
                                //                 while (csvReader.Read())
                                //                 {
                                //                     //var tick = instanceFunction(csvReader.Context.Record);
                                //                     var record = csvReader.GetRecord<string>();
                                //                     var tick = instanceFunction(new string [0]);
                                //                     //var tick = instanceFunction(Enumerable.ToArray(records));
                                // #pragma warning disable RECS0017 // Possible compare of value type with 'null'
                                //                     if (tick != null)
                                // #pragma warning restore RECS0017 // Possible compare of value type with 'null'
                                //                         ticks.Add(tick);
                                //                 }
                                return(ticks);
                            }
                }
                catch (Exception e)
                {
                    Utils.Logger.Info(e, $"Exception in Yahoo.GetTicksAsync(): Stock:'{symbol}', {e.Message}");
                    Thread.Sleep(3000); // sleep for 3 seconds before trying again.
                }
            } while (nTries <= nMaxTries);

            throw new Exception($"ReloadHistoricalDataAndSetTimer() exception. Cannot download YF data (ticker:{symbol}) after {nMaxTries} tries.");
        }
Exemplo n.º 17
0
        public static void PreferencesGUI()
        {
            if (!PrefsLoaded)
            {
                LoadDefaults();
                PrefsLoaded = true;
            }

            var cache = EditorGUIUtility.labelWidth;

            EditorGUIUtility.labelWidth = 250;
            {
                EditorGUI.BeginChangeCheck();
                GlobalStartUp = (ShowOption)EditorGUILayout.EnumPopup(StartUp, GlobalStartUp);
                if (EditorGUI.EndChangeCheck())
                {
                    EditorPrefs.SetInt(PrefStartUp, (int)GlobalStartUp);
                }
            }

            {
                EditorGUI.BeginChangeCheck();
                GlobalAutoSRP = EditorGUILayout.Toggle(AutoSRP, GlobalAutoSRP);
                if (EditorGUI.EndChangeCheck())
                {
                    EditorPrefs.SetBool(PrefAutoSRP, GlobalAutoSRP);
                }
            }

            {
                EditorGUI.BeginChangeCheck();
                GlobalDefineSymbol = EditorGUILayout.Toggle(DefineSymbol, GlobalDefineSymbol);
                if (EditorGUI.EndChangeCheck())
                {
                    EditorPrefs.SetBool(PrefDefineSymbol, GlobalDefineSymbol);
                    if (GlobalDefineSymbol)
                    {
                        IOUtils.SetAmplifyDefineSymbolOnBuildTargetGroup(EditorUserBuildSettings.selectedBuildTargetGroup);
                    }
                    else
                    {
                        IOUtils.RemoveAmplifyDefineSymbolOnBuildTargetGroup(EditorUserBuildSettings.selectedBuildTargetGroup);
                    }
                }
            }

            {
                EditorGUI.BeginChangeCheck();
                GlobalClearLog = EditorGUILayout.Toggle(ClearLog, GlobalClearLog);
                if (EditorGUI.EndChangeCheck())
                {
                    EditorPrefs.SetBool(PrefClearLog, GlobalClearLog);
                }
            }

            {
                EditorGUI.BeginChangeCheck();
                GlobalUpdateOnSceneSave = EditorGUILayout.Toggle(UpdateOnSceneSave, GlobalUpdateOnSceneSave);
                if (EditorGUI.EndChangeCheck())
                {
                    EditorPrefs.SetBool(PrefUpdateOnSceneSave, GlobalUpdateOnSceneSave);
                }
            }


            {
                EditorGUI.BeginChangeCheck();
                GlobalDisablePreviews = EditorGUILayout.Toggle(DisablePreviews, GlobalDisablePreviews);
                if (EditorGUI.EndChangeCheck())
                {
                    EditorPrefs.SetBool(PrefDisablePreviews, GlobalDisablePreviews);
                    UIUtils.ActivatePreviews(!GlobalDisablePreviews);
                }
            }

#if UNITY_2019_4_OR_NEWER
            EditorGUI.BeginChangeCheck();
            GlobalShowAsyncMsg = EditorGUILayout.Toggle(ShowAsyncMsg, GlobalShowAsyncMsg);
            if (EditorGUI.EndChangeCheck())
            {
                EditorPrefs.SetBool(PrefShowAsyncMsg, GlobalShowAsyncMsg);
            }
#endif
            EditorGUILayout.BeginHorizontal();
            GUILayout.FlexibleSpace();
            if (GUILayout.Button("Reset and Forget All"))
            {
                EditorPrefs.DeleteKey(PrefStartUp);
                GlobalStartUp = ShowOption.Always;

                EditorPrefs.DeleteKey(PrefAutoSRP);
                GlobalAutoSRP = true;

                EditorPrefs.DeleteKey(PrefDefineSymbol);
                GlobalDefineSymbol = true;
                IOUtils.SetAmplifyDefineSymbolOnBuildTargetGroup(EditorUserBuildSettings.selectedBuildTargetGroup);

                EditorPrefs.DeleteKey(PrefClearLog);
                GlobalClearLog = true;

                EditorPrefs.DeleteKey(PrefUpdateOnSceneSave);
                GlobalUpdateOnSceneSave = true;

                EditorPrefs.DeleteKey(PrefDisablePreviews);
                GlobalDisablePreviews = false;

#if UNITY_2019_4_OR_NEWER
                EditorPrefs.DeleteKey(PrefShowAsyncMsg);
                GlobalShowAsyncMsg = true;
#endif
            }
            EditorGUILayout.EndHorizontal();
            EditorGUIUtility.labelWidth = cache;
        }
Exemplo n.º 18
0
        public ProgramOfferingListViewModel(
            IAsyncRequestDispatcherFactory asyncRequestDispatcherFactory,
            IAccessControlManager accessControlManager,
            IUserDialogService userDialogService,
            IPopupService popupService,
            ICommandFactory commandFactory )
            : base(accessControlManager, commandFactory)
        {
            _asyncRequestDispatcherFactory = asyncRequestDispatcherFactory;
            _pagedCollectionViewWrapper = new PagedCollectionViewWrapper<ProgramOfferingDto> ();
            _userDialogService = userDialogService;
            _popupService = popupService;

            var commandFactoryHelper = CommandFactoryHelper.CreateHelper ( this, commandFactory );

            _showAllCommand = commandFactoryHelper.BuildDelegateCommand ( () => ShowAllCommand, ExecuteShowAll );
            _showActiveOnlyCommand = commandFactoryHelper.BuildDelegateCommand ( () => ShowActiveOnlyCommand, ExecuteShowActiveOnly );
            ToggleActiveIndicatorCommand = commandFactoryHelper.BuildDelegateCommand<ProgramOfferingDto> (
                () => ToggleActiveIndicatorCommand, ExecuteToggleActiveIndicator );
            ShowProgramOfferingAddCommand = commandFactoryHelper.BuildDelegateCommand<object> (
                () => ShowProgramOfferingAddCommand, ExecuteShowProgramOfferingAddCommand );
            ShowProgramOfferingEditCommand = commandFactoryHelper.BuildDelegateCommand<ProgramOfferingDto> (
                () => ShowProgramOfferingEditCommand, ExecuteShowProgramOfferingEditCommand );
            DeleteProgramOfferingCommand = commandFactoryHelper.BuildDelegateCommand<ProgramOfferingDto> (
                () => DeleteProgramOfferingCommand, ExecuteDeleteProgramOfferingCommand );

            _showOption = ShowOption.ShowActive;
            _filter = FilterByActiveStatus;
            InitializeGroupingDescriptions ();
        }
Exemplo n.º 19
0
        private void ExecuteShowActiveOnly()
        {
            if ( _showOption == ShowOption.ShowActive )
            {
                return;
            }
            _showOption = ShowOption.ShowActive;

            PagedCollectionViewWrapper.SetFilter ( _filter );
        }
        public ProgramEnrollmentListViewModel(
            IUserDialogService userDialogService,
            IEventAggregator eventAggregator,
            IAsyncRequestDispatcherFactory asyncRequestDispatcherFactory,
            IAccessControlManager accessControlManager,
            IPopupService popupService,
            ICommandFactory commandFactory )
            : base(accessControlManager, commandFactory)
        {
            _popupService = popupService;
            _showOption = ShowOption.ShowActive;
            _filter = FilterByActiveStatus;

            _userDialogService = userDialogService;
            _eventAggregator = eventAggregator;
            _asyncRequestDispatcherFactory = asyncRequestDispatcherFactory;

            _pagedCollectionViewWrapper = new PagedCollectionViewWrapper<ProgramEnrollmentDto> ();

            InitializeGroupingDescriptions ();

            var commandFactoryHelper = CommandFactoryHelper.CreateHelper ( this, commandFactory );

            ShowAllCommand = commandFactoryHelper.BuildDelegateCommand ( () => ShowAllCommand, ExecuteShowAll );
            ShowActiveOnlyCommand = commandFactoryHelper.BuildDelegateCommand ( () => ShowActiveOnlyCommand, ExecuteShowActiveOnly );

            CreateProgramEnrollmentCommand = commandFactoryHelper.BuildDelegateCommand (
                () => CreateProgramEnrollmentCommand, ExecuteCreateProgramEnrollmentCommand );
            EditProgramEnrollmentCommand = commandFactoryHelper.BuildDelegateCommand<ProgramEnrollmentDto> (
                () => EditProgramEnrollmentCommand, ExecuteEditProgramEnrollmentCommand );
            DisenrollProgramEnrollmentCommand =
                commandFactoryHelper.BuildDelegateCommand<ProgramEnrollmentDto> (
                    () => DisenrollProgramEnrollmentCommand, ExecuteDisenrollProgramEnrollmentCommand );
            DeleteProgramEnrollmentCommand = commandFactoryHelper.BuildDelegateCommand<ProgramEnrollmentDto> (
                () => DeleteProgramEnrollmentCommand, ExecuteDeleteProgramEnrollment, CanExecuteDeleteProgramEnrollment );
            DragQueryCommand = commandFactoryHelper.BuildDelegateCommand<DragDropQueryEventArgs> ( () => DragQueryCommand, ExecuteDragQueryCommand );

            _eventAggregator.GetEvent<ClinicalCaseChangedEvent> ()
                .Subscribe ( ClinicalCaseChangedEventHandler, ThreadOption.BackgroundThread, false, FilterClinicalCaseChangedEvents );

            _eventAggregator.GetEvent<ProgramEnrollmentChangedEvent> ()
                .Subscribe ( ProgramEnrollmentChangedEventHandler, ThreadOption.BackgroundThread, false, FilterProgramEnrollmentChangedEvents );
        }
Exemplo n.º 21
0
        public ProgramListViewModel(
            IAsyncRequestDispatcherFactory asyncRequestDispatcherFactory,
            IAccessControlManager accessControlManager,
            IUserDialogService userDialogService,
            IPopupService popupService,
            IEventAggregator eventAggregator,
            ICommandFactory commandFactory )
            : base(accessControlManager, commandFactory)
        {
            _asyncRequestDispatcherFactory = asyncRequestDispatcherFactory;
            _pagedCollectionViewWrapper = new PagedCollectionViewWrapper<ProgramDto> ();
            _userDialogService = userDialogService;
            _popupService = popupService;
            _eventAggregator = eventAggregator;

            var commandFactoryHelper = CommandFactoryHelper.CreateHelper ( this, commandFactory );

            _showAllCommand = commandFactoryHelper.BuildDelegateCommand ( () => ShowAllCommand, ExecuteShowAll );
            _showActiveOnlyCommand = commandFactoryHelper.BuildDelegateCommand ( () => ShowActiveOnlyCommand, ExecuteShowActiveOnly );
            ToggleActiveIndicatorCommand = commandFactoryHelper.BuildDelegateCommand<ProgramDto> (
                () => ToggleActiveIndicatorCommand, ExecuteToggleActiveIndicator );
            ShowProgramAddCommand = commandFactoryHelper.BuildDelegateCommand<object> ( () => ShowProgramAddCommand, ExecuteShowProgramAddCommand );
            ShowProgramEditCommand = commandFactoryHelper.BuildDelegateCommand<ProgramDto> (
                () => ShowProgramEditCommand, ExecuteShowProgramEditCommand );
            DeleteProgramCommand = commandFactoryHelper.BuildDelegateCommand<ProgramDto> ( () => DeleteProgramCommand, ExecuteDeleteProgramCommand );

            _showOption = ShowOption.ShowActive;
            _filter = FilterByActiveStatus;
            InitializeGroupingDescriptions ();

            _eventAggregator.GetEvent<ProgramChangedEvent> ().Subscribe (
                ProgramChangedEventHandler,
                ThreadOption.BackgroundThread,
                false,
                FilterProgramChangedEvents );
        }
Exemplo n.º 22
0
        public CaseProblemListViewModel(
            IUserDialogService userDialogService,
            IEventAggregator eventAggregator,
            IAsyncRequestDispatcherFactory asyncRequestDispatcherFactory,
            IAccessControlManager accessControlManager,
            IPopupService popupService,
            ICommandFactory commandFactory )
            : base(accessControlManager, commandFactory)
        {
            _popupService = popupService;
            _showOption = ShowOption.ShowActive;
            _filter = FilterByActiveStatus;

            _userDialogService = userDialogService;
            _eventAggregator = eventAggregator;
            _asyncRequestDispatcherFactory = asyncRequestDispatcherFactory;

            var requestDispatcher = _asyncRequestDispatcherFactory.CreateAsyncRequestDispatcher ();
            IsLoading = true;
            requestDispatcher
                .AddLookupValuesRequest ( ProblemTypeLookupName )
                .AddLookupValuesRequest ( ProblemStatusLookupName )
                .ProcessRequests ( HandleGetLookupValuesCompleted, HandleGetLookupValuesException );

            _pagedCollectionViewWrapper = new PagedCollectionViewWrapper<ProblemDto> ();

            InitializeGroupingDescriptions ();

            var commandFactoryHelper = CommandFactoryHelper.CreateHelper ( this, commandFactory );

            ShowAllCommand = commandFactoryHelper.BuildDelegateCommand ( () => ShowAllCommand, ExecuteShowAll );
            ShowActiveOnlyCommand = commandFactoryHelper.BuildDelegateCommand ( () => ShowActiveOnlyCommand, ExecuteShowActiveOnly );
            DeleteProblemCommand = commandFactoryHelper.BuildDelegateCommand<ProblemDto> (
                () => DeleteProblemCommand, ExecuteDeleteProblem, CanExecuteDeleteProblem );

            _eventAggregator.GetEvent<ClinicalCaseChangedEvent> ().Subscribe (
                ClinicalCaseChangedEventHandler,
                ThreadOption.BackgroundThread,
                false,
                FilterClinicalCaseChangedEvents );

            EditProblemCommand = commandFactoryHelper.BuildDelegateCommand<ProblemDto> ( () => EditProblemCommand, ExecuteEditProblemCommand );
            DragQueryCommand = commandFactoryHelper.BuildDelegateCommand<DragDropQueryEventArgs> ( () => DragQueryCommand, ExecuteDragQueryCommand );
            GenerateHL7ProblemCommand = commandFactoryHelper.BuildDelegateCommand<ProblemDto> (
                () => GenerateHL7ProblemCommand, ExecuteGenerateHL7ProblemCommand );
        }
Exemplo n.º 23
0
 private void ExecuteShowAll()
 {
     if ( _showOption != ShowOption.ShowAll )
     {
         _showOption = ShowOption.ShowAll;
         PagedCollectionViewWrapper.SetFilter ( _filter );
     }
 }
Exemplo n.º 24
0
        public MedicationListViewModel(
            IAsyncRequestDispatcherFactory asyncRequestDispatcherFactory,
            IUserDialogService userDialogService,
            IEventAggregator eventAggregator,
            IAccessControlManager accessControlManager,
            INavigationService navigationService,
            ICommandFactory commandFactory )
            : base(accessControlManager, commandFactory)
        {
            _asyncRequestDispatcherFactory = asyncRequestDispatcherFactory;
            _userDialogService = userDialogService;
            _eventAggregator = eventAggregator;
            _navigationService = navigationService;

            _pagedCollectionViewWrapper = new PagedCollectionViewWrapper<MedicationDto> ();

            var commandFactoryHelper = CommandFactoryHelper.CreateHelper ( this, commandFactory );

            _showAllCommand = commandFactoryHelper.BuildDelegateCommand ( () => ShowAllCommand, ExecuteShowAll );
            _showActiveOnlyCommand = commandFactoryHelper.BuildDelegateCommand ( () => ShowActiveOnlyCommand, ExecuteShowActiveOnly );
            ToggleActiveIndicatorCommand = commandFactoryHelper.BuildDelegateCommand<MedicationDto> (
                () => ToggleActiveIndicatorCommand, ExecuteToggleActiveIndicator );

            ShowMedicationCommand = commandFactoryHelper.BuildDelegateCommand<MedicationDto> (
                () => ShowMedicationCommand, ExecuteShowMedicationCommand );

            _showOption = ShowOption.ShowActive;
            _filter = FilterByActiveStatus;

            InitializeGroupingDescriptions ();
            _pagedCollectionViewWrapper.SortDescription = new SortDescription ( "StartDate", ListSortDirection.Ascending );

            _eventAggregator.GetEvent<MedicationChangedEvent> ().Subscribe (
                MedicationChangedEventHandler,
                ThreadOption.BackgroundThread,
                false,
                FilterMedicationChangedEvents );
        }