static void Main(string[] args)
        {
            Console.WriteLine("Basic Example using inheritance:");
            var test = new Controllable
            {
                // initialize in controllable does not preset it's values, so all bools are false by default
                canBeControlled = true,
                canBeSelected   = true,
                isselected      = true
            };

            test.wrapperfunction();
            Console.WriteLine("------------------------------------------------------------------------------------------");

            Console.WriteLine("Basic Example partial-hierachy / masking parents:");
            var mask = new presetMaskExample();

            mask.isselected = true;
            mask.wrapperfunction();
            Console.WriteLine("------------------------------------------------------------------------------------------");

            Console.WriteLine("Basic Example using a mask as base to build a new controller:");
            var DoesPrint = new PrintStuff();

            DoesPrint.wrapperfunction();
            Console.WriteLine("------------------------------------------------------------------------------------------");

            Console.WriteLine("Basic Example registering not derived components:");
            var print = new PrintMe();

            print.allowOthersToPrint = true;
            print.wrapperfunction();
            Console.WriteLine("------------------------------------------------------------------------------------------");
        }
예제 #2
0
        public override void initialize()
        {
            if (isSelected())
            {
                Console.WriteLine("INITIALIZING P_PRINTSTUFF");
            }
            var mask = new presetMaskExample();

            master.registerController(mask);
            if (printstuff == null)
            {
                printstuff = getAttrElseSetDefaultBoth("printstuff", master, "LALALALALA!!!");
            }
        }