コード例 #1
0
ファイル: TailService.cs プロジェクト: benlaan/laan.tail
        /// <summary>
        /// Initializes a new instance of the TailService class.
        /// </summary>
        /// <param name="fileName"></param>
        /// <param name="tailLength"></param>
        public TailService(IUserSettings config, string fileName)
        {
            _config = config;
            _fileName = Path.GetFullPath(fileName);
            if (!File.Exists(fileName))
                return;

            ApplyConfiguration(config);

            _watcher = new FileSystemWatcher(Path.GetDirectoryName(_fileName));
            _watcher.EnableRaisingEvents = true;

            var changes = Observable
                .FromEventPattern<FileSystemEventHandler, FileSystemEventArgs>(
                    h => {
                        _watcher.Changed += h;
                        _watcher.Created += h;
                        _watcher.Deleted += h;
                    },
                    h => {
                        _watcher.Changed -= h;
                        _watcher.Created -= h;
                        _watcher.Deleted -= h;
                    }
                )
                .Where(e => e.EventArgs.FullPath == _fileName)
                .Sample(TimeSpan.FromMilliseconds(config.Tail.BufferDelay))
                .Subscribe(e =>
                {
                    if (Changed == null)
                        return;

                    Changed(this, new TailChangedEventArgs(_fileName));
                });
        }
 public GitHubDeploy(IUserSettings settings, UnconfiguredProject project, IProjectLockService projectLockService, IThreadHandling threadHandler)
 {
     this.project = project;
     this.projectLockService = projectLockService;
     this.threadHandler = threadHandler;
     this.settings = settings;
 }
コード例 #3
0
        public PersonalFeedsViewModel(IUserSettings userSettings)
        {
            this.userSettings = userSettings;
            this.ShowDetails = new RelayCommand<Article>(a => this.ShowViewModel<DetailsViewModel>(new Identifier(a.Id.ToString())));
            this.AddNewFeedFilter = new RelayCommand(() => this.ShowViewModel<SetupFeedFilterViewModel>());
            
            MessageBus.Current.Listen<FeedSubscribedChangedMessage>().Subscribe(this.OnFeedSubscribedChanged);

            this.Title = "Startseite";
        }
コード例 #4
0
        public FeedViewModel(IUserSettings settings)
        {
            if (settings == null) throw new ArgumentNullException(nameof(settings));

            this.userFilterSetting = settings.UserFiltersSetting;
            this.ShowDetails = new RelayCommand<Article>(a => this.ShowViewModel<DetailsViewModel>(new Identifier(a.Id.ToString())));
            this.ShowMore = new RelayCommand(() =>
            {
                var parameter = new MvxBundle();
                if (parameter.Data != null) parameter.Data["preset"] = JsonConvert.SerializeObject(this.FilterPreset);
                this.ShowViewModel<FeedViewModel>(parameter);
            });
        }
コード例 #5
0
 public TrainingSession(IUserSettings settings, ITimer timer, ITrainer trainer, ITaunter taunter, IMetronome metronome, ISequencer sequencer, IContentCollection content, 
     IContentViewer viewer, IRandomNumberGenerator randomNumberGenerator)
 {
     _taunter = taunter;
     Settings = settings;
     Trainer = trainer;
     Taunter = taunter;
     Metronome = metronome;
     Sequencer = sequencer;
     Content = content;
     Viewer = viewer;
     Timer = timer;
     RNG = randomNumberGenerator;
 }
コード例 #6
0
ファイル: BufferItem.cs プロジェクト: benlaan/laan.tail
        public void ApplyConfiguration(IUserSettings userSettings)
        {
            _userSettings = userSettings;
            NotifyOfPropertyChange(() => TextWrapping);
            
            if (_line == null)
                return;

            Highlighter highlighter = _userSettings.Highlighters.FirstOrDefault(h => h.Regex.IsMatch(_line));
            HasHighlighter = highlighter != null;
            if (highlighter != null)
            {
                ForegroundColor = new SolidColorBrush(highlighter.Foreground);
                BackgroundColor = new SolidColorBrush(highlighter.Background);
            }
        }
コード例 #7
0
        public SetupFeedFilterViewModel(IArticlesService articlesService, IToastNotificator notificator, IUserSettings userSettings)
        {
            this.articlesService = articlesService;
            this.notificator = notificator;
            this.userSettings = userSettings;
            this.Title = "Filter erstellen";
            var canExecute = this.WhenAny(vm => vm.CategorySelect.SelectedItem, vm => vm.DistrictSelect.SelectedItem,
                (ci, di) => ci.Value != null || di.Value != null);
            this.Create = ReactiveCommand.Create(canExecute);
            this.Create.Subscribe(this.CreateFilterAction);

            canExecute.Subscribe(b =>
            {
                var titleParts =
                    this.selectViewModels.OfType<SelectViewModel>()
                        .Select(svm => (svm.SelectedItem as IdEntity)?.Name)
                        .Where(p => p != null);
                this.FilterName = string.Join(" - ", titleParts);
            });
        }
