コード例 #1
0
        public UpdateHintViewModel(
            IUpdateHelper updateHelper,
            ITranslationUpdater translationUpdater,
            IEventAggregator eventAggregator,
            IVersionHelper versionHelper,
            IUpdateLauncher updateLauncher,
            IDispatcher dispatcher,
            IOnlineVersionHelper onlineVersionHelper,
            IAssemblyHelper assemblyHelper)
            :
            base(translationUpdater)
        {
            _updateHelper        = updateHelper;
            _eventAggregator     = eventAggregator;
            _updateLauncher      = updateLauncher;
            _dispatcher          = dispatcher;
            _onlineVersionHelper = onlineVersionHelper;
            _assemblyHelper      = assemblyHelper;

            SetCurrentDateFormat();

            AvailableVersionText = Translation.GetNewUpdateMessage(_onlineVersionHelper.GetOnlineVersion().Version.ToString(3),
                                                                   versionHelper.ApplicationVersion.ToString(3),
                                                                   CurrentVersionDate);
        }
コード例 #2
0
        }                                        //"Command wasn't recognized. Please try again.";
        public SimpleSessionRouter(IUpdateHelper updateHelper,
                                   IMenuLoader menuLoader,

                                   IRoomService room,
                                   IUsersService users,
                                   IBotService botService,

                                   ILockTrackerService lockTrackerService,
                                   ILogHelper logHelper,
                                   INotificationRouter notificationRouter,
                                   ILocalizationHelper localizationHelper)
        {
            _menuLoader = menuLoader;

            _logHelper = logHelper;

            _updateHelper       = updateHelper;
            _notificationRouter = notificationRouter;

            _users = users;

            _room                = room;
            _botService          = botService;
            _lockTrackerService  = lockTrackerService;
            _localizationHelper  = localizationHelper;
            CommandNotRecognized = _localizationHelper.GetLocalizedString(StringToLocalize.CommandNotRecognized);
        }
コード例 #3
0
        }                                           //= "Add yourself some time to cover both the person in the room and yourself.";

        public SessionRouter(IUpdateHelper updateHelper,
                             IMenuLoader menuLoader,
                             ILogger <SessionRouter> logger,
                             IRoomService room,
                             IUsersService users,
                             IBotService botService,
                             IOptions <BotConfiguration> config,
                             ILockTrackerService lockTrackerService,
                             ILogHelper logHelper,
                             INotificationRouter notificationRouter,
                             ILocalizationHelper localizationHelper)
        {
            _menuLoader         = menuLoader;
            _config             = config;
            _logHelper          = logHelper;
            _updateHelper       = updateHelper;
            _notificationRouter = notificationRouter;
            _localizationHelper = localizationHelper;
            _users              = users;
            _logger             = logger;
            _room               = room;
            _botService         = botService;
            _lockTrackerService = lockTrackerService;

            CommandNotRecognized    = _localizationHelper.GetLocalizedString(StringToLocalize.CommandNotRecognized);
            NumberOverLimit         = _localizationHelper.GetLocalizedString(StringToLocalize.NumberOverLimit);
            NumberNotParsed         = _localizationHelper.GetLocalizedString(StringToLocalize.NumberNotParsed);
            doorIsLockedInstruction = _localizationHelper.GetLocalizedString(StringToLocalize.doorIsLockedInstruction);
        }
