コード例 #1
0
 // Override of the ToString Method
 public string ToString()
 {
     // Serializing Object as CSV
     return(String.Join(",",
                        ("\"" + Url + "\""),
                        ("\"" + ReferenceDate.ToString("yyyy-MM-dd").Replace(",", "") + "\""),
                        ("\"" + Name.Replace(",", "") + "\" "),
                        ("\"" + Developer.Replace(",", "") + "\""),
                        ("\"" + IsTopDeveloper + "\""),
                        ("\"" + DeveloperURL.Replace(",", "") + "\""),
                        ("\"" + PublicationDate.ToString("yyyy-MM-dd").Replace(",", "") + "\""),
                        ("\"" + Category.Replace(",", "") + "\""),
                        ("\"" + IsFree + "\""),
                        ("\"" + Price + "\""),
                        ("\"" + Reviewers + "\""),
                        ("\"" + Score.Total + "\""),
                        ("\"" + Score.Count + "\""),
                        ("\"" + Score.FiveStars + "\""),
                        ("\"" + Score.FourStars + "\""),
                        ("\"" + Score.ThreeStars + "\""),
                        ("\"" + Score.TwoStars + "\""),
                        ("\"" + Score.OneStars + "\""),
                        ("\"" + LastUpdateDate.ToString("yyyy-MM-dd") + "\""),
                        //("\"" + AppSize                + "\""),
                        ("\"" + Instalations.Replace(",", ".") + "\""),
                        ("\"" + CurrentVersion.Replace(",", "") + "\""),
                        ("\"" + MinimumOSVersion.Replace(",", "") + "\""),
                        ("\"" + ContentRating.Replace(",", "") + "\""),
                        ("\"" + HaveInAppPurchases + "\""),
                        ("\"" + DeveloperEmail.Replace(",", "") + "\""),
                        ("\"" + DeveloperWebsite.Replace(",", "") + "\""),
                        ("\"" + DeveloperPrivacyPolicy.Replace(",", "") + "\""),
                        ("\"" + Description.Replace(",", "") + "\"")));
 }
コード例 #2
0
        public void FillMinAndMaxInstalls()
        {
            var splittedInstallations = Instalations.Split(new string[] { "-" }, StringSplitOptions.RemoveEmptyEntries);

            if (splittedInstallations.Length > 2)
            {
                throw new Exception("unexpected installations number");
            }

            if (splittedInstallations.Length == 0)
            {
                return;
            }

            var   minInstallsString = splittedInstallations[0].Trim().Replace(",", "");
            Int64 minInstalls;

            if (!Int64.TryParse(minInstallsString, out minInstalls))
            {
                throw new Exception("can't parse min installations number");
            }

            if (splittedInstallations.Length == 2)
            {
                var   maxInstallsString = splittedInstallations[1].Trim().Replace(",", "");
                Int64 maxInstalls;
                if (!Int64.TryParse(maxInstallsString, out maxInstalls))
                {
                    throw new Exception("can't parse max installations number");
                }

                MaxDownloads = maxInstalls;
            }
            else
            {
                MaxDownloads = minInstalls;
            }

            MinDownloads = minInstalls;
        }