コード例 #8
0
 public MoBiMainViewPresenter(
     IMoBiMainView view,
     IRepository <IMainViewItemPresenter> allMainViewItemPresenters,
     IProjectTask projectTask,
     ISkinManager skinManager,
     IExitCommand exitCommand,
     IEventPublisher eventPublisher,
     IUserSettings userSettings,
     ITabbedMdiChildViewContextMenuFactory contextMenuFactory,
     IMoBiConfiguration configuration,
     IWatermarkStatusChecker watermarkStatusChecker) : base(view, eventPublisher, contextMenuFactory)
 {
     _skinManager               = skinManager;
     _exitCommand               = exitCommand;
     _userSettings              = userSettings;
     _configuration             = configuration;
     _watermarkStatusChecker    = watermarkStatusChecker;
     _allMainViewItemPresenters = allMainViewItemPresenters;
     _projectTask               = projectTask;
     _view.AttachPresenter(this);
     _view.InitializeResources();
 }
コード例 #9
0
        protected override void Context()
        {
            _view = A.Fake <IPopulationSimulationSettingsView>();
            _quantitySelectionPresenter   = A.Fake <IQuantitySelectionPresenter>();
            _simulationPersistableUpdater = A.Fake <ISimulationPersistableUpdater>();
            _projectRetriever             = A.Fake <IProjectRetriever>();
            _dialogCreator = A.Fake <IDialogCreator>();
            _userSettings  = A.Fake <IUserSettings>();

            _populationSimulation = A.Fake <PopulationSimulation>();
            A.CallTo(() => _populationSimulation.NumberOfItems).Returns(10);
            _populationSimulation.Model = new Model {
                Root = new Container()
            };
            _originalSettings = A.Fake <OutputSelections>();
            _editedSettings   = A.Fake <OutputSelections>();
            A.CallTo(() => _originalSettings.Clone()).Returns(_editedSettings);
            A.CallTo(() => _populationSimulation.OutputSelections).Returns(_originalSettings);
            _selectedQuantities = new List <QuantitySelection>();
            A.CallTo(() => _quantitySelectionPresenter.SelectedQuantities()).Returns(_selectedQuantities);
            sut = new PopulationSimulationSettingsPresenter(_view, _quantitySelectionPresenter, _simulationPersistableUpdater, _projectRetriever, _dialogCreator, _userSettings);
        }
コード例 #10
0
        public SplitsViewModel(IUserSettings Settings, IHomunculusModel Model)
        {
            // If the caller is not supplying a user settings
            // interface object, just make our own.
            if (Settings == null)
            {
                UserSettings = new StandardUserSettings();
            }
            else
            {
                UserSettings = Settings;
            }

            // If the caller is not supplying a model object,
            // just make our own.
            if (Model == null)
            {
                Challenges = new ModelXml();
                if (System.IO.File.Exists("homunculus.xml"))
                {
                    Challenges.LoadDatabase("homunculus.xml");
                }
                else
                {
                    Challenges.CreateDatabase("homunculus.xml");
                }
            }
            else
            {
                Challenges = Model;
            }

            // Get the challenges and set one to current, if available.
            challengeList    = Challenges.GetChallenges();
            CurrentChallenge = (string)UserSettings.GetUserSetting("LastUsedChallenge");

            SuccessButtonText = "Success";
        }
コード例 #11
0
        /// <summary>
        /// Deseralize user setting from file in isolated storage.
        /// If file is not found, do nothing.
        /// </summary>
        /// <param name="userSettings"></param>
        public virtual void Deserialize(IUserSettings userSettings)
        {
            Logger?.Log($"Deserialize settings in Xml, Type = {userSettings?.GetType().FullName ?? "null"}, FileName = {FileName ?? "null"}");

            if (string.IsNullOrWhiteSpace(FileName))
            {
                return;
            }
            if (userSettings == null)
            {
                return;
            }

            try
            {
                Logger?.Log("Try access storage...");
                // Get a User store with type evidence for the current Domain and the Assembly.
                using (var storage = IsolatedStorageFile.GetUserStoreForAssembly())
                {
                    //Logger?.Log($"Storage contains files: {string.Join(Environment.NewLine, storage.GetFileNames())}");
                    if (!storage.FileExists(FileName))
                    {
                        return;
                    }

                    // Open a readable file.
                    using (var stream = new IsolatedStorageFileStream(FileName, FileMode.Open,
                                                                      FileAccess.Read, FileShare.Read, storage))
                    {
                        Read(userSettings, stream);
                    }
                }
            }
            catch (FileNotFoundException)
            {
                // no file - do nothing
            }
        }
コード例 #12
0
        public ColorEditorViewModel(IUserSettings userSettings)
        {
            OpenColorPickerCommand = new RelayCommand(() => OpenColorPickerRequested?.Invoke(this, EventArgs.Empty));
            OpenSettingsCommand    = new RelayCommand(() => OpenSettingsRequested?.Invoke(this, EventArgs.Empty));

            RemoveColorsCommand = new RelayCommand(DeleteSelectedColors);
            ExportColorsGroupedByColorCommand  = new RelayCommand(ExportSelectedColorsByColor);
            ExportColorsGroupedByFormatCommand = new RelayCommand(ExportSelectedColorsByFormat);
            SelectedColorChangedCommand        = new RelayCommand((newColor) =>
            {
                if (ColorsHistory.Contains((Color)newColor))
                {
                    ColorsHistory.Remove((Color)newColor);
                }

                ColorsHistory.Insert(0, (Color)newColor);
                SelectedColorIndex = 0;
            });
            ColorsHistory.CollectionChanged += ColorsHistory_CollectionChanged;
            _userSettings = userSettings;
            SetupAllColorRepresentations();
            SetupAvailableColorRepresentations();
        }