コード例 #4
0
        public MainViewModelTests()
        {
            _mockedFileSystem = new MockFileSystem();

            var commonsMock = new Mock <ICommons>();

            commonsMock.SetupGet(x => x.CurrentLanguage).Returns(() => "English");
            commonsMock.SetupGet(x => x.CurrentLanguageCode).Returns(() => "eng");
            commonsMock.SetupGet(x => x.LanguageCodeMap).Returns(() => new Dictionary <string, string>());
            _mockedCommons = commonsMock.Object;

            var mockedLocalizationHelper = new Mock <ILocalizationHelper>();

            mockedLocalizationHelper.Setup(x => x.GetLocalization(It.IsAny <string>())).Returns <string>(x => x);
            mockedLocalizationHelper.Setup(x => x.GetLocalization(It.IsAny <string>(), It.IsAny <string>())).Returns((string value, string langauge) => value);
            _mockedLocalizationHelper = mockedLocalizationHelper.Object;

            Localization.Localization.Init(_mockedCommons);

            _mockedAppSettings = new Mock <IAppSettings>().Object;

            var annoCanvasMock = new Mock <IAnnoCanvas>();

            annoCanvasMock.SetupAllProperties();
            //The QuadTree does not have a default constructor, so we need to explicitly set up the property
            annoCanvasMock.Setup(x => x.PlacedObjects).Returns(new Core.DataStructures.QuadTree <LayoutObject>(new Rect(-100, -100, 200, 200)));
            _mockedAnnoCanvas = annoCanvasMock.Object;

            _inMemoryRecentFilesHelper = new RecentFilesHelper(new RecentFilesInMemorySerializer(), new MockFileSystem());

            _mockedMessageBoxService = new Mock <IMessageBoxService>().Object;
            _mockedUpdateHelper      = new Mock <IUpdateHelper>().Object;
            _mockedCellGrouper       = Mock.Of <IAdjacentCellGrouper>();
        }
コード例 #5
0
 public DownloadUpdateStartupAction(IVersionHelper versionHelper, IOnlineVersionHelper onlineVersionHelper, IUpdateHelper updateHelper, IUpdateDownloader updateDownloader)
 {
     _versionHelper       = versionHelper;
     _onlineVersionHelper = onlineVersionHelper;
     _updateHelper        = updateHelper;
     _updateDownloader    = updateDownloader;
 }
コード例 #6
0
 protected QuerySyntaxHelper(ITypeTranslater translater, IAggregateHelper aggregateHelper, IUpdateHelper updateHelper, DatabaseType databaseType)
 {
     TypeTranslater  = translater;
     AggregateHelper = aggregateHelper;
     UpdateHelper    = updateHelper;
     DatabaseType    = databaseType;
 }
コード例 #7
0
 public MainShell(MainShellViewModel vm, IHightlightColorRegistration hightlightColorRegistration, IUpdateHelper updateHelper, IEventAggregator eventAggregator, IDispatcher dispatcher)
 {
     _eventAggregator = eventAggregator;
     _dispatcher      = dispatcher;
     DataContext      = vm;
     UpdateHelper     = updateHelper;
     InitializeComponent();
     vm.Init(Close);
     hightlightColorRegistration.RegisterHighlightColorResource(this);
     TransposerHelper.Register(this, vm);
 }
コード例 #8
0
 public AutoUpdateLauncher(ITranslationFactory translationFactory, IInteractionInvoker interactionInvoker, IInteractionRequest interactionRequest, IHashUtil hashUtil, IThreadManager threadManager, ApplicationNameProvider applicationNameProvider, IUpdateHelper updateHelper, IEventAggregator EventAggregator)
 {
     UpdateTranslation(translationFactory);
     translationFactory.TranslationChanged += (sender, args) => UpdateTranslation(translationFactory);
     _interactionRequest      = interactionRequest;
     _interactionInvoker      = interactionInvoker;
     _hashUtil                = hashUtil;
     _threadManager           = threadManager;
     _applicationNameProvider = applicationNameProvider;
     _updateHelper            = updateHelper;
     _eventAggregator         = EventAggregator;
 }
コード例 #9
0
 public UpdateDownloadWindowViewModel(
     ITranslationUpdater translationUpdater, IReadableFileSizeFormatter readableFileSizeFormatter, ApplicationNameProvider applicationNameProvider, IUpdateHelper updateHelper, IDispatcher dispatcher)
     : base(translationUpdater)
 {
     _readableFileSizeFormatter = readableFileSizeFormatter;
     _applicationNameProvider   = applicationNameProvider;
     _updateHelper = updateHelper;
     Dispatcher    = dispatcher;
     _updateHelper.OnDownloadFinished += OnDownloadFinished;
     _updateHelper.OnProgressChanged  += UpdateProgress;
     CancelCommand = new DelegateCommand(ExecuteCancel);
 }
