Esempio n. 1
0
        // Takes as input a task object that implements the
        // ITask interface.
        public string LoadTask(ITask task)
        {
            Console.WriteLine("\n1 - Loading new task...");

            // Check that we have a valid object reference
            if(task == null) {
                Console.WriteLine("\nError Task reference is NULL. Task not Loaded.");
                return "\nError Task not loaded.";
            }

            // Copy the reference to our class-wide object variable
            remoteTaskObject = task;
            Console.WriteLine("\n1 - Task has been loaded.");
            Console.WriteLine("\nTask ID: " + remoteTaskObject.Identify() + "\n");
            return "Task loaded. Connected with the Server.\n Task consists of "+remoteTaskObject.Identify();
        }