public InstallUploadPackageCommand(IPackageRepository repository, ITempPackager tempPackager, IInstallationRecorder installationRecorder, IPublishService publishService)
 {
     _repository           = repository;
     _tempPackager         = tempPackager;
     _installationRecorder = installationRecorder;
     _publishService       = publishService;
 }
예제 #2
0
        /// <summary>
        /// Initializes a new instance of the <see cref="PostController"/> class.
        /// </summary>
        /// <param name="settings"><see cref="WebAppSettings"/> instance.</param>
        /// <param name="markdownHelper"><see cref="IMarkdownHelper"/> instance.</param>
        /// <param name="themeService"><see cref="IThemeService"/> instance.</param>
        /// <param name="publishService"><see cref="IPublishService"/> instance.</param>
        public PostController(WebAppSettings settings, IMarkdownHelper markdownHelper, IThemeService themeService, IPublishService publishService)
        {
            if (settings == null)
            {
                throw new ArgumentNullException(nameof(settings));
            }

            this._settings = settings;

            if (markdownHelper == null)
            {
                throw new ArgumentNullException(nameof(markdownHelper));
            }

            this._markdownHelper = markdownHelper;

            if (themeService == null)
            {
                throw new ArgumentNullException(nameof(themeService));
            }

            this._themeService = themeService;

            if (publishService == null)
            {
                throw new ArgumentNullException(nameof(publishService));
            }

            this._publishService = publishService;
        }
예제 #3
0
        /// <summary>
        /// Initializes a new instance of the <see cref="PostController"/> class.
        /// </summary>
        /// <param name="settings"><see cref="WebAppSettings"/> instance.</param>
        /// <param name="markdownHelper"><see cref="IMarkdownHelper"/> instance.</param>
        /// <param name="themeService"><see cref="IThemeService"/> instance.</param>
        /// <param name="publishService"><see cref="IPublishService"/> instance.</param>
        public PostController(WebAppSettings settings, IMarkdownHelper markdownHelper, IThemeService themeService, IPublishService publishService)
        {
            if (settings == null)
            {
                throw new ArgumentNullException(nameof(settings));
            }

            this._settings = settings;

            if (markdownHelper == null)
            {
                throw new ArgumentNullException(nameof(markdownHelper));
            }

            this._markdownHelper = markdownHelper;

            if (themeService == null)
            {
                throw new ArgumentNullException(nameof(themeService));
            }

            this._themeService = themeService;

            if (publishService == null)
            {
                throw new ArgumentNullException(nameof(publishService));
            }

            this._publishService = publishService;
        }
 public InstallUploadPackageCommand(IPackageRepository repository, ITempPackager tempPackager, IInstallationRecorder installationRecorder, IPublishService publishService)
 {
     _repository = repository;
     _tempPackager = tempPackager;
     _installationRecorder = installationRecorder;
     _publishService = publishService;
 }
 public RssFeedGenerator(IFeedDataClient feedDataClient,
     IFeedService feedService,
     IPublishService publishService,
     IFeedSettings feedSettings)
     : base(feedDataClient, feedService, publishService, feedSettings)
 {
 }
 public AtomFeedGenerator(IFeedDataClient feedDataClient,
                          IFeedService feedService,
                          IPublishService publishService,
                          IFeedSettings feedSettings)
     : base(feedDataClient, feedService, publishService, feedSettings)
 {
 }
