Untitled

 avatar
unknown
csharp
a year ago
3.2 kB
19
Indexable
public class Program
{
    // - Документ -
    // Автор
    // Дата создания
    // Дата изменения
    // Заголовок
    // Содержимое

    // - Глава -
    // Название
    // Документы

    ///
    // Документация
    // 1. Введение
    // 2. Как начать
    // 3. Расширение
    // 
    // Номер: 2
    //
    // 1. Инструкция по установке
    // 2. Требования
    // 3. Возможные проблемы
    //
    // Номер: 3
    //
    // Author: Alemkhan
    // Created Date: {CreatedDate}
    // Updated Date: {UpdatedDate}

    // Title: Возможные проблемы
    // Content:
    //  Тут будет все возможные проблемы при установке

    public static void Main(string[] args)
    {
        Chapter[] testChapters = new Chapter[]
        {
            new Chapter("Введение", new Document[]
            {
                new Document("Alemkhan", "Информация о документации", "Тут будет информация о документации"),
                new Document("Alemkhan", "Об авторе", "Тут информация про Автора")
            }),
            new Chapter("Как начать", new Document[]
            {
                new Document("Alemkhan", "Инструкция по установке", "Тут всё про установку"),
                new Document("Alemkhan", "Требования", "Тут требования для установки"),
                new Document("Alemkhan", "Возможные проблемы", "Тут будет все возможные проблемы при установке")
            }),
            new Chapter("Расширение", new Document[]
            {
                new Document("Alemkhan", "Как пользоваться расширением", "Тут будет инструкция по расширению")
            })
        };

        // Реализация
    }
}

class Document
{
    public string Author;
    public DateTime CreatedDate;
    public DateTime UpdatedDate;
    public string Title;
    public string Content;

    public Document(string author, string title, string content)
    {
        Author = author;
        Title = title;
        Content = content;
        CreatedDate = DateTime.Now;
        UpdatedDate = CreatedDate;
    }

    public void Print()
    {
        Console.WriteLine($"Author: {Author}");
        Console.WriteLine($"Created Date: {CreatedDate}");
        Console.WriteLine($"Updated Date: {UpdatedDate}");
        Console.WriteLine();
        Console.WriteLine($"Title: {Title}");
        Console.WriteLine($"Content:\n\t{Content}");
    }
}

class Chapter
{
    public string Name;
    public Document[] Documents;

    public Chapter(string name, Document[] documents)
    {
        Name = name;
        Documents = documents;
    }
}
Editor is loading...
Leave a Comment