Esempio n. 1
0
        public IEnumerable <PostModel> GetAll(Languages?lang = null, int totalPost = 1,
                                              bool home      = false, bool?active  = null, bool publishDate = false)
        {
            var query = _postRepo.TableNoTracking;

            if (lang != null)
            {
                query = query.Where(x => x.Lang == lang.Value);
            }

            if (home)
            {
                query = query.Where(x => x.SetHomePage == home);
            }

            if (active != null)
            {
                query = query.Where(x => x.Active == active);
            }

            if (publishDate)
            {
                query = query.Where(x => x.PushlishDate <= CoreHelper.SystemTimeNowUTCTimeZoneLocal.DateTime);
            }

            query = query.OrderByDescending(x => x.PushlishDate).Take(totalPost);

            return(query.ProjectTo <PostModel>(_mapper.ConfigurationProvider).ToList());
        }
Esempio n. 2
0
 /// <summary>
 /// check if a language code is valid. abort if false
 /// </summary>
 /// <param name="languageCode"></param>
 void CheckCodeIsValid(Languages?languageCode)
 {
     if (languageCode == null)
     {
         throw new ArgumentNullException($"language is not defined: {languageCode}");
     }
 }
        private static string GetUserDictionaryPath(Languages?language)
        {
            var applicationDataPath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), ApplicationDataSubPath);

            Directory.CreateDirectory(applicationDataPath); //Does nothing if already exists
            return(Path.Combine(applicationDataPath, string.Format("{0}{1}", language, DictionaryFileType)));
        }
Esempio n. 4
0
        public I18NString GetTextLink(int id, Languages?lang = null)
        {
            if (lang != null)
            {
                EnsureLanguageIsLoaded(lang.Value);
            }

            return(new I18NString(id, this));
        }
Esempio n. 5
0
        private I18nString GetTextLink(string id, Languages?lang = null)
        {
            if (lang != null)
            {
                EnsureLanguageIsLoaded(lang.Value);
            }

            return(new I18nString(id, this));
        }
Esempio n. 6
0
        public IEnumerable <CategoryBlogModel> GetAll(Languages?lang)
        {
            var query = _categoryBlogRepo.TableNoTracking;

            if (lang != null)
            {
                query = query.Where(x => x.Lang == lang.Value);
            }
            return(query.ProjectTo <CategoryBlogModel>(_mapper.ConfigurationProvider).ToList());
        }
Esempio n. 7
0
        public static void OnGuiSelectLang()
        {
            var lang = (M17N.Languages)EditorGUILayout.EnumPopup("lang", Lang);

            if (lang != Lang)
            {
                m_lang = lang;
                EditorPrefs.SetString(LANG_KEY, M17N.Getter.Lang.ToString());
            }
        }
Esempio n. 8
0
        public PagedResult <PostModel> GetPagedAll(int page = 1, int pageSize = 20, string filter = "",
                                                   DateTimeOffset?fromDate = null, DateTimeOffset?toDate = null, bool publishDate = false,
                                                   Languages?lang          = null, string cat = "", bool include = false)
        {
            var query = _postRepo.TableNoTracking;

            if (lang != null)
            {
                query = query.Where(x => x.Lang == lang.Value);
            }

            if (!string.IsNullOrWhiteSpace(filter))
            {
                query = query.Where(x => x.Name.Contains(filter));
            }

            if (fromDate != null)
            {
                query = query.Where(x => x.PushlishDate >= fromDate.Value);
            }

            if (toDate != null)
            {
                query = query.Where(x => x.PushlishDate <= toDate.Value);
            }

            if (publishDate)
            {
                query = query.Where(x => x.PushlishDate.Value.DateTime <= CoreHelper.SystemTimeNowUTCTimeZoneLocal.DateTime);
            }

            if (!string.IsNullOrWhiteSpace(cat))
            {
                query = query.Where(x => x.CategoryBlog.Slug == cat);
            }

            if (include)
            {
                query = query.Include(x => x.CategoryBlog);
            }
            var rowCount = query.Count();

            query = query.OrderByDescending(x => x.PushlishDate)
                    .Skip((page - 1) * pageSize).Take(pageSize);

            var paginationSet = new PagedResult <PostModel>()
            {
                Results     = query.ProjectTo <PostModel>(_mapper.ConfigurationProvider).ToList(),
                CurrentPage = page,
                RowCount    = rowCount,
                PageSize    = pageSize
            };

            return(paginationSet);
        }
