<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="ru">
		<id>http://www.nfex.ru/index.php?action=history&amp;feed=atom&amp;title=Csharp%2FC_Sharp%2FGenerics%2FGeneric_Parameters</id>
		<title>Csharp/C Sharp/Generics/Generic Parameters - История изменений</title>
		<link rel="self" type="application/atom+xml" href="http://www.nfex.ru/index.php?action=history&amp;feed=atom&amp;title=Csharp%2FC_Sharp%2FGenerics%2FGeneric_Parameters"/>
		<link rel="alternate" type="text/html" href="http://www.nfex.ru/index.php?title=Csharp/C_Sharp/Generics/Generic_Parameters&amp;action=history"/>
		<updated>2026-04-16T14:51:21Z</updated>
		<subtitle>История изменений этой страницы в вики</subtitle>
		<generator>MediaWiki 1.30.0</generator>

	<entry>
		<id>http://www.nfex.ru/index.php?title=Csharp/C_Sharp/Generics/Generic_Parameters&amp;diff=1346&amp;oldid=prev</id>
		<title> в 15:31, 26 мая 2010</title>
		<link rel="alternate" type="text/html" href="http://www.nfex.ru/index.php?title=Csharp/C_Sharp/Generics/Generic_Parameters&amp;diff=1346&amp;oldid=prev"/>
				<updated>2010-05-26T15:31:19Z</updated>
		
		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left&quot; data-mw=&quot;interface&quot;&gt;
				&lt;tr style=&quot;vertical-align: top;&quot; lang=&quot;ru&quot;&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;← Предыдущая&lt;/td&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;Версия 15:31, 26 мая 2010&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; style=&quot;text-align: center;&quot; lang=&quot;ru&quot;&gt;&lt;div class=&quot;mw-diff-empty&quot;&gt;(нет различий)&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;</summary>
			</entry>

	<entry>
		<id>http://www.nfex.ru/index.php?title=Csharp/C_Sharp/Generics/Generic_Parameters&amp;diff=1347&amp;oldid=prev</id>
		<title>Admin: 1 версия</title>
		<link rel="alternate" type="text/html" href="http://www.nfex.ru/index.php?title=Csharp/C_Sharp/Generics/Generic_Parameters&amp;diff=1347&amp;oldid=prev"/>
				<updated>2010-05-26T11:45:44Z</updated>
		
		<summary type="html">&lt;p&gt;1 версия&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Новая страница&lt;/b&gt;&lt;/p&gt;&lt;div&gt;==Two Generic parameters==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
&amp;lt;source lang=&amp;quot;csharp&amp;quot;&amp;gt; &lt;br /&gt;
using System;&lt;br /&gt;
using System.Collections.Generic;&lt;br /&gt;
using System.Text;&lt;br /&gt;
using System.Threading;&lt;br /&gt;
public interface IDocument {&lt;br /&gt;
    string Title {&lt;br /&gt;
        get;&lt;br /&gt;
    }&lt;br /&gt;
    string Content {&lt;br /&gt;
        get;&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
public class Document : IDocument {&lt;br /&gt;
    private string title;&lt;br /&gt;
    public string Title {&lt;br /&gt;
        get {&lt;br /&gt;
            return title;&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    private string content;&lt;br /&gt;
    public string Content {&lt;br /&gt;
        get {&lt;br /&gt;
            return content;&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    public Document(string title, string content) {&lt;br /&gt;
        this.title = title;&lt;br /&gt;
        this.content = content;&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
public class ProcessDocuments&amp;lt;T, U&amp;gt;&lt;br /&gt;
    where T : IDocument&lt;br /&gt;
    where U : IDocumentManager&amp;lt;T&amp;gt; {&lt;br /&gt;
    public static void Start(U dm) {&lt;br /&gt;
        new Thread(new ThreadStart(new ProcessDocuments&amp;lt;T, U&amp;gt;(dm).Run)).Start();&lt;br /&gt;
    }&lt;br /&gt;
    protected ProcessDocuments(U dm) {&lt;br /&gt;
        documentManager = dm;&lt;br /&gt;
    }&lt;br /&gt;
    private U documentManager;&lt;br /&gt;
    protected void Run() {&lt;br /&gt;
        while (true) {&lt;br /&gt;
            if (documentManager.IsDocumentAvailable) {&lt;br /&gt;
                T doc = documentManager.GetDocument();&lt;br /&gt;
                Console.WriteLine(&amp;quot;Processing document {0}&amp;quot;, doc.Title);&lt;br /&gt;
            }&lt;br /&gt;
            Thread.Sleep(new Random().Next(20));&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
public interface IDocumentManager&amp;lt;T&amp;gt; {&lt;br /&gt;
    void AddDocument(T doc);&lt;br /&gt;
    T GetDocument();&lt;br /&gt;
    bool IsDocumentAvailable {&lt;br /&gt;
        get;&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
public class DocumentManager&amp;lt;T&amp;gt; : IDocumentManager&amp;lt;T&amp;gt; {&lt;br /&gt;
    private readonly Queue&amp;lt;T&amp;gt; documentQueue = new Queue&amp;lt;T&amp;gt;();&lt;br /&gt;
    public void AddDocument(T doc) {&lt;br /&gt;
        lock (this) {&lt;br /&gt;
            documentQueue.Enqueue(doc);&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    public T GetDocument() {&lt;br /&gt;
        T doc = default(T);&lt;br /&gt;
        lock (this) {&lt;br /&gt;
            doc = documentQueue.Dequeue();&lt;br /&gt;
        }&lt;br /&gt;
        return doc;&lt;br /&gt;
    }&lt;br /&gt;
    public bool IsDocumentAvailable {&lt;br /&gt;
        get {&lt;br /&gt;
            return (documentQueue.Count &amp;gt; 0) ? true : false;&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
class Program {&lt;br /&gt;
    static void Main(string[] args) {&lt;br /&gt;
        DocumentManager&amp;lt;Document&amp;gt; dm = new DocumentManager&amp;lt;Document&amp;gt;();&lt;br /&gt;
        ProcessDocuments&amp;lt;Document, DocumentManager&amp;lt;Document&amp;gt;&amp;gt;.Start(dm);&lt;br /&gt;
        for (int i = 0; i &amp;lt; 1000; i++) {&lt;br /&gt;
            Document doc = new Document(&amp;quot;Doc &amp;quot; + i.ToString(), &amp;quot;content&amp;quot;);&lt;br /&gt;
            dm.AddDocument(doc);&lt;br /&gt;
            Console.WriteLine(&amp;quot;added document {0}&amp;quot;, doc.Title);&lt;br /&gt;
            Thread.Sleep(new Random().Next(20));&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
 &amp;lt;/source&amp;gt;&lt;/div&gt;</summary>
		<author><name>Admin</name></author>	</entry>

	</feed>