コード例 #10
0
        static App()
        {
            _commons           = Commons.Instance;
            _appSettings       = AppSettings.Instance;
            _messageBoxService = new MessageBoxService();

            Localization.Localization.Init(_commons);
            _localizationHelper = Localization.Localization.Instance;

            _updateHelper = new UpdateHelper(ApplicationPath, _appSettings, _messageBoxService, _localizationHelper);
            _fileSystem   = new FileSystem();
        }
コード例 #11
0
 public UpdateController(IUpdateService updateService,
                         ILogHelper logHelper,
                         IRoomService room,
                         IUsersService users,
                         IMenuLoader menuLoader,
                         IUpdateHelper updateHelper)
 {
     _updateService = updateService;
     _logHelper     = logHelper;
     _room          = room;
     _users         = users;
     _menuLoader    = menuLoader;
     _updateHelper  = updateHelper;
 }
コード例 #12
0
        private void InitWithMultiUpdater(IMultiUpdater multiUpdater)
        {
            tableLayoutPanel1      = new TableLayoutPanel();
            tableLayoutPanel1.Dock = DockStyle.Fill;
            this.splitContainer1.Panel1.Controls.Add(tableLayoutPanel1);

            tableLayoutPanel1.CellPaint += TableLayoutPanel1_CellPaint;
            tableLayoutPanel1.RowCount   = multiUpdater.GetDataUpdaterNames().Count;
            //this.Height = tableLayoutPanel1.RowCount * 45 + 50;
            this.Height = tableLayoutPanel1.RowCount * 30 + 40;
            for (int i = 0; i < multiUpdater.GetDataUpdaterNames().Count; i++)
            {
                Label lb = new Label();
                lb.Text         = multiUpdater.GetDataUpdaterNames()[i];
                lb.AutoEllipsis = true;
                lb.AutoSize     = true;
                lb.Margin       = new Padding(2);
                lb.MouseEnter  += Lb_MouseEnter;

                tableLayoutPanel1.SetRow(lb, i);
                tableLayoutPanel1.SetColumn(lb, 0);
                tableLayoutPanel1.Controls.Add(lb);

                ProgressBar p = new ProgressBar();
                p.Margin = new Padding(2);
                p.Dock   = DockStyle.Fill;
                tableLayoutPanel1.SetRow(p, i);
                tableLayoutPanel1.SetColumn(p, 1);
                tableLayoutPanel1.Controls.Add(p);
                progressBars.Add(p);

                this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.AutoSize, 45F));
            }

            for (int i = 0; i < multiUpdater.GetDataUpdaters().Count; i++)
            {
                IUpdateHelper  stepGetter = multiUpdater.GetDataUpdaters()[i];
                UpdateExecutor executor   = new UpdateExecutor(stepGetter);
                executor.Tag                = multiUpdater.GetDataUpdaterNames()[i];
                executor.BeforePrepared    += Executor_BeforePrepared;
                executor.AfterPrepared     += Executor_AfterPrepared;
                executor.AfterStepBegin    += Executor_AfterStepBegin;
                executor.AfterStepFinished += Executor_AfterStepFinished;
                executor.AfterFinished     += Executor_AfterFinished;
                executor.AfterCancelled    += Executor_AfterCancelled;
                this.updateExecutors.Add(executor);
            }
        }
コード例 #13
0
        public UpdateSettingsViewModel(ICommons commonsToUse,
                                       IAppSettings appSettingsToUse,
                                       IMessageBoxService messageBoxServiceToUse,
                                       IUpdateHelper updateHelperToUse,
                                       ILocalizationHelper localizationHelperToUse)
        {
            _commons            = commonsToUse;
            _appSettings        = appSettingsToUse;
            _messageBoxService  = messageBoxServiceToUse;
            _updateHelper       = updateHelperToUse;
            _localizationHelper = localizationHelperToUse;

            CheckForUpdatesCommand = new RelayCommand(ExecuteCheckForUpdates);
            OpenReleasesCommand    = new RelayCommand(ExecuteOpenReleases);
            DownloadPresetsCommand = new RelayCommand(ExecuteDownloadPresets);
        }
