Example #1
0
        protected override void OnStart(string[] args)
        {
            using (var writer = new StreamWriter(@"C:\Users\Александр\source\repos\Service\Service\bin\Debug\ServiceWork.txt", true, Encoding.UTF8))
            {
                writer.WriteLine(DateTime.Now + " служба " + this.ServiceName + " запущена");
            }
            Logger.Log.Info(" служба " + this.ServiceName + " запускается");
            var    folder    = ConfigurationManager.AppSettings["Folder"];
            string timer     = ConfigurationManager.AppSettings["timer"];
            var    sortFiles = new SortByExtension(folder, int.Parse(timer));

            sortFiles.Start();
            Logger.Log.Info(" служба " + this.ServiceName + " запусщена");
        }
Example #2
0
        /// <summary>
        /// Главная точка входа для приложения.
        /// </summary>
        private static void Main()
        {
            Logger.InitLogger();

            if (Environment.UserInteractive)
            {
                var sortByExtension = new SortByExtension(@"C:\Users\Александр\Documents\Стажировка Navicon\Exercise4", 10000);
                sortByExtension.Start();
                Logger.Log.Info(" служба " + " запусщена");
            }
            else
            {
                ServiceBase[] ServicesToRun;
                ServicesToRun = new ServiceBase[]
                {
                    new Service1()
                };
                ServiceBase.Run(ServicesToRun);
            }
            while (true)
            {
                ;
            }
        }
Example #3
0
 public override IHtmlString RenderHeader(ViewContext viewContext)
 {
     return(SortByExtension.RenderGridHeader(viewContext.RequestContext, base.RenderHeader(viewContext).ToString(), this.PropertyName, this.Order));
 }
Example #4
0
 public override IHtmlString RenderHeaderContainerAtts(ViewContext viewContext)
 {
     return(new HtmlString("class='" + SortByExtension.RenderSortHeaderClass(viewContext.RequestContext, this.PropertyName, this.Order).ToString() + "'"));
 }
Example #5
0
 public override IHtmlString RenderHeader(ViewContext viewContext)
 {
     return(SortByExtension.RenderGridHeader(viewContext.RequestContext, base.RenderHeader(viewContext).ToString(), "Navigation.Show", this.Order));
 }