コード例 #13
0
        public MainViewModel(
            IMouseInfoProvider mouseInfoProvider,
            ZoomWindowHelper zoomWindowHelper,
            AppStateHandler appStateHandler,
            KeyboardMonitor keyboardMonitor,
            NativeEventWaiter nativeEventWaiter,
            IUserSettings userSettings)
        {
            _zoomWindowHelper  = zoomWindowHelper;
            _appStateHandler   = appStateHandler;
            _userSettings      = userSettings;
            _nativeEventWaiter = nativeEventWaiter;

            if (mouseInfoProvider != null)
            {
                mouseInfoProvider.MouseColorChanged += Mouse_ColorChanged;
                mouseInfoProvider.OnMouseDown       += MouseInfoProvider_OnMouseDown;
                mouseInfoProvider.OnMouseWheel      += MouseInfoProvider_OnMouseWheel;
            }

            _userSettings.ShowColorName.PropertyChanged += (s, e) => { OnPropertyChanged(nameof(ShowColorName)); };
            keyboardMonitor?.Start();
        }
コード例 #14
0
        protected ChartPresenter(IChartView chartView, ChartPresenterContext chartPresenterContext, IMoBiContext context, IUserSettings userSettings,
                                 IChartTemplatingTask chartTemplatingTask, IChartUpdater chartUpdater) :
            base(chartView, chartPresenterContext)
        {
            _chartUpdater = chartUpdater;
            initializeDisplayPresenter();
            initializeEditorPresenter();

            _chartTemplatingTask = chartTemplatingTask;
            _dataRepositoryCache = new Cache <DataRepository, IMoBiSimulation>(onMissingKey: x => null);

            _userSettings = userSettings;
            _context      = context;

            _view.SetChartView(chartPresenterContext.EditorAndDisplayPresenter.BaseView);

            initLayout();
            initEditorPresenterSettings();

            _observedDataDragDropBinder = new ObservedDataDragDropBinder();

            AddSubPresenters(chartPresenterContext.EditorAndDisplayPresenter);
        }
コード例 #15
0
 public ParameterGroupsPresenter(IParameterGroupsView view, IParameterGroupTask parameterGroupTask,
                                 IParameterGroupNodeCreator groupNodeCreator,
                                 IParameterContainerToTreeNodeMapper containerNodeMapper,
                                 INodeToCustomableParametersPresenterMapper parametersPresenterMapper,
                                 INoItemInSelectionPresenter noItemInSelectionPresenter,
                                 ITreeNodeFactory treeNodeFactory, IGroupRepository groupRepository, IUserSettings userSettings,
                                 IPresentationSettingsTask presentationSettingsTask, ITreeNodeContextMenuFactory treeNodeContextMenuFactory)
     : base(view)
 {
     _parameterGroupTask         = parameterGroupTask;
     _groupNodeCreator           = groupNodeCreator;
     _containerNodeMapper        = containerNodeMapper;
     _parametersPresenterMapper  = parametersPresenterMapper;
     _noItemInSelectionPresenter = noItemInSelectionPresenter;
     _groupRepository            = groupRepository;
     _userSettings               = userSettings;
     _presentationSettingsTask   = presentationSettingsTask;
     _treeNodeContextMenuFactory = treeNodeContextMenuFactory;
     _parameterPresenterCache    = new Cache <ITreeNode, ICustomParametersPresenter>();
     _nodesCache   = new Cache <ParameterGroupingMode, IEnumerable <ITreeNode> >();
     _allGroupNode = treeNodeFactory.CreateGroupAll();
     _favoriteNode = treeNodeFactory.CreateGroupFavorites();
 }
コード例 #16
0
        /// <summary>
        /// Serialize user setting to file in isolated storage.
        /// </summary>
        /// <param name="userSettings"></param>
        public virtual void Serialize(IUserSettings userSettings)
        {
            Logger?.Log($"Serialize settings in Xml, Type = {userSettings?.GetType().FullName ?? "null"}, FileName = {FileName ?? "null"}");

            if (string.IsNullOrWhiteSpace(FileName))
            {
                return;
            }
            if (!(userSettings is T))
            {
                return;
            }

            Logger?.Log("Try access storage...");
            // Get a User store with type evidence for the current Domain and the Assembly.
            using (var storage = IsolatedStorageFile.GetUserStoreForAssembly())
                // Open or create a writable file.
                using (var stream = new IsolatedStorageFileStream(FileName, FileMode.Create,
                                                                  FileAccess.Write, storage))
                {
                    Write(userSettings, stream);
                }
        }
コード例 #17
0
        //public string Server { set { ApiHost = value; } }

        public static ApiDataService2 Instance()
        {
            IUserSettings userSettings = Mvx.Resolve <IUserSettings>();

            if (_instance == null)
            {
                //TechnitionToolMobileApiClient apiClient = new TechnitionToolMobileApiClient("http://10.34.202.218/TechnitionTool.Mobile.Api/serversList.JSON");

                _instance = new ApiDataService2();

                Task.Run(async() => {
                    try
                    {
                        var serverResult = await _instance.Ping();
                    }
                    catch (Exception ex)
                    {
                    }
                });
            }

            return(_instance);
        }