Esempio n. 9
0
        public IEnumerable <SearchPageModel> GetAll(string filter, Languages?lang)
        {
            var query = _searchPageRepo.TableNoTracking.Where(x => x.Lang == lang.Value);

            if (!string.IsNullOrWhiteSpace(filter))
            {
                query = query.Where(x => x.Name.Contains(filter));
            }

            return(query.ProjectTo <SearchPageModel>(_mapper.ConfigurationProvider).ToList());
        }
Esempio n. 10
0
 public Dictionary<string, string> GetAllUITextWith(string name, Languages? lang = null)
 {
     EnsureLanguageIsLoaded(DefaultLanguage);
     var test = new Dictionary<string, string>();
     foreach (var item in readers[DefaultLanguage].GetAllUiText())
     {
         if (item.Value.ToLower().Contains(name.ToLower()))
             test.Add(item.Key, item.Value);
     }
     return test;
 }
Esempio n. 11
0
        public string ReadText(string id, Languages?lang = null)
        {
            if (lang != null)
            {
                EnsureLanguageIsLoaded(lang.Value);
                return(readers[lang.Value].GetText(id));
            }

            EnsureLanguageIsLoaded(DefaultLanguage);
            return(readers[DefaultLanguage].GetText(id));
        }
Esempio n. 12
0
        public Dictionary<int, string> GetAllText(Languages? lang = null)
        {
            if (lang != null)
            {
                EnsureLanguageIsLoaded(lang.Value);
                return readers[lang.Value].GetAllText();
            }

            EnsureLanguageIsLoaded(DefaultLanguage);
            return readers[DefaultLanguage].GetAllText();
        }
Esempio n. 13
0
        public void SetText(int id, string text, Languages? lang = null)
        {
            if (lang != null)
            {
                EnsureLanguageIsLoaded(lang.Value);
                readers[lang.Value].SetText(id, text);
            }

            EnsureLanguageIsLoaded(DefaultLanguage);
            readers[DefaultLanguage].SetText(id, text);
        }
Esempio n. 14
0
        public void Save(Languages? lang = null)
        {
            if (lang != null)
            {
                EnsureLanguageIsLoaded(lang.Value);
                readers[lang.Value].Save();
            }

            EnsureLanguageIsLoaded(DefaultLanguage);
            readers[DefaultLanguage].Save();
        }
Esempio n. 15
0
        public void RemoveText(int id, Languages? lang = null)
        {
            if (lang != null)
            {
                EnsureLanguageIsLoaded(lang.Value);
                readers[lang.Value].RemoveText(id);
            }

            EnsureLanguageIsLoaded(DefaultLanguage);
            readers[DefaultLanguage].RemoveText(id);
        }
        public IEnumerable<GroupQuestionModel> GetAll(Languages? lang, bool allowInclude = false)
        {
            var query = _groupQuestionRepo.TableNoTracking;

            if (lang != null)
                query = query.Where(x => x.Lang == lang.Value);

            if (allowInclude)
                query = query.Include(x => x.Question);

            return query.ProjectTo<GroupQuestionModel>(_mapper.ConfigurationProvider).ToList();
        }
Esempio n. 17
0
        public int AddVideo(string Title, VideoStatus Status, string Object, string Description, int?CategoryId,
                            int?CreatorId, string Image, bool?AutoResize, Languages?lan)
        {
            int videoID = AddVideo(Title, Status, Object, Description, CategoryId,
                                   CreatorId, null, AutoResize, lan, null);


            WebClient webClient = new WebClient();
            string    ImageName = Path.GetFileNameWithoutExtension(Image);

            ImageName = string.Format("{0}_{1}{2}", ImageName, videoID, Path.GetExtension(Image));


            string path = WebContext.Server.MapPath("~/" + Folders.VideoThumbsFolder);

            if (!Directory.Exists(path))
            {
                Directory.CreateDirectory(path);
            }

            path = Path.Combine(path, ImageName);

            webClient.DownloadFile(Image, path);

            if (AutoResize != null && AutoResize.Value == true)
            {
                VideoCategory cat = GetVideoCategory(CategoryId.Value);
                if (cat.ThumbWidth > 0 && cat.ThumbHeight > 0)
                {
                    //ImageUtils.Resize(path, path, (int)cat.ThumbWidth, (int)cat.ThumbHeight);
                    ImageUtils.CropImage(path, path, (int)cat.ThumbWidth, (int)cat.ThumbHeight, ImageUtils.AnchorPosition.Default);
                }
                else
                {
                    Config    cfg = new Config();
                    Dimension dim = new Dimension(cfg.GetKey(lw.CTE.parameters.VideoThumbSize));

                    if (dim.Width > 0 && dim.Height > 0)
                    {
                        ImageUtils.CropImage(path, path, (int)dim.Width, (int)dim.Height, ImageUtils.AnchorPosition.Default);
                    }
                }
            }
            Video thisVideo = this.GetVideo(videoID);

            thisVideo.ThumbImage = ImageName;

            MediaData.SubmitChanges();
            return(videoID);
        }
        private void setLanguageExecuted(object sender, ExecutedRoutedEventArgs e)
        {
            App       app = Application.Current as App;
            Languages?lan = e.Parameter as Languages?;

            if (lan.HasValue)
            {
                if (app.Language != lan.Value)
                {
                    app.ApplyLanguage(lan.Value);
                    app.Language = lan.Value;
                }
            }
        }