コード例 #14
0
ファイル: Plugin_DataUpdater.cs プロジェクト: wanwei/sc2
        private void Init()
        {
            string srcDataPath   = (string)GetValue(SRCDATAPATH);
            string dataCenterUri = (string)GetValue(DATACENTERURI);
            bool   isFillUp      = (bool)GetValue(UPDATEFILLUP);

            IPlugin_HistoryData plugin_HistoryData = new Plugin_HistoryData_Default(srcDataPath);
            //IPlugin_HistoryData plugin_HistoryData = null;// = new Plugin_DataUpdater();
            DataCenter dataCenter = DataCenterManager.Instance.GetDataCenterByUri(dataCenterUri);

            this.updateStepGetter = new DataUpdate(plugin_HistoryData, dataCenter, isFillUp);
            //this.stepGetter = new DataUpdate(plugin_HistoryData, dataCenter, isFillUp);

            args = new List <PreparerArgument>();
            args.Add(new PreparerArgument(SRCDATAPATH, "源数据目录", srcDataPath));
            args.Add(new PreparerArgument(DATACENTERURI, "数据中心地址", dataCenterUri));
            args.Add(new PreparerArgument(UPDATEFILLUP, "补充历史数据?", isFillUp.ToString()));
        }
コード例 #15
0
        public MaybePipedApplicationStarter(ISettingsManager settingsManager, IUpdateHelper updateHelper,
                                            ICheckAllStartupConditions startupConditions, IThreadManager threadManager,
                                            IPipeServerManager pipeServerManager, IJobInfoQueueManager jobInfoQueueManager, IJobInfoQueue jobInfoQueue,
                                            IStaticPropertiesHack staticPropertiesHack, IPdfCreatorFolderCleanUp folderCleanUp, ISpooledJobFinder spooledJobFinder,
                                            IJobHistoryActiveRecord jobHistoryActiveRecord)
        {
            StartupConditions       = startupConditions;
            _jobInfoQueue           = jobInfoQueue;
            _folderCleanUp          = folderCleanUp;
            _spooledJobFinder       = spooledJobFinder;
            _jobHistoryActiveRecord = jobHistoryActiveRecord;
            _settingsManager        = settingsManager;
            _updateHelper           = updateHelper;
            _threadManager          = threadManager;
            _pipeServerManager      = pipeServerManager;
            _jobInfoQueueManager    = jobInfoQueueManager;

            staticPropertiesHack.SetStaticProperties();
        }
コード例 #16
0
 public UpdateService(IBotService botService,
                      //ILogger<UpdateService> logger,
                      ILogHelper logHelper,
                      IRoomService room,
                      IUsersService users,
                      ISessionRouter sessionRouter,
                      IMenuLoader menuLoader,
                      IUpdateHelper updateHelper,
                      INotificationRouter notificationRouter)
 {
     _botService         = botService;
     _logHelper          = logHelper;
     _room               = room;
     _users              = users;
     _sessionRouter      = sessionRouter;
     _menuLoader         = menuLoader;
     _updateHelper       = updateHelper;
     _notificationRouter = notificationRouter;
 }
コード例 #17
0
 private MainViewModel GetViewModel(ICommons commonsToUse                       = null,
                                    IAppSettings appSettingsToUse               = null,
                                    IRecentFilesHelper recentFilesHelperToUse   = null,
                                    IMessageBoxService messageBoxServiceToUse   = null,
                                    IUpdateHelper updateHelperToUse             = null,
                                    ILocalizationHelper localizationHelperToUse = null,
                                    IAnnoCanvas annoCanvasToUse                 = null,
                                    IFileSystem fileSystemToUse                 = null)
 {
     return(new MainViewModel(commonsToUse ?? _mockedCommons,
                              appSettingsToUse ?? _mockedAppSettings,
                              recentFilesHelperToUse ?? _inMemoryRecentFilesHelper,
                              messageBoxServiceToUse ?? _mockedMessageBoxService,
                              updateHelperToUse ?? _mockedUpdateHelper,
                              localizationHelperToUse ?? _mockedLocalizationHelper,
                              fileSystemToUse ?? _mockedFileSystem)
     {
         AnnoCanvas = annoCanvasToUse ?? _mockedAnnoCanvas
     });
 }