コード例 #18
0
ファイル: Loc.cs プロジェクト: Alriac/STL_Showcase
        private Loc()
        {
            _Ins = this;
            CultureInfo ci = CultureInfo.CurrentUICulture;

            LoadTexts();

            IUserSettings settings = DefaultFactory.GetDefaultUserSettings();

            CurrentLanguage = settings.GetSettingString(Shared.Enums.UserSettingEnum.Language);

            if (string.IsNullOrEmpty(CurrentLanguage))
            {
                logger.Info("Localization: Missing saved language. Setting system language '{0}'", ci.TwoLetterISOLanguageName);
                CurrentLanguage = ci.TwoLetterISOLanguageName;
            }

            if (!LoadedLanguages.Contains(CurrentLanguage))
            {
                logger.Info("Localization: Missing current language '{0}'", CurrentLanguage);
                CurrentLanguage = DefaultLanguage;
            }
        }
コード例 #19
0
        public void RemoveActiveLocaleCultureInfo(string username, CultureInfo cultureInfo)
        {
            Guid id =
                (from ual in DataFacade.GetData <IUserActiveLocale>()
                 where ual.Username == username &&
                 ual.CultureName == cultureInfo.Name
                 select ual.Id).SingleOrDefault();

            if (id != Guid.Empty)
            {
                IUserSettings userSettings = DataFacade.GetData <IUserSettings>().SingleOrDefault(f => f.Username == username);
                if (userSettings != null)
                {
                    if (userSettings.CurrentActiveLocaleCultureName == cultureInfo.Name)
                    {
                        userSettings.CurrentActiveLocaleCultureName = null;
                        DataFacade.Update(userSettings);
                    }
                }

                DataFacade.Delete <IUserActiveLocale>(f => f.Id == id);
            }
        }
コード例 #20
0
        public MainViewModel(
            IMouseInfoProvider mouseInfoProvider,
            ZoomWindowHelper zoomWindowHelper,
            AppStateHandler appStateHandler,
            KeyboardMonitor keyboardMonitor,
            IUserSettings userSettings)
        {
            _zoomWindowHelper = zoomWindowHelper;
            _appStateHandler  = appStateHandler;
            _userSettings     = userSettings;
            NativeEventWaiter.WaitForEventLoop(Constants.ShowColorPickerSharedEvent(), _appStateHandler.StartUserSession);
            NativeEventWaiter.WaitForEventLoop(Constants.ColorPickerSendSettingsTelemetryEvent(), _userSettings.SendSettingsTelemetry);

            if (mouseInfoProvider != null)
            {
                mouseInfoProvider.MouseColorChanged += Mouse_ColorChanged;
                mouseInfoProvider.OnMouseDown       += MouseInfoProvider_OnMouseDown;
                mouseInfoProvider.OnMouseWheel      += MouseInfoProvider_OnMouseWheel;
            }

            _userSettings.ShowColorName.PropertyChanged += (s, e) => { OnPropertyChanged(nameof(ShowColorName)); };
            keyboardMonitor?.Start();
        }
コード例 #21
0
        private static AxisType GetYAxisType(
            IDictionary <DateTime, BigInteger> userData1,
            IDictionary <DateTime, BigInteger> userData2,
            IUserSettings userSettings)
        {
            if (userSettings.UseLogarithmicGraphScale)
            {
                var minUserData1 = userData1 != null?userData1.Values.Min() : 0;

                var minUserData2 = userData2 != null?userData2.Values.Min() : 0;

                var maxUserData1 = userData1 != null?userData1.Values.Max() : 0;

                var maxUserData2 = userData2 != null?userData2.Values.Max() : 0;

                if (BigInteger.Max(maxUserData1, maxUserData2) - BigInteger.Min(minUserData1, minUserData2) > userSettings.LogarithmicGraphScaleThreshold)
                {
                    return(AxisType.Logarithmic);
                }
            }

            return(AxisType.Linear);
        }
コード例 #22
0
        public MostRecentlyUsedService(IEventAggregator eventAggregator,
                                       IUserSettings userSettings,
                                       ISolutionItemDeserializerRegistry deserializer,
                                       ISolutionItemSerializerRegistry serializer)
        {
            this.deserializer = deserializer;
            this.serializer   = serializer;
            var previous = userSettings.Get <Data>(new Data(new List <MruEntry>()));

            mostRecentlyUsed = previous.Items ?? new List <MruEntry>();

            eventAggregator.GetEvent <EventRequestOpenItem>().Subscribe(item =>
            {
                if (item is MetaSolutionSQL)
                {
                    return;
                }

                var serialized = TrySerialize(item);
                if (serialized == null)
                {
                    return;
                }

                MruEntry entry = new MruEntry(serialized.Type, serialized.Value, serialized.Value2, serialized.StringValue);
                mostRecentlyUsed.Remove(entry);

                if (mostRecentlyUsed.Count >= MaxMruEntries)
                {
                    mostRecentlyUsed.RemoveAt(mostRecentlyUsed.Count - 1);
                }

                mostRecentlyUsed.Insert(0, entry);

                userSettings.Update <Data>(new Data(mostRecentlyUsed));
            }, true);
        }
