// 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(",", "") + "\"")));
 }
Esempio n. 2
0
        public override string ToString()
        {
            return($"Book Name: {Name}, Book Author {Author}, Book Category {Category}, Book Language {Language}," +
                   $"Book Publication Date {PublicationDate.ToString("dd.MM.yyyy")}, Book ISBN {Isbn}, Is Book Taken: {Taken}");

            ;
        }
Esempio n. 3
0
        public string GetPortalDate()
        {
            var    culture     = new System.Globalization.CultureInfo("uk-UA");
            string dateDoW     = culture.DateTimeFormat.GetDayName(PublicationDate.DayOfWeek);
            string dateDoWNorm = dateDoW.ToUpper().First() + dateDoW.Substring(1, dateDoW.Length - 1);

            return(dateDoWNorm + ", " + PublicationDate.ToString("dd.MM.yyyy"));
        }
Esempio n. 4
0
 public string GetPublicationDateByFormat(string format = "MM d, yyyy")
 {
     return(PublicationDate?.ToString(format) ?? string.Empty);
 }
Esempio n. 5
0
        /// <summary>
        /// Create Xml node from this instance of AppCastItem
        /// </summary>
        /// <returns>An XML node</returns>
        public XElement GetXElement()
        {
            var item = new XElement(_itemNode);

            item.Add(new XElement(_titleNode)
            {
                Value = Title
            });

            if (!string.IsNullOrEmpty(ReleaseNotesLink))
            {
                var releaseNotes = new XElement(XMLAppCast.SparkleNamespace + _releaseNotesLinkNode)
                {
                    Value = ReleaseNotesLink
                };
                if (!string.IsNullOrEmpty(ReleaseNotesSignature))
                {
                    releaseNotes.Add(new XAttribute(XMLAppCast.SparkleNamespace + _signatureAttribute, ReleaseNotesSignature));
                }
                item.Add(releaseNotes);
            }

            if (!string.IsNullOrEmpty(Description))
            {
                item.Add(new XElement(_descriptionNode)
                {
                    Value = Description
                });
            }

            if (PublicationDate != DateTime.MinValue && PublicationDate != DateTime.MaxValue)
            {
                item.Add(new XElement(_pubDateNode)
                {
                    Value = PublicationDate.ToString("ddd, dd MMM yyyy HH:mm:ss zzz", System.Globalization.CultureInfo.InvariantCulture)
                });
            }

            if (!string.IsNullOrEmpty(DownloadLink))
            {
                var enclosure = new XElement(_enclosureNode);
                enclosure.Add(new XAttribute(_urlAttribute, DownloadLink));
                enclosure.Add(new XAttribute(XMLAppCast.SparkleNamespace + _versionAttribute, Version));

                if (!string.IsNullOrEmpty(ShortVersion))
                {
                    enclosure.Add(new XAttribute(XMLAppCast.SparkleNamespace + _shortVersionAttribute, ShortVersion));
                }

                enclosure.Add(new XAttribute(_lengthAttribute, UpdateSize));
                enclosure.Add(new XAttribute(XMLAppCast.SparkleNamespace + _operatingSystemAttribute, OperatingSystemString ?? _defaultOperatingSystem));
                enclosure.Add(new XAttribute(_typeAttribute, MIMEType ?? _defaultType));

                if (!string.IsNullOrEmpty(DownloadSignature))
                {
                    enclosure.Add(new XAttribute(XMLAppCast.SparkleNamespace + _signatureAttribute, DownloadSignature));
                }
                item.Add(enclosure);
            }
            return(item);
        }
Esempio n. 6
0
 public override string ToString()
 {
     if (Name != null && Author != null && Category != null && Language != null && PublicationDate != null && Isbn != null)
     {
         return(String.Format("{0,-14} | {1,-42} | {2,-20} | {3,-20} | {4,-3} | {5,-15}", Isbn, Name, Author, Category, Language, PublicationDate.ToString("dd/MM/yyyy")));
     }
     return(base.ToString());
 }