コード例 #18
0
        public UpdateIntervalSettingsViewModel(IUpdateHelper updateHelper, ICommandLocator commandLocator, ApplicationNameProvider applicationNameProvider,
                                               ICurrentSettingsProvider currentSettingsProvider, IGpoSettings gpoSettings, ITranslationUpdater translationUpdater,
                                               IEventAggregator eventAggregator, IInteractionRequest interactionRequest, ICurrentSettings <UpdateInterval> updateIntervalProvider, EditionHelper editionHelper,
                                               IUpdateLauncher updateLauncher, IOnlineVersionHelper onlineVersionHelper) :
            base(translationUpdater, currentSettingsProvider, gpoSettings)
        {
            _applicationNameProvider = applicationNameProvider;
            _updateHelper            = updateHelper;
            _commandLocator          = commandLocator;
            _interactionRequest      = interactionRequest;
            _updateIntervalProvider  = updateIntervalProvider;
            _editionHelper           = editionHelper;
            _updateLauncher          = updateLauncher;
            _onlineVersionHelper     = onlineVersionHelper;

            ShouldShowUpdate = updateHelper.UpdateShouldBeShown();
            _showUpdateEvent = eventAggregator.GetEvent <SetShowUpdateEvent>();
            _showUpdateEvent.Subscribe(SetShowDialog);
            currentSettingsProvider.SettingsChanged += (sender, args) =>
            {
                RaisePropertyChanged(nameof(CurrentUpdateInterval));
                RaisePropertyChanged(nameof(DisplayUpdateWarning));
            };
        }
コード例 #19
0
ファイル: Commons.cs プロジェクト: Monkeybin11/anno-designer
 static Commons()
 {
     _updateHelper = new UpdateHelper(App.ApplicationPath);
 }
コード例 #20
0
        /// <summary>
        /// Process f0 update.
        /// </summary>
        /// <param name="f0Updater">F0 updater.</param>
        /// <param name="intUtt">Internal utterance.</param>
        /// <param name="holder">Script acoustics holder.</param>
        /// <param name="phoneIndex">External phone index.</param>
        /// <param name="syllableIndex">External syllable index.</param>
        /// <param name="wordIndex">External normal word index.</param>
        private void ProcessF0Update(IUpdateHelper f0Updater, SP.TtsUtterance intUtt,
            ScriptAcousticsHolder holder, int phoneIndex, int syllableIndex, int wordIndex)
        {
            if (holder.HasAcousticsValue)
            {
                if (holder.Acoustics.UvSegs.Count > 1)
                {
                    throw new InvalidDataException("Do not support multiple UvSegs.");
                }
                else if (holder.Acoustics.UvSegs.Count == 1 && holder.Acoustics.UvSegs[0].HasF0ContourValue)
                {
                    LayerIndex layerIndex = f0Updater.FindLayerIndex(0, phoneIndex, syllableIndex,
                        wordIndex, _totalPhoneIndex);

                    float[] extNotNullF0;
                    List<int> intNotNullF0Position;
                    GetF0(intUtt, holder.Acoustics.UvSegs[0], layerIndex, out extNotNullF0,
                        out intNotNullF0Position);

                    if (extNotNullF0.Length > 0 && intNotNullF0Position.Count > 0)
                    {
                        bool f0Updated = ExecuteUpdateF0(intUtt, extNotNullF0, intNotNullF0Position);
                        f0Updater.LogMessage(f0Updated, wordIndex, syllableIndex, phoneIndex, 0,
                            "f0", _logger);
                    }
                }
            }
        }