예제 #7
0
        public ActionResult Index(int?page, PubIndexModels model)
        {
            Company currentCompany  = ((EInvoiceContext)FXContext.Current).CurrentCompany;
            int     curentPageIndex = page.HasValue ? page.Value - 1 : 0;
            int     pageSize        = 10;
            int     totalRecords    = 0;

            DateTime DateFrom = String.IsNullOrEmpty(model.fromdate) ? DateTime.MinValue : DateTime.ParseExact(model.fromdate, "dd/MM/yyyy", null);
            DateTime DateTo   = String.IsNullOrEmpty(model.todate) ? DateTime.MaxValue : DateTime.ParseExact(model.todate, "dd/MM/yyyy", null);

            if (DateFrom != null && DateTo != null && DateFrom > DateTo)
            {
                Messages.AddErrorMessage("Nhập đúng dữ liệu tìm kiếm theo ngày!");
                DateFrom       = DateTime.MinValue;
                DateTo         = DateTime.MaxValue;
                model.fromdate = model.todate = "";
            }
            int pstatus = (String.IsNullOrEmpty(model.status) ? -1 : Convert.ToInt32(model.status));

            IPublishService pubSrc = IoC.Resolve <IPublishService>();
            IList <Publish> lst    = pubSrc.SearchByDate(currentCompany.id, DateFrom, DateTo, pstatus, curentPageIndex, pageSize, out totalRecords);

            model.PageListPUB = new PagedList <Publish>(lst, curentPageIndex, pageSize, totalRecords);
            return(View(model));
        }
예제 #8
0
        public ActionResult EditRPublish(int id)
        {
            IPublishService pubSrc = IoC.Resolve <IPublishService>();
            Publish         opub   = pubSrc.Getbykey(id);

            if (opub.Status != PublishStatus.InUse)
            {
                PublishModel model           = new PublishModel();
                Company      _currentcompany = IoC.Resolve <ICompanyService>().Getbykey(((EInvoiceContext)FXContext.Current).CurrentCompany.id);

                ITaxAuthorityService taxSrc = IoC.Resolve <ITaxAuthorityService>();
                model.TaxList = new SelectList(from tax in taxSrc.Query select tax, "Code", "Name", opub.TaxAuthorityCode);
                IRegisterTempService regisSrc = IoC.Resolve <IRegisterTempService>();
                model.RegTempList = new SelectList(from re in regisSrc.Query where re.ComId == _currentcompany.id select re, "Id", "Name");

                model.mPublish       = opub;
                model.PubInvoiceList = opub.PublishInvoices.SerializeJSON <PublishInvoice>();
                return(View(model));
            }
            else
            {
                Messages.AddErrorFlashMessage("Thông báo phát hành này không được phép sửa");
                return(RedirectToAction("Index"));
            }
        }
예제 #9
0
        public string Ping(string[] keys)
        {
            IPublishService subscriber = Context.GetCallbackChannel <IPublishService>();
            var             result     = string.Empty;

            foreach (var key in keys)
            {
                var list = ServiceRegister.GlobalRegister.GetHandler(key);

                foreach (var item in list)
                {
                    if (subscriber != item.Key)
                    {
                        continue;
                    }

                    item.Value.Active();

                    result = Context.GetClientAddress() + " key:" + key + " ping current host(" + Dns.GetHostName() + ") at:" + DateTime.Now.ToString();
                    Trace.WriteLine(result);
                }
            }

            if (string.IsNullOrEmpty(result))
            {
                foreach (var key in keys)
                {
                    ServiceRegister.GlobalRegister.Register(key, subscriber, Context.GetClientAddress());
                }
            }

            return(result);
        }
예제 #10
0
 public DxStatsController(
     IDxDataRepository dxDataRepository,
     IPublishService publishService
     )
 {
     _dxDataRepository = dxDataRepository;
     _publishService   = publishService;
 }
예제 #11
0
 public OnPublishAllProviderFunding(
     ILogger logger,
     IPublishService publishService,
     IMessengerService messengerService,
     IUserProfileProvider userProfileProvider, bool useAzureStorage = false)
     : base(logger, messengerService, FunctionName, QueueName, useAzureStorage, userProfileProvider, publishService)
 {
 }
예제 #12
0
        public void UnSubscribe(string requestKey)
        {
            IPublishService subscriber = Context.GetCallbackChannel <IPublishService>();

            Trace.WriteLine(Context.GetClientAddress() + " UnSubscribed");

            ServiceRegister.GlobalRegister.UnRegister(requestKey, subscriber);
        }
