AddDocument() публичный Метод

public AddDocument ( Document doc ) : void
doc Document
Результат void
        static void Main()
        {
            var dm = new DocumentManager();

            ProcessDocuments.StartAsync(dm);

            // Create documents and add them to the DocumentManager
            for (int i = 0; i < 1000; i++)
            {
                Document doc = new Document("Doc " + i.ToString(), "content");
                dm.AddDocument(doc);
                WriteLine("Added document {0}", doc.Title);
                Task.Delay(new Random().Next(20)).Wait();
            }

            ReadLine();
        }
Пример #2
0
        static void Main()
        {
            var dm = new DocumentManager();

            ProcessDocuments.StartAsync(dm);

            // Create documents and add them to the DocumentManager
            for (int i = 0; i < 1000; i++)
            {
                Document doc = new Document($"Doc {i}", "content");
                dm.AddDocument(doc);
                Console.WriteLine($"Added document {doc.Title}");
                Task.Delay(new Random().Next(20)).Wait();
            }

            Console.ReadLine();
        }
Пример #3
0
        static async Task Main()
        {
            var documentManager = new DocumentManager();

            Task processDocuments = ProcessDocuments.Start(documentManager);

            for (int i = 0; i < 100; i++)
            {
                var doc = new Document($"Doc {i}", "content");
                documentManager.AddDocument(doc);
                Console.WriteLine($"Added document {doc.Title}");
                await Task.Delay(new Random().Next(20));
            }

            await processDocuments;

            Console.ReadLine();
        }
    static void Main()
    {
      var dm = new DocumentManager();

      ProcessDocuments.StartAsync(dm);

      // Create documents and add them to the DocumentManager
      for (int i = 0; i < 1000; i++)
      {
        Document doc = new Document("Doc " + i.ToString(), "content");
        dm.AddDocument(doc);
        WriteLine("Added document {0}", doc.Title);
        Task.Delay(new Random().Next(20)).Wait();

      }

      ReadLine();

    }