Esempio n. 19
0
        public IEnumerable <PageContentModel> GetAll(bool?home = null, Languages?lang = null)
        {
            var query = _pageContentRepo.TableNoTracking;

            if (home != null)
            {
                query = query.Where(x => x.Home == home.Value);
            }

            if (lang != null)
            {
                query = query.Where(x => x.Lang == lang);
            }

            return(query.ProjectTo <PageContentModel>(_mapper.ConfigurationProvider).ToList());
        }
Esempio n. 20
0
        public static bool GetLanguages(string stringRaw, out Languages?Source, out Languages?Target, out string Message)
        {
            stringRaw = stringRaw.ToLower().Trim();
            var parts   = stringRaw.Split(" ");
            var partsin = parts[0].Split("-");

            string src, trg;

            if (partsin.Length > 1)
            {
                src = partsin[0];
                trg = partsin[1];
            }
            else
            {
                src = null;
                trg = partsin[0];
            }

            Message = "";
            object Src;
            object Trg;

            Enum.TryParse(typeof(Languages), src, out Src);
            Enum.TryParse(typeof(Languages), trg, out Trg);

            if (Trg != null)
            {
                Source = (Languages?)Src;
                Target = (Languages)Trg;

                parts[0] = "";
                Message  = string.Join(" ", parts);
                return(true);
            }
            else
            {
                Source = null;
                Target = null;
                return(false);
            }
        }
Esempio n. 21
0
        /// <summary>
        /// Create a new token describing the charging session and its costs,
        /// how these costs are composed, etc.
        /// </summary>
        public Token(CountryCode CountryCode,
                     Party_Id PartyId,
                     Token_Id Id,
                     TokenTypes Type,
                     Contract_Id ContractId,
                     String Issuer,
                     Boolean IsValid,
                     WhitelistTypes WhitelistType,

                     String VisualNumber           = null,
                     Group_Id?GroupId              = null,
                     Languages?UILanguage          = null,
                     ProfileTypes?DefaultProfile   = null,
                     EnergyContract?EnergyContract = null,

                     DateTime?LastUpdated = null)

        {
            if (Issuer.IsNullOrEmpty())
            {
                throw new ArgumentNullException(nameof(Issuer), "The given issuer must not be null or empty!");
            }

            this.CountryCode   = CountryCode;
            this.PartyId       = PartyId;
            this.Id            = Id;
            this.Type          = Type;
            this.ContractId    = ContractId;
            this.Issuer        = Issuer;
            this.IsValid       = IsValid;
            this.WhitelistType = WhitelistType;

            this.VisualNumber   = VisualNumber;
            this.GroupId        = GroupId;
            this.UILanguage     = UILanguage;
            this.DefaultProfile = DefaultProfile;
            this.EnergyContract = EnergyContract;

            this.LastUpdated = LastUpdated ?? DateTime.Now;

            CalcSHA256Hash();
        }
Esempio n. 22
0
        public IEnumerable <CatalogSectorModel> GetAll(Languages?lang, bool active = false, bool getProduct = false)
        {
            var query = _catalogSectorRepo.TableNoTracking;

            if (active)
            {
                query = query.Where(x => x.Active == active);
            }

            if (lang != null)
            {
                query = query.Where(x => x.Lang == lang.Value);
            }
            if (getProduct)
            {
                query = query.Include(x => x.Product).Where(x => x.Product.Any(p => p.New == true));
            }

            return(query.ProjectTo <CatalogSectorModel>(_mapper.ConfigurationProvider).ToList());
        }