예제 #13
0
 //This constructor is needed for unit testing but should not be visible from services that ingest the package
 internal FluentQueueApi(
     IPublishService publishService,
     ISubscriptionService subscriptionService,
     ISchedulerService schedulerService)
 {
     _publishService      = publishService;
     _subscriptionService = subscriptionService;
     _schedulerService    = schedulerService;
 }
 public ArticleFeedGenerator(IFeedDataClient feedDataClient,
                             IFeedService feedService,
                             IPublishService publishService,
                             IFeedSettings feedSettings)
 {
     _feedDataClient = feedDataClient;
     _feedService    = feedService;
     _publishService = publishService;
     _feedSettings   = feedSettings;
 }
예제 #15
0
        public PublishModule(IPublishService publishService, IAuthoriser authoriser)
            : base(authoriser, "/services/publish")
        {
            _publishService = publishService;

            Post["/{mode}"] = InvokePublishing;
            Post["/listofitems"] = InvokePublishingOfListOfItems;
            Get["/lastcompleted"] = LastCompleted;
            Get["/lastcompleted/{source}/{target}/{language}"] = LastCompleted;
        }
 public ArticleFeedGenerator(IFeedDataClient feedDataClient, 
     IFeedService feedService, 
     IPublishService publishService,
     IFeedSettings feedSettings)
 {
     _feedDataClient = feedDataClient;
     _feedService = feedService;
     _publishService = publishService;
     _feedSettings = feedSettings;
 }
예제 #17
0
 private void ReleaseKeysOnApplicationExit(IKeyStateService keyStateService, IPublishService publishService)
 {
     Current.Exit += (o, args) =>
     {
         if (keyStateService.SimulateKeyStrokes)
         {
             publishService.ReleaseAllDownKeys();
         }
     };
 }
예제 #18
0
        public PublishModule(IPublishService publishService, IAuthoriser authoriser)
            : base(authoriser, "/services/publish")
        {
            _publishService = publishService;

            Post["/{mode}"]       = InvokePublishing;
            Post["/listofitems"]  = InvokePublishingOfListOfItems;
            Get["/lastcompleted"] = LastCompleted;
            Get["/lastcompleted/{source}/{target}/{language}"] = LastCompleted;
        }
예제 #19
0
        public OnPublishBatchProviderFunding(
            ILogger logger,
            IPublishService publishService,
            IMessengerService messengerService,
            IUserProfileProvider userProfileProvider, bool useAzureStorage = false)
            : base(logger, messengerService, FunctionName, QueueName, useAzureStorage, userProfileProvider, publishService)
        {
            Guard.ArgumentNotNull(publishService, nameof(publishService));

            _publishService = publishService;
        }
        public PublishTest()
        {
            var _rabbitMQProvider = new RabbitMQProvider(new RabbitMQOptions
            {
                Host     = "127.0.0.1",
                Port     = 5672,
                Username = "******",
                Password = "******"
            });

            _publish = new PublishService(_rabbitMQProvider);
        }
예제 #21
0
        //    private GuardAgainstNulls nullValidation = new GuardAgainstNulls();
        //Dictionary<string, Guid> TransactionNameSavedTransactions = new Dictionary<string, Guid>();
        //     Dictionary<Guid, Guid> newObjectsSavedTransactions = new Dictionary<Guid, Guid>();


        /// <summary>
        ///   Initializes a new instance of the DynamicPropertyManager class.
        /// </summary>
        /// <param name = "repository"></param>
        public DynamicPropertyManager(IEntityRepository repository, INameManager nameManager, IPersistor Persistor, IPublishService publishService)
        {
            _repository = repository;

            persistor = Persistor;

            this.nameManager = nameManager;

            typeProperties.OnMissing = OnMissingType;

            this.publishService = publishService;
        }