コード例 #23
0
ファイル: SoundVmFactory.cs プロジェクト: jenius-apps/ambie
        public SoundVmFactory(
            IDownloadManager downloadManager,
            IMixMediaPlayerService player,
            ITelemetry telemetry,
            IPreviewService previewService,
            ISoundDataProvider soundDataProvider,
            ISoundMixService soundMixService,
            IUserSettings userSettings,
            IIapService iapService,
            IUploadService uploadService,
            IRenamer renamer,
            IServiceProvider serviceProvider)
        {
            Guard.IsNotNull(downloadManager, nameof(downloadManager));
            Guard.IsNotNull(soundDataProvider, nameof(soundDataProvider));
            Guard.IsNotNull(player, nameof(player));
            Guard.IsNotNull(telemetry, nameof(telemetry));
            Guard.IsNotNull(iapService, nameof(iapService));
            Guard.IsNotNull(previewService, nameof(previewService));
            Guard.IsNotNull(userSettings, nameof(userSettings));
            Guard.IsNotNull(soundMixService, nameof(soundMixService));
            Guard.IsNotNull(renamer, nameof(renamer));
            Guard.IsNotNull(uploadService, nameof(uploadService));
            Guard.IsNotNull(serviceProvider, nameof(serviceProvider));

            _userSettings      = userSettings;
            _downloadManager   = downloadManager;
            _previewService    = previewService;
            _soundMixService   = soundMixService;
            _iapService        = iapService;
            _soundDataProvider = soundDataProvider;
            _player            = player;
            _renamer           = renamer;
            _telemetry         = telemetry;
            _uploadService     = uploadService;
            _serviceProvider   = serviceProvider;
        }
コード例 #24
0
        public ImagePreviewViewModel(IThrottledActionInvokerFactory throttledActionInvokerFactory,
                                     IImagePreviewItemViewModelFactory imagePreviewItemViewModelFactory,
                                     IUserSettings userSettings)
        {
            _throttledActionInvokerFactory    = throttledActionInvokerFactory;
            _imagePreviewItemViewModelFactory = imagePreviewItemViewModelFactory;
            _userSettings = userSettings;

            CloseCommand = new RelayCommand(() =>
            {
                Application.Current.MainWindow.Close();
            });

            SlideshowCommand = new RelayCommand(() =>
            {
                _inSlideshowMode = true;
                SetSelectedImage(SelectedImageInList);
            });

            NextImageCommand = new RelayCommand(() =>
            {
                SelectedImage        = Images.SkipWhile(it => it != SelectedImage).Skip(1).First();
                _selectedImageInList = SelectedImage;
                OnPropertyChanged(nameof(SelectedImageInList));
                NextImageButtonVisible     = SelectedImage != Images.Last();
                PreviousImageButtonVisible = SelectedImage != Images.First();
            });

            PreviousImageCommand = new RelayCommand(() =>
            {
                SelectedImage        = Images.TakeWhile(it => it != SelectedImage).Last();
                _selectedImageInList = SelectedImage;
                OnPropertyChanged(nameof(SelectedImageInList));
                PreviousImageButtonVisible = SelectedImage != Images.First();
                NextImageButtonVisible     = SelectedImage != Images.Last();
            });
        }
コード例 #25
0
        /// <summary>
        /// Executes the select menu item command.
        /// </summary>
        /// <param name="item">The item.</param>
        /// <returns></returns>
        private async Task ExecuteSelectMenuItemCommand(MenuViewModel item)
        {
            await Task.Run(() =>
            {
                //navigate if we have to, pass the id so we can grab from cache... or not
                switch (item.Section)
                {
                case Section.Drafts:
                    ShowViewModel <DraftsViewModel>();
                    break;

                case Section.Outbox:
                    ShowViewModel <OutboxViewModel>();
                    break;

                case Section.Sent:
                    ShowViewModel <SentListViewModel>();
                    break;

                case Section.Settings:
                    ShowViewModel <SettingsViewModel>();
                    break;

                case Section.Terms:
                    ShowViewModel <TermsViewModel>();
                    break;

                case Section.Logout:
                    IUserSettings settings = Mvx.Resolve <IUserSettings>();
                    settings.Clear();
                    ShowViewModel <LoginViewModel>(0);
                    Close(this);
                    break;
                }
            });
        }
コード例 #26
0
ファイル: ChartPresenter.cs プロジェクト: valdiman/PK-Sim
        protected ChartPresenter(TView view, ChartPresenterContext chartPresenterContext, IChartTemplatingTask chartTemplatingTask, IIndividualPKAnalysisPresenter pkAnalysisPresenter, IChartTask chartTask, IObservedDataTask observedDataTask, IUserSettings userSettings)
            : base(view, chartPresenterContext)
        {
            _chartTask        = chartTask;
            _observedDataTask = observedDataTask;
            _userSettings     = userSettings;
            _view.SetChartView(chartPresenterContext.ChartEditorAndDisplayPresenter.BaseView);
            _pkAnalysisPresenter = pkAnalysisPresenter;
            _view.SetPKAnalysisView(_pkAnalysisPresenter.View);
            AddSubPresenters(_pkAnalysisPresenter);
            _chartTemplatingTask = chartTemplatingTask;
            _repositoryCache     = new Cache <DataRepository, IndividualSimulation> {
                OnMissingKey = noDataForSimulation
            };

            ChartEditorPresenter.SetShowDataColumnInDataBrowserDefinition(IsColumnVisibleInDataBrowser);
            ChartDisplayPresenter.DragDrop   += OnDragDrop;
            ChartDisplayPresenter.DragOver   += OnDragOver;
            ChartDisplayPresenter.ExportToPDF = () => _chartTask.ExportToPDF(Chart);
            AddAllButtons();
            _chartDisplayMode           = ChartDisplayMode.Chart;
            _observedDataDragDropBinder = new ObservedDataDragDropBinder();
            _visiblePropertyName        = ReflectionHelper.PropertyFor <ICurve, bool>(x => x.Visible).Name;
        }