Esempio n. 23
0
        public static string?Localize(NamespaceKey?unlocalized, Languages?code = null)
        {
            if (unlocalized == null)
            {
                return(null);
            }
            if (!localizations.ContainsKey(code ?? fallback))
            {
                return(null);
            }

            var lang = localizations[code ?? fallback];

            if (!lang.ContainsKey(unlocalized))
            {
                return(null);
            }

            var localized = lang[unlocalized];

            return(localized);
        }
Esempio n. 24
0
        /// <summary>
        /// Create an instance of the Open Charging Cloud API.
        /// </summary>
        /// <param name="ServiceName">The name of the service.</param>
        /// <param name="HTTPServerName">The default HTTP servername, used whenever no HTTP Host-header had been given.</param>
        /// <param name="LocalHostname">The HTTP hostname for all URIs within this API.</param>
        /// <param name="LocalPort">A TCP port to listen on.</param>
        /// <param name="ExternalDNSName">The offical URL/DNS name of this service, e.g. for sending e-mails.</param>
        /// <param name="URLPathPrefix">A common prefix for all URLs.</param>
        ///
        /// <param name="ServerCertificateSelector">An optional delegate to select a SSL/TLS server certificate.</param>
        /// <param name="ClientCertificateValidator">An optional delegate to verify the SSL/TLS client certificate used for authentication.</param>
        /// <param name="ClientCertificateSelector">An optional delegate to select the SSL/TLS client certificate used for authentication.</param>
        /// <param name="AllowedTLSProtocols">The SSL/TLS protocol(s) allowed for this connection.</param>
        ///
        /// <param name="APIEMailAddress">An e-mail address for this API.</param>
        /// <param name="APIPassphrase">A GPG passphrase for this API.</param>
        /// <param name="APIAdminEMails">A list of admin e-mail addresses.</param>
        /// <param name="APISMTPClient">A SMTP client for sending e-mails.</param>
        ///
        /// <param name="SMSAPICredentials">The credentials for the SMS API.</param>
        /// <param name="SMSSenderName">The (default) SMS sender name.</param>
        /// <param name="APIAdminSMS">A list of admin SMS phonenumbers.</param>
        ///
        /// <param name="TelegramBotToken">The Telegram API access token of the bot.</param>
        ///
        /// <param name="CookieName">The name of the HTTP Cookie for authentication.</param>
        /// <param name="UseSecureCookies">Force the web browser to send cookies only via HTTPS.</param>
        /// <param name="Language">The main language of the API.</param>
        /// <param name="NewUserSignUpEMailCreator">A delegate for sending a sign-up e-mail to a new user.</param>
        /// <param name="NewUserWelcomeEMailCreator">A delegate for sending a welcome e-mail to a new user.</param>
        /// <param name="ResetPasswordEMailCreator">A delegate for sending a reset password e-mail to a user.</param>
        /// <param name="PasswordChangedEMailCreator">A delegate for sending a password changed e-mail to a user.</param>
        /// <param name="MinUserNameLength">The minimal user name length.</param>
        /// <param name="MinRealmLength">The minimal realm length.</param>
        /// <param name="PasswordQualityCheck">A delegate to ensure a minimal password quality.</param>
        /// <param name="SignInSessionLifetime">The sign-in session lifetime.</param>
        ///
        /// <param name="ServerThreadName">The optional name of the TCP server thread.</param>
        /// <param name="ServerThreadPriority">The optional priority of the TCP server thread.</param>
        /// <param name="ServerThreadIsBackground">Whether the TCP server thread is a background thread or not.</param>
        /// <param name="ConnectionIdBuilder">An optional delegate to build a connection identification based on IP socket information.</param>
        /// <param name="ConnectionThreadsNameBuilder">An optional delegate to set the name of the TCP connection threads.</param>
        /// <param name="ConnectionThreadsPriorityBuilder">An optional delegate to set the priority of the TCP connection threads.</param>
        /// <param name="ConnectionThreadsAreBackground">Whether the TCP connection threads are background threads or not (default: yes).</param>
        /// <param name="ConnectionTimeout">The TCP client timeout for all incoming client connections in seconds (default: 30 sec).</param>
        /// <param name="MaxClientConnections">The maximum number of concurrent TCP client connections (default: 4096).</param>
        ///
        /// <param name="SkipURLTemplates">Skip URI templates.</param>
        /// <param name="DisableNotifications">Disable external notifications.</param>
        /// <param name="DisableLogfile">Disable the log file.</param>
        /// <param name="LoggingPath">The path for all logfiles.</param>
        /// <param name="LogfileName">The name of the logfile for this API.</param>
        /// <param name="DNSClient">The DNS client of the API.</param>
        /// <param name="Autostart">Whether to start the API automatically.</param>
        public OpenChargingCloudCSOAPI(String ServiceName         = "GraphDefined Open Charging Cloud CSO API",
                                       String HTTPServerName      = "GraphDefined Open Charging Cloud CSO API",
                                       HTTPHostname?LocalHostname = null,
                                       IPPort?LocalPort           = null,
                                       String ExternalDNSName     = null,
                                       HTTPPath?URLPathPrefix     = null,
                                       String HTMLTemplate        = null,
                                       JObject APIVersionHashes   = null,

                                       ServerCertificateSelectorDelegate ServerCertificateSelector    = null,
                                       RemoteCertificateValidationCallback ClientCertificateValidator = null,
                                       LocalCertificateSelectionCallback ClientCertificateSelector    = null,
                                       SslProtocols AllowedTLSProtocols = SslProtocols.Tls12,

                                       EMailAddress APIEMailAddress    = null,
                                       String APIPassphrase            = null,
                                       EMailAddressList APIAdminEMails = null,
                                       SMTPClient APISMTPClient        = null,

                                       Credentials SMSAPICredentials         = null,
                                       String SMSSenderName                  = null,
                                       IEnumerable <PhoneNumber> APIAdminSMS = null,

                                       String TelegramBotToken = null,

                                       HTTPCookieName?CookieName = null,
                                       Boolean UseSecureCookies  = true,
                                       Languages?Language        = null,
                                       NewUserSignUpEMailCreatorDelegate NewUserSignUpEMailCreator     = null,
                                       NewUserWelcomeEMailCreatorDelegate NewUserWelcomeEMailCreator   = null,
                                       ResetPasswordEMailCreatorDelegate ResetPasswordEMailCreator     = null,
                                       PasswordChangedEMailCreatorDelegate PasswordChangedEMailCreator = null,
                                       Byte?MinLoginLength    = null,
                                       Byte?MinRealmLength    = null,
                                       Byte?MinUserNameLength = null,
                                       PasswordQualityCheckDelegate PasswordQualityCheck = null,
                                       TimeSpan?SignInSessionLifetime = null,

                                       String ServerThreadName                 = null,
                                       ThreadPriority ServerThreadPriority     = ThreadPriority.AboveNormal,
                                       Boolean ServerThreadIsBackground        = true,
                                       ConnectionIdBuilder ConnectionIdBuilder = null,
                                       ConnectionThreadsNameBuilder ConnectionThreadsNameBuilder         = null,
                                       ConnectionThreadsPriorityBuilder ConnectionThreadsPriorityBuilder = null,
                                       Boolean ConnectionThreadsAreBackground = true,
                                       TimeSpan?ConnectionTimeout             = null,
                                       UInt32 MaxClientConnections            = TCPServer.__DefaultMaxClientConnections,

                                       TimeSpan?MaintenanceEvery       = null,
                                       Boolean DisableMaintenanceTasks = false,

                                       Boolean SkipURLTemplates     = false,
                                       Boolean DisableNotifications = false,
                                       Boolean DisableLogfile       = false,
                                       String DatabaseFile          = DefaultOpenChargingCloudAPIDatabaseFile,
                                       String LoggingPath           = null,
                                       String LogfileName           = DefaultOpenChargingCloudAPILogFile,
                                       DNSClient DNSClient          = null,
                                       Boolean Autostart            = false)

            : base(ServiceName ?? "GraphDefined Open Charging Cloud CSO API",
                   HTTPServerName ?? "GraphDefined Open Charging Cloud CSO API",
                   LocalHostname,
                   LocalPort,
                   ExternalDNSName,
                   URLPathPrefix,
                   HTMLTemplate,
                   APIVersionHashes,

                   ServerCertificateSelector,
                   ClientCertificateValidator,
                   ClientCertificateSelector,
                   AllowedTLSProtocols,

                   APIEMailAddress,
                   APIPassphrase,
                   APIAdminEMails,
                   APISMTPClient,

                   SMSAPICredentials,
                   SMSSenderName ?? "Open Charging Cloud",
                   APIAdminSMS,

                   TelegramBotToken,

                   CookieName ?? HTTPCookieName.Parse("OpenChargingCloudCSOAPI"),
                   UseSecureCookies,
                   Language,
                   NewUserSignUpEMailCreator,
                   NewUserWelcomeEMailCreator,
                   ResetPasswordEMailCreator,
                   PasswordChangedEMailCreator,
                   MinLoginLength,
                   MinRealmLength,
                   MinUserNameLength,
                   PasswordQualityCheck,
                   SignInSessionLifetime,

                   ServerThreadName,
                   ServerThreadPriority,
                   ServerThreadIsBackground,
                   ConnectionIdBuilder,
                   ConnectionThreadsNameBuilder,
                   ConnectionThreadsPriorityBuilder,
                   ConnectionThreadsAreBackground,
                   ConnectionTimeout,
                   MaxClientConnections,

                   MaintenanceEvery,
                   DisableMaintenanceTasks,

                   SkipURLTemplates,
                   DisableNotifications,
                   DisableLogfile,
                   DatabaseFile ?? DefaultOpenChargingCloudCSOAPIDatabaseFile,
                   LoggingPath ?? "default",
                   LogfileName ?? DefaultOpenChargingCloudCSOAPILogFile,
                   DNSClient,
                   false)

        {
            //RegisterURLTemplates();

            if (Autostart)
            {
                Start();
            }
        }