예제 #22
0
 public PublishingStepDefinition(IPublishFundingStepContext publishFundingStepContext,
                                 CurrentSpecificationStepContext currentSpecificationStepContext,
                                 CurrentJobStepContext currentJobStepContext,
                                 CurrentUserStepContext currentUserStepContext,
                                 IPublishService publishService)
 {
     _publishFundingStepContext       = publishFundingStepContext;
     _currentSpecificationStepContext = currentSpecificationStepContext;
     _currentJobStepContext           = currentJobStepContext;
     _currentUserStepContext          = currentUserStepContext;
     _publishService = publishService;
 }
예제 #23
0
        public EditorMainViewmodel(IPictogramRepository pictogramRepository, IPublishService publishService,
                                   IImagePicker imagePicker)
        {
            _pictogramRepository = pictogramRepository;
            _publishService      = publishService;
            _imagePicker         = imagePicker;

            _images      = new ObservableCollection <Image>();
            _pictograms  = new ObservableCollection <Pictogram>();
            _ingredients = new ObservableCollection <Ingredient>();
            _steps       = new ObservableCollection <Step>();
        }
예제 #24
0
        public static void SetupTests(TestContext tc)
        {
            SetupTests("calcengine");

            _logger         = CreateLogger();
            _approveService = CreateApproveService();
            _publishService = CreatePublishService();
            _refreshService = CreateRefreshService();
            _publishedProviderReIndexerService = CreatePublishedProviderReIndexerService();
            _deletePublishedProvidersService   = CreateDeletePublishedProvidersService();
            _userProfileProvider = CreateUserProfileProvider();
            _sqlImportService    = Substitute.For <ISqlImportService>();
        }
예제 #25
0
        public FluentQueueApi()
        {
            var unityContainer = new UnityContainer();

            unityContainer.RegisterType <IPublishService, PublishService>();
            unityContainer.RegisterType <ISubscriptionService, SubscriptionService>();
            unityContainer.RegisterType <ICronExpressionService, CronExpressionService>();
            unityContainer.RegisterType <ISchedulerService, SchedulerService>();

            _publishService      = unityContainer.Resolve <IPublishService>();
            _subscriptionService = unityContainer.Resolve <ISubscriptionService>();
            _schedulerService    = unityContainer.Resolve <ISchedulerService>();
        }
        /// <summary>
        /// Initializes a new instance of the <see cref="PublishServiceTest"/> class.
        /// </summary>
        /// <param name="fixture"><see cref="PublishServiceFixture"/> instance.</param>
        public PublishServiceTest(PublishServiceFixture fixture)
        {
            this._settings         = fixture.WebAppSettings;
            this._markdownHelper   = fixture.MarkdownHelper;
            this._fileHelper       = fixture.FileHelper;
            this._httpClientHelper = fixture.HttpClientHelper;
            this._service          = fixture.PublishService;

            this._env              = new Mock <IApplicationEnvironment>();
            this._filepath         = "/home/scissorhands.net/wwwroot/posts".Replace('/', Path.DirectorySeparatorChar);
            this._request          = new Mock <HttpRequest>();
            this._defaultThemeName = "default";
        }
예제 #27
0
        public OutputService(
            IKeyboardService keyboardService,
            ISuggestionStateService suggestionService,
            IPublishService publishService,
            IDictionaryService dictionaryService)
        {
            this.keyboardService = keyboardService;
            this.suggestionService = suggestionService;
            this.publishService = publishService;
            this.dictionaryService = dictionaryService;

            ReactToPublishingStateChanges();
            ReactToPublishableKeyDownStateChanges();
        }
 private static ArticleFeedGenerator CreateFeedGenerator(
     IFeedDataClient feedDataClient,
     IFeedService feedService,
     IPublishService publishService,
     IFeedSettings feedSettings)
 {
     string feedFormat = feedSettings.FeedFormat;
     switch (feedFormat.ToLower())
     {
         case "atom": return new AtomFeedGenerator(feedDataClient, feedService, publishService, feedSettings);
         case "rss": return new RssFeedGenerator(feedDataClient, feedService, publishService, feedSettings);
         default: throw new ArgumentException("Unknown feed format");
     }
 }
