public SettingsParser(string settingsFileContent, IGlobalInfo globalInfo)
 {
     _settingsFileContent = settingsFileContent
                            ?? throw new ArgumentNullException(paramName: nameof(settingsFileContent));
     _globalInfo = globalInfo
                   ?? throw new ArgumentNullException(paramName: nameof(globalInfo));
 }
        public WebsiteArchivator(string websiteRootPath, IGlobalInfo globalInfo, DirectoryHelper directoryHelper)
        {
            if (!Directory.Exists(websiteRootPath))
            {
                throw new InvalidOperationException($@"Указанная папка сайта {websiteRootPath} не существует");
            }

            _directoryHelper = directoryHelper
                               ?? throw new ArgumentNullException(paramName: nameof(directoryHelper));

            var websiteDirectoryRootPath = websiteRootPath;

            _siteDirectoryPath     = Path.Combine(websiteDirectoryRootPath, globalInfo.SiteFolderName());
            _archDirectoryRootPath = Path.Combine(websiteDirectoryRootPath, globalInfo.SiteArchiveFolderName());

            if (!Directory.Exists(_siteDirectoryPath))
            {
                throw new InvalidOperationException($@"Папки с прежними файлами сайта {_siteDirectoryPath} не сущестует");
            }

            if (!Directory.Exists(_archDirectoryRootPath))
            {
                Directory.CreateDirectory(_archDirectoryRootPath);
            }
        }
Exemplo n.º 3
0
        public async Task Global()
        {
            using (this.Context.Channel.EnterTypingState())
            {
                IGlobalInfo globalInfo = this._currencyManager.GetGlobalInfo();

                EmbedBuilder builder = new EmbedBuilder();
                builder.WithTitle("Global Currency Information");
                builder.Color = Color.DarkPurple;
                AddAuthor(builder);

                StringBuilder descriptionBuilder = new StringBuilder();
                descriptionBuilder.AppendLine($"Market cap {globalInfo.MarketCap.AsUsdPrice()}");
                descriptionBuilder.AppendLine($"24 hour volume: {globalInfo.Volume.AsUsdPrice()}");
                descriptionBuilder.AppendLine($"BTC dominance: {globalInfo.BtcDominance.AsPercentage()}");
                descriptionBuilder.AppendLine($"Currencies: {globalInfo.Currencies}");
                descriptionBuilder.AppendLine($"Assets: {globalInfo.Assets}");
                descriptionBuilder.AppendLine($"Markets: {globalInfo.Markets}");
                builder.WithDescription(descriptionBuilder.ToString());

                AddFooter(builder, globalInfo.LastUpdated);

                await this.ReplyAsync(string.Empty, false, builder.Build());
            }
        }
Exemplo n.º 4
0
        public MainWindow(IGlobalInfo globalInfo, IReadOnlyCollection <SiteInstance> websiteInstances)
        {
            InitializeComponent();

            _globalInfo = globalInfo;

            _primaryInstanceProgressBar = new ProgressBarWrapper(ProgressBar_Common, Dispatcher);

            FillListbox(websiteInstances);
        }
        public SiteInstance(WebsiteNodeData nodeData, IGlobalInfo globalInfo)
        {
            _globalInfo = globalInfo;

            DisplayableName     = nodeData.DisplayableName;
            DeployDirectoryPath = nodeData.DeployDirectoryPath;
            WebsiteRootPath     = nodeData.WebsiteRootPath;

            _websiteUrls = nodeData.WebsiteUrls;

            DirectoryHelper = new DirectoryHelper(_globalInfo.SpecificContentFolderNames());

            _iisServer = new IisServer(nodeData.ServerMachineName);
        }
Exemplo n.º 6
0
        private Task UpdateGlobalInfo()
        {
            ICoinClient client = this._coinClients.First();

            //this._lock.EnterWriteLock();
            try
            {
                this._globalInfo = client.GetGlobalInfo().Result;
                return(Task.CompletedTask);
            }
            finally
            {
                //this._lock.ExitWriteLock();
            }
        }
Exemplo n.º 7
0
 public ABQMailHelper(IGlobalInfo globalInfo, IAirSyncContext context, IOrganizationSettingsData organizationSettings)
 {
     if (globalInfo == null)
     {
         throw new ArgumentNullException("globalInfo");
     }
     if (context == null)
     {
         throw new ArgumentNullException("context");
     }
     if (organizationSettings == null)
     {
         throw new ArgumentNullException("organizationSettings");
     }
     this.globalInfo           = globalInfo;
     this.context              = context;
     this.organizationSettings = organizationSettings;
 }
Exemplo n.º 8
0
        /// <summary>
        /// Метод, указанный как точка входа в приложение в файле App.xaml в поле Application.Startup
        /// </summary>
        private void Application_Startup(object sender, StartupEventArgs e)
        {
            _globalInfo = new WebsiteReleaseGlobalInfo();

            IReadOnlyCollection <SiteInstance> nodes = TryGetWebsiteNodes();

            if (nodes != null)
            {
                SetCallbacks();

                // Create the startup window
                var wnd = new MainWindow(_globalInfo, nodes);
                wnd.Show();
            }
            else
            {
                Shutdown();
            }
        }