コード例 #27
0
 public DimensionValidator(DimensionParser dimensionParser, IObjectPathFactory objectPathFactory, IUserSettings userSettings)
 {
     _dimensionParser     = dimensionParser;
     _objectPathFactory   = objectPathFactory;
     _userSettings        = userSettings;
     _hiddenNotifications = new Dictionary <string, string>
     {
         { AppConstants.Parameters.SURFACE_AREA_INTERSTITIAL_INTRACELLULAR, dimensionAreaMessage },
         { AppConstants.Parameters.BSA, dimensionAreaMessage },
         { AppConstants.Parameters.PERMEABILITY, dimensionVelocityMessage },
         { AppConstants.Parameters.SPECIFIC_INTESTINAL_PERMEABILITY_TRANSCELLULAR, dimensionVelocityMessage },
         { AppConstants.Parameters.RADIUS_SOLUTE, dimensionValidationMessage(AppConstants.DimensionNames.LENGTH) },
         { AppConstants.Parameters.SECRETION_OF_LIQUID, dimensionFlowMessage },
         { Constants.Parameters.VOLUME, $"Organism|Saliva|Volume' {dimensionValidationMessage(Constants.Dimension.VOLUME)}" },
         { AppConstants.Parameters.RELEASE_RATE_OF_TABLET, dimensionValidationMessage(Constants.Dimension.AMOUNT_PER_TIME) },
         { AppConstants.Parameters.V_MAX, dimensionValidationMessage(Constants.Dimension.MOLAR_CONCENTRATION_PER_TIME) },
         { AppConstants.Parameters.LYMPH_FLOW_RATE, dimensionFlowMessage },
         { AppConstants.Parameters.LYMPH_FLOW_RATE_INCL_MUCOSA, dimensionFlowMessage },
         { AppConstants.Parameters.FLUID_RECIRCULATION_FLOW_RATE, dimensionFlowMessage },
         { AppConstants.Parameters.FLUID_RECIRCULATION_FLOW_RATE_INCL_MUCOSA, dimensionFlowMessage },
         { AppConstants.Parameters.CALCULATED_SPECIFIC_INTESTINAL_PERMEABILITY_TRANSCELLULAR, dimensionVelocityMessage },
         { AppConstants.Parameters.EFFECTIVE_MOLECULAR_WEIGHT, "Arguments of MINUS-function must have the same dimension (Formula: MW - F * 0.000000017 - Cl * 0.000000022 - Br * 0.000000062 - I * 0.000000098)" }
     };
 }
コード例 #28
0
        public static void Start()
        {
            var api      = MouseEmulation.UIAssistantAPI;
            var handlers = api.KeyboardAPI.CreateHookHandlers();

            handlers.KeyDown += Handlers_KeyDown;
            api.KeyboardAPI.Hook(handlers);
            Finished       += () => api.KeyboardAPI.Unhook(handlers);
            _timer          = new Timer();
            _timer.Interval = 100d / 6d;
            _timer.Elapsed += Timer_Elapsed;
            _timer.Start();
            _userSettings  = MouseEmulation.UIAssistantAPI.UIAssistantSettings;
            _mouseSettings = MouseEmulation.Settings;
            _keybinds      = api.KeyboardAPI.CreateKeybindManager();
            _keybinds.Add(_userSettings.Quit, () => { Stop(); MouseEmulation.UIAssistantAPI.PluginManager.Exit(); });
            _keybinds.Add(_userSettings.Back, () => { Stop(); MouseEmulation.UIAssistantAPI.PluginManager.Undo(); });
            _keybinds.Add(_userSettings.Usage, () =>
            {
                if (_usagePanel == null)
                {
                    MouseEmulation.UIAssistantAPI.ViewAPI.UIDispatcher.Invoke(() =>
                    {
                        _usagePanel = new Usage();
                        MouseEmulation.UIAssistantAPI.ViewAPI.AddPanel(_usagePanel);
                        Finished += RemoveUsagePanel;
                    });
                }
                else
                {
                    RemoveUsagePanel();
                    Finished -= RemoveUsagePanel;
                }
            });
            MouseEmulation.UIAssistantAPI.ViewAPI.AddTargetingReticle();
        }
コード例 #29
0
 public ComparisonChartPresenter(IChartView chartView, IMoBiContext context, IUserSettings userSettings, IChartTasks chartTasks, IChartTemplatingTask chartTemplatingTask, IQuantityPathToQuantityDisplayPathMapper quantityDisplayPathMapper, IChartUpdater chartUpdater, ChartPresenterContext chartPresenterContext) :
     base(chartView, chartPresenterContext, context, userSettings, chartTasks, chartTemplatingTask)
 {
     _quantityDisplayPathMapper = quantityDisplayPathMapper;
 }