예제 #29
0
        public ActionResult DetailRPublish(int id)
        {
            if (id <= 0)
            {
                throw new HttpRequestValidationException();
            }
            IPublishService        pubSrc    = IoC.Resolve <IPublishService>();
            Publish                model     = pubSrc.Getbykey(id);
            IPublishInvoiceService pubinvSrc = IoC.Resolve <IPublishInvoiceService>();
            var qr = (from pi in pubinvSrc.Query where pi.PublishID == model.id select pi);
            IList <PublishInvoice> lstpubinv = qr.ToList();

            ViewData["lstpubinv"] = lstpubinv;
            return(View(model));
        }
예제 #30
0
        private static ArticleFeedGenerator CreateFeedGenerator(
            IFeedDataClient feedDataClient,
            IFeedService feedService,
            IPublishService publishService,
            IFeedSettings feedSettings)
        {
            string feedFormat = feedSettings.FeedFormat;

            switch (feedFormat.ToLower())
            {
            case "atom": return(new AtomFeedGenerator(feedDataClient, feedService, publishService, feedSettings));

            case "rss": return(new RssFeedGenerator(feedDataClient, feedService, publishService, feedSettings));

            default: throw new ArgumentException("Unknown feed format");
            }
        }
예제 #31
0
        public void UnRegister(string requestKey, IPublishService subscriber)
        {
            if (!Cache.ContainsKey(requestKey))
            {
                return;
            }

            lock (_syncObj)
            {
                var item = Cache[requestKey].FirstOrDefault(m => m.Key == subscriber);

                if (item == null || item.Key == null)
                {
                    return;
                }

                Cache[requestKey].Remove(item);
            }
        }
예제 #32
0
 public void Register(string requestKey, IPublishService subscriber, string subscriberId)
 {
     lock (_syncObj)
     {
         if (Cache.ContainsKey(requestKey))
         {
             if (Cache[requestKey].All(m => m.Key != subscriber))
             {
                 Cache[requestKey].Add(new CustomPair <IPublishService, RunInfo>(subscriber, new RunInfo(subscriberId)));
             }
         }
         else
         {
             var list = new List <CustomPair <IPublishService, RunInfo> >();
             list.Add(new CustomPair <IPublishService, RunInfo>(subscriber, new RunInfo(subscriberId)));
             Cache.AddOrUpdate(requestKey, list, (k, l) => l);
         }
     }
 }
예제 #33
0
        public ActionResult SelectedPublish(int id)
        {
            if (id <= 0)
            {
                throw new HttpRequestValidationException();
            }
            Company         _currentcompany = ((EInvoiceContext)FXContext.Current).CurrentCompany;
            IPublishService pubSrc          = IoC.Resolve <IPublishService>();
            string          ERRMessage      = "";
            Publish         pub             = pubSrc.Getbykey(id);

            if (pub.Status == PublishStatus.Newpub)
            {
                if (pubSrc.SendforApprove(pub, out ERRMessage) == true)
                {
                    log.Info("SelectedPublish Publish by: " + HttpContext.User.Identity.Name + " Info-- ID: " + id.ToString());
                    Messages.AddFlashMessage("Gửi thành công");
                }
                else
                {
                    log.Error("SelectedPublish Publish:" + ERRMessage);
                    Messages.AddErrorFlashMessage(ERRMessage);
                }
                return(RedirectToAction("DetailRPublish/" + id + ""));
            }
            if (pub.Status == PublishStatus.Waiting)
            {
                if (pubSrc.Approve(pub, out ERRMessage) == true)
                {
                    log.Info("SelectedPublish Publish by: " + HttpContext.User.Identity.Name + " Info-- ID: " + id.ToString());
                    Messages.AddFlashMessage("Phát hành thành công!");
                }
                else
                {
                    log.Error("SelectedPublish Publish:" + ERRMessage);
                    Messages.AddErrorFlashMessage(ERRMessage);
                }
                return(RedirectToAction("DetailRPublish/" + id + ""));
            }
            Messages.AddErrorFlashMessage("Không thực hiện thành công");
            return(RedirectToAction("DetailRPublish/" + id + ""));
        }
