Esempio n. 1
0
        static void Main()
        {
            Document  theDoc = new Document("Test Document");
            IStorable isDoc  = theDoc;

            isDoc.Read();

            ITalk itDoc = theDoc;

            itDoc.Read();

            theDoc.Read();
            theDoc.Talk();
        }
Esempio n. 2
0
        static void Main()
        {
            Documento doc  = new Documento("Documento 1");
            ITalk     idoc = doc as ITalk;

            if (idoc != null)
            {
                idoc.Read();
            }

            doc.Read();
            doc.Talk();
            doc.Write();
        }
Esempio n. 3
0
        public static void Main()
        {
            Document doc = new Document();

            doc.Read();
            doc.Talk();

            IStorable isdoc = doc;

            isdoc.Read();

            ITalk itdoc = doc;

            itdoc.Read();
        }
Esempio n. 4
0
        static void Main()
        {
            //pravi objekt Document-a
            Document  theDoc = new Document("Test document");
            IStorable isDoc  = theDoc;

            isDoc.Read();

            ITalk itDoc = theDoc;

            itDoc.Read();

            theDoc.Read();
            theDoc.Talk();
        }
    static void Main()
    {
        Document  theDoc = new Document("Test Document");
        IStorable isDoc  = theDoc;

        isDoc.Read();

        ((ITalk)theDoc).Read();
        //otherway
        ITalk itDoc = theDoc;

        itDoc.Read();

        theDoc.Read();
        theDoc.Talk();
    }
Esempio n. 6
0
        static void Main(string[] args)
        {
            Document  theDoc = new Document("Test Document");
            IStorable isDoc  = theDoc as IStorable;

            if (isDoc != null)
            {
                isDoc.Read();
            }
            ITalk itDoc = theDoc as ITalk;

            if (itDoc != null)
            {
                itDoc.Read();
            }
            theDoc.Read();
            theDoc.Talk();
            Console.ReadLine();
        }
Esempio n. 7
0
        public void Run()
        {
            // Create a Document object
            Document  theDoc = new Document("Test Document");
            IStorable isDoc  = theDoc as IStorable;

            if (isDoc != null)
            {
                isDoc.Read();
            }

            // Cast to an ITalk interface
            ITalk itDoc = theDoc as ITalk;

            if (itDoc != null)
            {
                itDoc.Read();
            }

            theDoc.Read();
            theDoc.Talk();
        }