static void Main() { Document theDoc = new Document("Test Document"); IStorable isDoc = theDoc; isDoc.Read(); ITalk itDoc = theDoc; itDoc.Read(); theDoc.Read(); theDoc.Talk(); }
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(); }
public static void Main() { Document doc = new Document(); doc.Read(); doc.Talk(); IStorable isdoc = doc; isdoc.Read(); ITalk itdoc = doc; itdoc.Read(); }
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(); }
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(); }
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(); }