コード例 #1
0
 public MainController(IMainView view,
     IFileWatcherService fileWatcherService)
 {
     FileWatcherService = fileWatcherService;
     View = view;
     PrepareUI();
 }
コード例 #2
0
 public KuduFileService(IPublishSettingsService publishSettingsService,
                        ILocalLogService localLogService, IFileWatcherService fileWatcherService)
 {
     _fileWatcherService     = fileWatcherService;
     _publishSettingsService = publishSettingsService;
     _localLogService        = localLogService;
 }
コード例 #3
0
        public MainWindowViewModel(IFileSystemService fileSystemService, IFileWatcherService fileWatcherService, IMessenger messenger)
        {
            _fileSystemService  = fileSystemService;
            _fileWatcherService = fileWatcherService;

            _logger.Info("register on directoryChangedMessage");
            messenger.Register <DirectoryChangedMessage>(this, OnDirectoryChangedMessageReceive);
        }
コード例 #4
0
 private string Humanize(IFileWatcherService fws)
 {
     return fws.IsDirty ?
         string.Format("Обнаружено {0} изменений в {1} репозиториях, гражданин хороший!",
                             fws.State.Sum(pair => pair.Value.State.Count),
                             fws.State.Count(pair => pair.Value.State.Count > 0)) :
         TextLiterals.Nothing;
 }
コード例 #5
0
        public MainWindowViewModel(IFileSystemService fileSystemService, IFileWatcherService fileWatcherService, IMessenger messenger)
        {
            _fileSystemService = fileSystemService;
            _fileWatcherService = fileWatcherService;

            _logger.Info("register on directoryChangedMessage");
            messenger.Register<DirectoryChangedMessage>(this, OnDirectoryChangedMessageReceive);
        }
コード例 #6
0
 public PokemonService(IRaidbossService raidbossService, ILocalizationService localizationService, IFileWatcherService fileWatcherService)
 {
     LocalizationService = localizationService;
     FileWatcherService  = fileWatcherService;
     RaidbossService     = raidbossService;
     PokemonPerCulture   = new LazyConcurrentDictionary <CultureInfo, List <IPokemon> >();
     LoadPokemon("de-DE");
     LoadPokemon("en-US");
 }
コード例 #7
0
 public SinkApplicationContext(
     IFileWatcherService fileWatcherService,
     IControllerFactory controllerFactory,
     ISinkApplicationSettings applicationSettings)
 {
     _controllerFactory = controllerFactory;
     _applicationSettings = applicationSettings;
     FileWatcherService = fileWatcherService;
 }
コード例 #8
0
ファイル: Program.cs プロジェクト: andrewleaf/CodeKata
        static void Main(string[] args)
        {
            _service = new FileWatcherService(args[0], args[1] );

            _watcher = _service.CreateWatcher();

            _watcher.Changed += watcher_Changed;
            _watcher.Created += watcher_Created;
            while (true) ;
        }
コード例 #9
0
ファイル: Versioning.cs プロジェクト: gunnim/GMO.Versioning
 /// <summary>
 /// ctor
 /// </summary>
 public Versioning(
     HttpContextBase httpCtx,
     IFileSystem fileSystem,
     IFileWatcherService fswSvc,
     IMemoryCacheService memoryCacheService
     )
 {
     _httpCtx            = httpCtx;
     _fs                 = fileSystem;
     _fswSvc             = fswSvc;
     _memoryCacheService = memoryCacheService;
 }
コード例 #10
0
        public static void OnInitialized(IFileWatcherService fileWatcherService, IHandlebarsCompileService compileService)
        {
            var templatesPath = HostingEnvironment.MapPath(HandlebarsCompileConfig.TemplatesPath);
            var compiledFile  = HostingEnvironment.MapPath(HandlebarsCompileConfig.CompiledFilePath);

            if (!File.Exists(compiledFile))
            {
                compileService.PrecompileHandlebarsTemplate(compiledFile, templatesPath);
            }

            if (HandlebarsCompileConfig.IsEnabled)
            {
                fileWatcherService.WatchOnDirectory(templatesPath, () => compileService.PrecompileHandlebarsTemplate(compiledFile, templatesPath));
            }
        }
コード例 #11
0
ファイル: Reindexer.cs プロジェクト: Pliner/Reindexer
        public Reindexer(
            IFullTextIndex fullTextIndex,
            IQueryParser queryParser,
            ITokenizer tokenizer,
            IFileWatcherService fileWatcherService,
            IDisposable disposable
            )
        {
            this.fullTextIndex      = fullTextIndex;
            this.queryParser        = queryParser;
            this.tokenizer          = tokenizer;
            this.fileWatcherService = fileWatcherService;
            this.disposable         = disposable;

            indexChangesSubscription = fileWatcherService.Changes
                                       .ObserveOn(ThreadPoolScheduler.Instance)
                                       .Subscribe(IndexChanges);
        }