コード例 #30
0
 public FilterSettingsViewModel(IUserSettings userSettings)
 {
     this.setting = userSettings.UserFiltersSetting;
     this.Title = "Ihre Filter";
 }
コード例 #31
0
 private ThumbnailCacheInFolder()
 {
     settings = DefaultFactory.GetDefaultUserSettings();
 }
コード例 #32
0
 public WorldDatabaseSettingsProvider(IUserSettings userSettings)
 {
     this.userSettings = userSettings;
 }
コード例 #33
0
 public UserSettingsViewModel(IUserSettings userSettings, IPushNotification pushNotification)
 {
     this.userSettings     = userSettings;
     this.pushNotification = pushNotification;
 }
コード例 #34
0
 public DistrictSettingViewModel(IArticlesService articlesService, IUserSettings userSettings)
     : base(articlesService)
 {
     this.setting = userSettings.DistrictSetting;
 }
コード例 #35
0
 public static IOffice LastSelected(this List<IOffice> offices, IUserSettings settings)
 {
     return offices.FirstOrDefault(x => x.Name == settings.Last_Selected_Office);
 }
コード例 #36
0
 public SelectTemplateViewModel(IUserSettings settings, MicrosoftApplication app)
     : base(settings)
 {
     this.app = app;
     this.settings = settings;
 }
コード例 #37
0
 public ChangeOfficeViewModel(IUserSettings settings)
 {
     this.settings = settings;
     OKCommand = new RelayCommand(OKPressed, CanPressOK);
 }
コード例 #38
0
ファイル: BufferItem.cs プロジェクト: benlaan/laan.tail
 public BufferItem(IUserSettings userSettings)
 {
     ApplyConfiguration(userSettings);
 }
コード例 #39
0
        /// <summary>
        /// 
        /// </summary>
        /// <param name="serviceProxy"></param>
        /// <param name="dataContext"></param>
        /// <param name="contactSearchController"></param>
        public RegisteredUsersViewModel(IServiceProxy serviceProxy, IUserSettings userSettings, IContactSearchController contactSearchController)
        {
            this.serviceProxy = serviceProxy;
            this.contactSearchController = contactSearchController;

            lock (DataSync.Instance)
            {
                if (!DataSync.Instance.IsSyncComplete)
                {
                    Messenger.Default.Register<SyncEvent>(this, this.ReadRegisteredUsersFromDB);
                }

                this.isLoading = !DataSync.Instance.IsUsersSyncComplete;
            }

            this.RegisteredUsers = new ObservableSortedList<ContactGroup<UserModel>>();
            this.ReadRegisteredUsersFromDB();
        }
コード例 #40
0
ファイル: UserSettingsViewModel.cs プロジェクト: nrag/yapper
 public UserSettingsViewModel(IUserSettings userSettings, IPushNotification pushNotification)
 {
     this.userSettings = userSettings;
     this.pushNotification = pushNotification;
 }
コード例 #41
0
        /// <summary>
        /// Constructor to create the AllConversationsViewModel instance
        /// </summary>
        /// <param name="phone"></param>
        public AllConversationsViewModel(
            IServiceProxy serviceProxy,
            IUserSettings userSettings)
        {
            this.serviceProxy = serviceProxy;
            this.userSettings = userSettings;
            Messenger.Default.Register<NewMessageSavedEvent>(this, this.HandleNewMessageSavedEvent);
            Messenger.Default.Register<NewMessageEvent>(this, this.HandleNewMessageSentEvent);
            Messenger.Default.Register<DeleteEvent>(this, this.HandleDeleteEvent);
            lock (DataSync.Instance)
            {
                Messenger.Default.Register<SyncEvent>(this, this.HandleSyncCompleteEvent);
                DataSync.Instance.Sync();
            }

            this.initialLoadCompleted = DataSync.Instance.IsSyncComplete;
            this.ReadConversationFromLocalDB();
        }
コード例 #42
0
ファイル: TailService.cs プロジェクト: benlaan/laan.tail
 public void ApplyConfiguration(IUserSettings config)
 {
     _tailLength = config.Tail.Length;
     _lineWidth = config.Tail.Width;
 }
コード例 #43
0
 public WritingController(IUserSettings settings)
 {
     this.settings = settings;
 }
コード例 #44
0
 public InteractionTaskContext(IMoBiContext context, IMoBiApplicationController applicationController,
                               IInteractionTask interactionTask, IActiveSubjectRetriever activeSubjectRetriever, IUserSettings userSettings,
                               IDisplayUnitRetriever displayUnitRetriever, IDialogCreator dialogCreator,
                               ICommandTask commandTask, IObjectTypeResolver objectTypeResolver, IMoBiFormulaTask moBiFormulaTask,
                               IMoBiConfiguration configuration, DirectoryMapSettings directoryMapSettings)
 {
     DialogCreator          = dialogCreator;
     Context                = context;
     ApplicationController  = applicationController;
     InteractionTask        = interactionTask;
     ActiveSubjectRetriever = activeSubjectRetriever;
     UserSettings           = userSettings;
     DisplayUnitRetriever   = displayUnitRetriever;
     _commandTask           = commandTask;
     _objectTypeResolver    = objectTypeResolver;
     _configuration         = configuration;
     _directoryMapSettings  = directoryMapSettings;
     MoBiFormulaTask        = moBiFormulaTask;
 }