예제 #34
0
        public KeyboardOutputService(
            IKeyStateService keyStateService,
            ISuggestionStateService suggestionService,
            IPublishService publishService,
            IDictionaryService dictionaryService,
            Action<KeyValue> fireKeySelectionEvent)
        {
            this.keyStateService = keyStateService;
            this.suggestionService = suggestionService;
            this.publishService = publishService;
            this.dictionaryService = dictionaryService;
            this.fireKeySelectionEvent = fireKeySelectionEvent;

            ReactToSimulateKeyStrokesChanges();
            ReactToShiftStateChanges();
            ReactToPublishableKeyDownStateChanges();
            ReactToKeyboardIsShiftAwareChanges();
            ReactToSuppressAutoCapitaliseIntelligentlyChanges();
            AutoPressShiftIfAppropriate();
        }
예제 #35
0
        public KeyboardOutputService(
            IKeyStateService keyStateService,
            ISuggestionStateService suggestionService,
            IPublishService publishService,
            IDictionaryService dictionaryService,
            Action <KeyValue> fireKeySelectionEvent)
        {
            this.keyStateService       = keyStateService;
            this.suggestionService     = suggestionService;
            this.publishService        = publishService;
            this.dictionaryService     = dictionaryService;
            this.fireKeySelectionEvent = fireKeySelectionEvent;

            ReactToSimulateKeyStrokesChanges();
            ReactToShiftStateChanges();
            ReactToPublishableKeyDownStateChanges();
            ReactToKeyboardIsShiftAwareChanges();
            ReactToSuppressAutoCapitaliseIntelligentlyChanges();
            AutoPressShiftIfAppropriate();
        }
예제 #36
0
        public ActionResult DeleteRPublish(int id)
        {
            if (id <= 0)
            {
                throw new HttpRequestValidationException();
            }
            string          message = "";
            IPublishService pubSrc  = IoC.Resolve <IPublishService>();

            if (pubSrc.DeletePub(id, out message) == true)
            {
                log.Info("Delete Publish by: " + HttpContext.User.Identity.Name + " Info-- ID: " + id.ToString());
                Messages.AddFlashMessage("Xóa thành công!");
            }
            else
            {
                log.Error("Delete Publish:" + message);
                Messages.AddErrorFlashMessage("Có lỗi xảy ra, vui lòng thực hiện lại!");
            }
            return(RedirectToAction("Index"));
        }
예제 #37
0
파일: App.xaml.cs 프로젝트: tqphan/OptiKey
 private void ReleaseKeysOnApplicationExit(IKeyboardService keyboardService, IPublishService publishService)
 {
     Application.Current.Exit += (o, args) =>
     {
         if (keyboardService.KeyDownStates[KeyValues.SimulateKeyStrokesKey].Value.IsDownOrLockedDown())
         {
             publishService.ReleaseAllDownKeys();
         }
     };
 }
예제 #38
0
 public PublishController(IPublishService service)
 {
     this.service = service;
 }
예제 #39
0
 private static void ReleaseKeysOnApplicationExit(IKeyStateService keyStateService, IPublishService publishService)
 {
     Current.Exit += (o, args) =>
     {
         if (keyStateService.SimulateKeyStrokes)
         {
             publishService.ReleaseAllDownKeys();
         }
     };
 }
예제 #40
0
 public MouseOutputService(IPublishService publishService)
 {
     this.publishService = publishService;
 }
 public PublishingLastCompletedCommand(IPublishService publishService)
 {
     _publishService = publishService;
 }
 public PublishingLastCompletedCommand(IPublishService publishService)
 {
     _publishService = publishService;
 }
예제 #43
0
 public MouseOutputService(IPublishService publishService)
 {
     this.publishService = publishService;
 }
 public InvokePublishingCommand(IPublishService publishService)
 {
     _publishService = publishService;
 }