コード例 #21
0
        /// <summary>
        /// Update state duration.
        /// </summary>
        /// <param name="durationUpdater">Duration updater.</param>
        /// <param name="intUtt">Internal utterance.</param>
        /// <param name="scriptPhone">Script phone.</param>
        /// <param name="phoneIndex">External phone index.</param>
        /// <param name="syllableIndex">External syllable index.</param>
        /// <param name="wordIndex">External normal word index.</param>
        /// <param name="frameLength">The length of each frame in millisecond.</param>
        private void UpdateStateDuration(IUpdateHelper durationUpdater, SP.TtsUtterance intUtt,
            ScriptPhone scriptPhone, int phoneIndex, int syllableIndex, int wordIndex, 
            float frameLength)
        {
            int statesCount = scriptPhone.States.Count;
            if (statesCount != 0)
            {
                if (statesCount != intUtt.Acoustic.Durations.Column)
                {
                    throw new InvalidDataException("Script states' count must equal to the" + 
                        "engine's.");
                }

                for (int stateIndex = 0; stateIndex < statesCount; stateIndex++)
                {
                    ProcessDurationUpdate(durationUpdater, intUtt, scriptPhone.States[stateIndex], 
                        stateIndex, phoneIndex, syllableIndex, wordIndex, frameLength);
                }
            }
        }
コード例 #22
0
 public InteractiveWorkflowManagerFactoryWithProfessionalHintHintStep(IWorkflowNavigationHelper workflowNavigationHelper, IProfessionalHintHelper professionalHintHelper, ISignaturePasswordCheck signaturePasswordCheck, IUpdateHelper updateHelper)
     : base(workflowNavigationHelper, signaturePasswordCheck, updateHelper)
 {
     _workflowNavigationHelper = workflowNavigationHelper;
     _professionalHintHelper   = professionalHintHelper;
 }
コード例 #23
0
ファイル: Commons.cs プロジェクト: AgmasGold/anno-designer
 static Commons()
 {
     _updateHelper = new UpdateHelper(App.ApplicationPath, new AppSettings());
 }
コード例 #24
0
        /// <summary>
        /// Process duration update.
        /// </summary>
        /// <param name="durationUpdater">Duration updater.</param>
        /// <param name="intUtt">Internal utterance.</param>
        /// <param name="holder">Script acoustic holder.</param>
        /// <param name="stateIndex">External state index.</param>
        /// <param name="phoneIndex">External phone index.</param>
        /// <param name="syllableIndex">External syllable index.</param>
        /// <param name="wordIndex">External normal word index.</param>
        /// <param name="frameLength">The length of each frame in millisecond.</param>
        private void ProcessDurationUpdate(IUpdateHelper durationUpdater, SP.TtsUtterance intUtt,
            ScriptAcousticsHolder holder, int stateIndex, int phoneIndex, int syllableIndex,
            int wordIndex, float frameLength)
        {
            if (holder.HasAcousticsValue && holder.Acoustics.HasDurationValue)
            {
                uint extDur = (uint)Math.Round(holder.Acoustics.Duration / frameLength);

                LayerIndex layerIndex = durationUpdater.FindLayerIndex(stateIndex, phoneIndex,
                    syllableIndex, wordIndex, _totalPhoneIndex);
                int phoneCount = layerIndex.EndPhone - layerIndex.StartPhone;
                if (!(layerIndex.State == NotUpdateState && (phoneCount == 0 || 
                    layerIndex.EndPhone > intUtt.Phones.Count)))
                {
                    bool durationUpdated = ExecuteUpdateDuration(intUtt, extDur, layerIndex);
                    durationUpdater.LogMessage(durationUpdated, wordIndex, syllableIndex,
                        phoneIndex, stateIndex, "duration", _logger);
                }
            }
        }
コード例 #25
0
 public UpdateHintStep(IUpdateHelper updateHelper)
 {
     _updateHelper = updateHelper;
 }
コード例 #26
0
ファイル: UpdateExecutor.cs プロジェクト: wanwei/sc2
 public UpdateExecutor(IUpdateHelper updateProceed)
 {
     this.updateProceed = updateProceed;
 }
コード例 #27
0
 public InteractiveWorkflowManagerFactory(IWorkflowNavigationHelper workflowNavigationHelper, ISignaturePasswordCheck signaturePasswordCheck, IUpdateHelper updateHelper)
 {
     _workflowNavigationHelper = workflowNavigationHelper;
     _signaturePasswordCheck   = signaturePasswordCheck;
     _updateHelper             = updateHelper;
 }