Esempio n. 25
0
 /// <summary>
 /// Get localized string.
 /// </summary>
 /// <param name="resourceId">Resource unique key.</param>
 /// <param name="language">Language.</param>
 /// <returns>Localized string.</returns>
 public static string GetString(string resourceId, Languages?language = null)
 {
     return(LocalizationHelper.DefaultManager.GetString(resourceId, language));
 }
Esempio n. 26
0
 /// <summary>
 /// Get localized string.
 /// </summary>
 /// <param name="resourceId">Resource unique key.</param>
 /// <param name="language">Language.</param>
 /// <returns>Localized string.</returns>
 public static string GetString(string resourceId, Languages?language = null)
 {
     return(Manager.GetString(resourceId, language));
 }
Esempio n. 27
0
        public async Task <ArticlesResult> GetHeadlinesBySourcesAsync(List <string> sources, string topic, Languages?language)
        {
            var request = new TopHeadlinesRequest();

            request.Sources  = sources;
            request.Language = language;
            if (!string.IsNullOrEmpty(topic) && !string.IsNullOrWhiteSpace(topic))
            {
                request.Q = topic;
            }
            var response = await newsApiClient.GetTopHeadlinesAsync(request);

            return(response);
        }
Esempio n. 28
0
        public async Task <ArticlesResult> GetHeadlinesByCountryOrCategoryAsync(Countries?country, Categories?category, string topic, Languages?language)
        {
            var request = new TopHeadlinesRequest();

            request.Country  = country;
            request.Category = category;
            request.Language = language;
            if (!string.IsNullOrEmpty(topic) && !string.IsNullOrWhiteSpace(topic))
            {
                request.Q = topic;
            }
            var response = await newsApiClient.GetTopHeadlinesAsync(request);

            return(response);
        }
Esempio n. 29
0
        public async Task <ArticlesResult> GetNewsByTopicAsync(string topic, List <string> domains, List <string> sources, DateTime?from, DateTime?to, Languages?language)
        {
            var request = new EverythingRequest();

            if (!string.IsNullOrEmpty(topic) && !string.IsNullOrWhiteSpace(topic))
            {
                request.Q = topic;
            }
            if (domains != null)
            {
                request.Domains = domains;
            }
            if (sources != null)
            {
                request.Sources = sources;
            }
            request.From     = from;
            request.To       = to;
            request.Language = language;
            request.SortBy   = SortBys.Relevancy;

            return(await newsApiClient.GetEverythingAsync(request));
        }
 private static string GetUserDictionaryPath(Languages?language)
 {
     return(GetUserDictionaryPath(string.Format("{0}{1}", language, DictionaryFileType)));
 }