示例#1
0
        static void Main(string[] args)
        {
            var text = new Text();

            text.Width = 100; //with this the text class inherited width in PresentationObject
            text.Copy();
        }
示例#2
0
        static void Main(string[] args)
        {
            var text = new Text();

            text.Height = 100;
            text.Copy();
        }
示例#3
0
        static void Main(string[] args)
        {
            var text = new Text();

            text.Copy();
            Console.ReadKey();
        }
示例#4
0
        static void Main(string[] args)
        {
            var text = new Text();

            text.Width = 100;
            text.Copy();
        }
        static void Main(string[] args)
        {
            var text = new Text();

            text.Width = 100;
            text.Copy();
            text.AddHyperlink("https://reddit.com");
        }
        static void Main(string[] args)
        {
            var text = new Text();

            text.Width = 100;
            text.Copy();
            Console.ReadLine();
        }
示例#7
0
        public static void Main(string[] args)
        {
            var text = new Text();

            text.Width = 100;
            text.Copy();
            Console.WriteLine(text.Width);
        }
示例#8
0
        static void Main(string[] args)
        {
            // create an object called text, instance of Text class
            Text text = new Text();

            text.Width = 100;
            text.Copy();
        }
示例#9
0
文件: Main.cs 项目: schan1992/box
        static void Main(string[] args)
        {
            var text = new Text();
            text.Width = 200;

            // Copy method is from PresentationObject class
            text.Copy();
        }
        static void Main(string[] args)
        {
            var textObject = new Text(12, "Arial");
            textObject.Hyperlink("www.pornhub.com");

            textObject.Copy();

            Console.WriteLine(textObject.Width + " " + textObject.Height);
        }
示例#11
0
        static void Main(string[] args)
        {
            var text = new Text();

            text.Copy();
            text.Duplicate();
            text.AddHyperLink("url.com");
            Console.WriteLine("Text height: {0}, width: {1}", text.Height = 10, text.Width = 3);
        }
示例#12
0
        private static void Main(string[] args)
        {
            var text = new Text
            {
                FontSize = 20,
                Width    = 100
            };

            text.Copy();
        }
示例#13
0
        static void Main(string[] args)
        {
            var text = new Text();

            text.Width = 100;
            text.Copy();


            // Console.WriteLine("Hello World!");
        }
示例#14
0
        static void Main(string[] args)
        {
            var text = new Text();

            text.Width    = 100;
            text.Height   = 50;
            text.FontSize = 50;
            text.AddHyperlink("https://github.com/");
            text.Copy();
            text.Duplicate();
        }
示例#15
0
        static void Main(string[] args)
        {
            var text = new Text();

            text.Width  = 100;
            text.Height = 50;

            text.Copy();
            text.AddHyperlink("www.google.com");

            Console.ReadLine();
        }
示例#16
0
        static void Main(string[] args)
        {
            // Here we instantiate a new instance of the Text class, which inherits from PresentationObject
            var text = new Text();

            // Here we set the FontName property which is a property of Text
            text.FontName = "Helvetica";

            // Here we set the Width property and call the Copy() method, both of which do not exist on the Text class object but are inherited from PresentationObject
            text.Width = 100;
            text.Copy();
        }
        static void Main(string[] args)
        {
            var text = new Text();

            text.AddHyperlink("http://goole.com");
            // Height and width are inheritated from the base class PresentationObject
            text.Height = 20;
            text.Width  = 40;
            // this are properties from the text object
            text.FontSize = 12;
            text.FontName = "Arial";

            text.Copy();
            text.Duplicate();


            Console.ReadKey();
        }
示例#18
0
        /*
         *  coupling- > a measure of how interconnet classes & subclasses are.
         *  tightly coupled : more interconnet
         *  loosly coupled: less interconnet or dependent classes
         *      achive :
         *          1) encapsulation
         *          2)the relationship b/w the class
         *          3)interface
         *
         *  we have 2 type of relationship..
         *   1) inheritance
         *   2) composition
         */

        /*
         *  inheritance -> relationship that help one class to inherit method or field form other class.
         *  relationShip =  IS A ,like car is a vehicle
         */
        static void Main(string[] args)
        {
            /*--------- */
            //parent class

            var presentObj = new PresentationObject();

            presentObj.Height = 100;
            presentObj.Duplicate();
            Console.WriteLine($"height : {presentObj.Height} px");

            //child class
            var text = new Text();

            Console.ForegroundColor = ConsoleColor.Green;
            text.Height             = 300;
            text.Copy();
            text.Hyperlink("www.google.com");

            Console.WriteLine($"height : { text.Height} px");
        }
示例#19
0
        static void Main(string[] args)
        {
            // Inheritance:
            // A kind of relationship/association between two classes that allows one to inherit code from the other
            // Is-A relationship
            // A Car is a Vehicle

            // Benefits:
            // Code re-use
            // Polymorphic behavior (powerful)

            // Vehicle is the PARENT or BASE class or SUPERCLASS
            // Car is the CHILD or DERIVED class or SUBCLASS

            // Classes can only have one parent

            // Create an object of type Text
            var text = new Text();

            text.Width = 100;
            text.Copy();
        }