コード例 #45
0
 public ParameterAnalysableParameterSelector(IUserSettings userSettings)
 {
     _userSettings = userSettings;
 }
コード例 #46
0
        public AppSettings(IUserSettings UserConfig)
        {
            _user_config = UserConfig;

            CurrentChallenge = (string)_user_config.GetUserSetting("LastUsedChallenge");
        }
コード例 #47
0
 public ReactionDiagramPresenter(IReactionDiagramView view, IContainerBaseLayouter layouter, IMoBiContext context, IUserSettings userSettings, IDialogCreator dialogCreator, IMoBiApplicationController applicationController, IDiagramTask diagramTask, IDiagramLayoutTask diagramLayoutTask, IStartOptions runOptions, IDiagramModelFactory diagramModelFactory) :
     base(view, layouter, dialogCreator, diagramModelFactory, userSettings, context, diagramTask, runOptions)
 {
     _applicationController = applicationController;
     _diagramPopupMenu      = new PopupMenuReactionDiagram(this, runOptions);
     _moleculePopupMenu     = _diagramPopupMenu;
     _reactionPopupMenu     = new PopupMenuReactionBuilder(this, context, runOptions);
     _diagramLayoutTask     = diagramLayoutTask;
 }
コード例 #48
0
 public ArmManager(IUserSettings userSettings, ISettings settings, HttpClient client)
 {
     this._userSettings = userSettings;
     this._settings = settings;
     this._client = client;
 }
コード例 #49
0
 public NotificationPresenter(INotificationView view, IRegionResolver regionResolver, IUserSettings userSettings,
                              INotificationMessageMapper notificationMessageMapper, IViewItemContextMenuFactory viewItemContextMenuFactory,
                              IMoBiApplicationController applicationController, IMoBiContext context, IDialogCreator dialogCreator)
     : base(view)
 {
     _regionResolver             = regionResolver;
     _userSettings               = userSettings;
     _notificationMessageMapper  = notificationMessageMapper;
     _viewItemContextMenuFactory = viewItemContextMenuFactory;
     _applicationController      = applicationController;
     _context            = context;
     _dialogCreator      = dialogCreator;
     VisibleNotification = _userSettings.VisibleNotification;
 }
コード例 #50
0
 public LocalBookmarkService(IUserSettings userSettings, IArticlesService articlesService)
 {
     this.articlesService = articlesService;
     this.bookmarksSetting = userSettings.BookmarksSetting;
 }
コード例 #51
0
ファイル: UserService.cs プロジェクト: pvickers/PlayMe
 public UserService(IDataService<User> userDataService, IUserSettings userSettings)
 {
     this.userSettings = userSettings;
     this.userDataService = userDataService;
 }
コード例 #52
0
        /// <summary>
        /// Creates a ConversationMessagesViewModel
        /// </summary>
        /// <param name="phone"></param>
        public ConversationMessagesViewModel(
            IServiceProxy serviceProxy,
            IUserSettings userSettings,
            Guid conversationId,
            UserModel recipient,
            bool? isGroup)
        {
            this.serviceProxy = serviceProxy;
            this.userSettings = userSettings;
            this.messages = new ObservableSortedList<MessageModel>();
            this.conversationId = conversationId;
            this.recipient = recipient;
            this.isGroup = isGroup;
            this.listOfQuestions = new ObservableCollection<StringBuilder>();
            this.listOfAppointments = new ObservableCollection<AppointmentDateTime>();
            this.listOfTaskItems = new ObservableCollection<StringBuilder>();
            this.contactDetails.YapperName = recipient.Name;
            this.contactDetails.YapperPhone = recipient.PhoneNumber;
            this.contactDetails.UserId = recipient.Id;
            this.contactDetails.Search();

            if (this.IsGroup)
            {
                this.groupDetails.SetGroup(DataSync.Instance.GetGroup(this.recipient.Id));
            }

            string[] questions = new string[] { "Yes", "No", "Pass" };

            foreach (string s in questions)
            {
                this.listOfQuestions.Add(new StringBuilder(s));
            }

            AppointmentDateTime [] appts = new AppointmentDateTime[] { new AppointmentDateTime(DateTime.Now.Ticks), new AppointmentDateTime(DateTime.Now.Ticks), new AppointmentDateTime(DateTime.Now.Ticks) };

            foreach (AppointmentDateTime s in appts)
            {
                this.listOfAppointments.Add(s);
            }

            // Register the view to handle push notification when the app is running
            Messenger.Default.Register<NewMessageSavedEvent>(this, this.HandleNewMessageSavedEvent);
            Messenger.Default.Register<NewMessageEvent>(this, this.HandleNewMessageEvent);
            Messenger.Default.Register<ExistingMessageEvent>(this, this.HandleExistingMessageEvent);
            Messenger.Default.Register<DeleteEvent>(this, this.HandleDeleteEvent);

            lock (DataSync.Instance)
            {
                Messenger.Default.Register<SyncEvent>(this, this.HandleSyncCompleteEvent);

                DataSync.Instance.Sync();
                this.IsSyncing = !DataSync.Instance.IsSyncComplete;
            }

            this.IsCurrentyViewing = true;
        }