示例#1
0
 public override string ToString()
 {
     if (SourceType == SourceType.WebSite)
     {
         var result = new StringBuilder();
         result.Append(Site).Append(" ").Append(ElectronicSourceText);
         if (PublisherCity != null || PublisherYear != null)
         {
             result.Append(". – ");
             if (PublisherCity != null)
             {
                 result.Append(PublisherCity);
                 if (PublisherYear != null)
                 {
                     result.Append(", ");
                 }
             }
             if (PublisherYear != null)
             {
                 result.Append(PublisherYear);
             }
         }
         result.Append(". – ").Append(ModeOfAccess);
         result.Append(". – ").Append(DateOfAccess);
         result.Append(".");
         return(result.ToString());
     }
     else
     {
         var result = new StringBuilder();
         if (Authors1.Any())
         {
             result.Append(Authors1.First().ToString("r")).Append(" ");
         }
         result.Append(Title);
         if (Authors2.Any())
         {
             result.Append(" / ").Append(string.Join(", ", Authors2));
         }
         result.Append(" // ").Append(Site).Append(" ").Append(ElectronicSourceText);
         if (PublisherYear != null)
         {
             result.Append(". – ").Append(PublisherYear);
         }
         if (No != null)
         {
             result.Append(". – ").Append(No);
         }
         result.Append(". – ").Append(ModeOfAccess);
         result.Append(". – ").Append(DateOfAccess);
         result.Append(".");
         return(result.ToString());
     }
 }
示例#2
0
            public override string ToString()
            {
                var result = new StringBuilder();

                if (Authors1.Any())
                {
                    result.Append(Authors1.First().ToString("r")).Append(" ");
                }
                result.Append(Title).Append(" / ");
                result.Append(string.Join(", ", Authors2));
                if (HasOtherAuthors)
                {
                    result.Append(Lang == "by" ? " [і інш.]" : " [и др.]");                  // TODO.
                }
                if (Collectivity != null)
                {
                    result.Append(Collectivity);
                }

                if (Editor != null)
                {
                    if (Collectivity != null || Authors2.Any())
                    {
                        result.Append(" ; ");
                    }

                    result.Append(EditorText).Append(" ").Append(Editor);
                    if (EditorTitle != null)
                    {
                        result.Append(" (").Append(EditorTitle).Append(")");
                    }
                    if (HasOtherEditors)
                    {
                        result.Append(Lang == "by"? " [і інш.]" : " [и др.]");
                    }
                }
                if (Edition != null)
                {
                    result.Append(". – ").Append(Edition).Append("-е ").Append(Lang == "by"? "выд." : "изд.");
                }
                result.Append(". – ").Append(PublisherCity).Append(" : ").Append(PublisherName).Append(", ").Append(PublisherYear);
                if (PublisherYearEnd != null)
                {
                    result.Append("–").Append(PublisherYearEnd);
                }

                if (Pages != null)
                {
                    result.Append(". – ").Append(Pages).Append(" с.");
                }
                return(result.Replace("..", ".").ToString());
            }