コード例 #12
0
        /// <summary>
        /// Initializes a new instance of the <see cref="ShellViewModel"/> class.
        /// </summary>
        public ShellViewModel(ILogAnalyzerService logAnalyzerService, IFileWatcherService fileWatcherService, IDispatcherService dispatcherService, 
            IOpenFileService openFileService, IPleaseWaitService pleaseWaitService, IMessageService messageService)
        {
            _logAnalyzerService = logAnalyzerService;
            _fileWatcherService = fileWatcherService;
            _dispatcherService = dispatcherService;
            _openFileService = openFileService;
            _pleaseWaitService = pleaseWaitService;
            _messageService = messageService;

            ParseCommand = new Command(OnParseCommandExecute, OnParseCommandCanExecute);

            LoadFile = new Command<string>(OnLoadFileExecute);

            OpenFileCommand = new Command(OnOpenFileCommandExecute);

            ExitCommand = new Command(OnExitCommandExecute);

            Document = new TextDocument();

            Filter = new LogFilter
                {
                    EnableDebug = true,
                    EnableError = true,
                    EnableInfo = true,
                    EnableWarning = true
                };

            Filter.PropertyChanged += OnFilterPropertyChanged;

            Document.Changed += DocumentChanged;

            _logEntries = new FastObservableCollection<LogEntry>();

            using (var reader = new XmlTextReader("Resources\\HighlightingDefinition.xshd"))
            {
                HighlightingDefinition = HighlightingLoader.Load(reader, HighlightingManager.Instance);
            }

            HighlightingManager.Instance.RegisterHighlighting("CatelHighlighting", new[] { ".cool" }, HighlightingDefinition);
        }
コード例 #13
0
 public Worker(IProjectWatcherRepository projectWatcherRepository,
               IFileWatcherService fileWatcherService)
 {
     _projectWatcherRepository = projectWatcherRepository;
     _fileWatcherService       = fileWatcherService;
 }
コード例 #14
0
 private void FileWatcherServiceOnChangeNotification(IFileWatcherService fws, string notification)
 {
     ShowBalloon("Синхронизатор#8 говорит", notification);
     SetIcon(!fws.IsDirty);
 }
コード例 #15
0
        static void Main(string[] args)
        {
            ///可由第1個參數指定起始路徑
            if (args != null && args.Length > 0 && Directory.Exists(args[0].ToString()))
            {
                Helper.SetRootPath(args[0]);
            }
            else
            {
                Helper.SetRootPath(AppContext.BaseDirectory);
            }

            AppDomain.CurrentDomain.UnhandledException += CurrentDomain_UnhandledException;

            Console.Title = "WhatName " + Assembly.GetExecutingAssembly().GetName().Version;

            InitLog4net();
            Ioc.Register();
            string simpStr1 = Ioc.Get <IChineseConverter>().ToSimplifiedChinese(
                "財富管理信託管理費計收方式依開戶總約定書之約定辦理,實際收取時間依本公司公告");
            string simpStr2 = Ioc.Get <IChineseConverter>().ToSimplifiedChinese(
                "請提供預設記憶體大小及硬碟容量,以及所需軟體清單,方便進行資料庫管理");
            string simpStr3 = Ioc.Get <IChineseConverter>().ToSimplifiedChinese(
                "美國總統川普上任以來發生不少風波,邁入2018後回顧2017年,仍可發現他完成許多政策,美媒選出了最具有代表性的十大政績");
            string simpStr4 = Ioc.Get <IChineseConverter>().ToSimplifiedChinese(
                "計程車");


            var shareFolders = Ioc.GetConfig().Folders;

            ISearchSercice   searchService   = Ioc.Get <ISearchSercice>();
            IDocumentService documentService = Ioc.Get <IDocumentService>();

            documentService.SetCallback(delegate(string folderPath)
            {
                //Console.WriteLine(folderPath + " was queued.");
            }, delegate(string folderPath)
            {
                //Console.WriteLine(folderPath + " was done.");
            }, delegate(int docCount)
            {
                Console.WriteLine("總共有 {0} 檔案己加入索引", docCount);
            });

            //logger.Info(".Net core Version: " + GetNetCoreVersion());

            var config = Ioc.GetConfig();

            documentService.Start(shareFolders);
            IFileWatcherService watcherService = Ioc.Get <IFileWatcherService>();

            if (config.EnableWatch)
            {
                watcherService.Start(shareFolders);
            }

            Ioc.Get <IReseekFolderJob>().Start();
            var webHostBuilder = WebHost.CreateDefaultBuilder(args)
                                 .UseKestrel(t =>
            {
                t.Limits.MaxConcurrentConnections = 100;
                t.ListenAnyIP(config.Port);
                //t.Listen(IPAddress.Any, 443, listenOptions =>
                //{
                //    listenOptions.UseHttps("server.pfx", "password");
                //});
            })
                                 .UseStartup <Startup>();

            var webHost = webHostBuilder.Build();

            try
            {
                webHost.Run();
            }
            catch (Exception ex)
            {
                LogManager.GetLogger(typeof(Program)).Fatal("網站啟動失敗", ex);
                Console.WriteLine("網站啟動失敗, ex=" + ex.Message);
            }
            finally
            {
                Ioc.Get <IReseekFolderJob>().Stop();
            }

            //Console.ReadKey();
            //StartConsole(searchService);

            watcherService.Stop();
        }