public static void SecondMethod(RunningTotal param)
 {
     DebugMgr.start(10, "ExMethodCall.SecondMethod");
     param.IncrementValue();
     DebugMgr.output(10, "During RunningTotal.value = " + param.GetValue());
     DebugMgr.end(10);
 }
Ejemplo n.º 2
0
        public Object GetUnknownTypeObject(string prefix, string resource, string view)
        {
            Object retval = null;

            DebugMgr.start(9, "Reference.GetUnknownTypeObject");
            foreach (Assembly assembly in _assemblies)
            {
                Object @object;

                IImplementations implementations = (IImplementations)assembly.CreateInstance("Reference.Implementation");
                if (implementations != null)
                {
                    @object = implementations.GetResource(prefix, resource, view);
                    if (@object != null)
                    {
                        DebugMgr.output(9, "Found Object");
                        retval = @object;
                        break;
                    }
                }
                else
                {
                    DebugMgr.outputVar(9, "Did not implement", assembly.FullName);
                }
            }
            DebugMgr.end(9);
            return(retval);
        }
 public static void SecondMethod(ExStruct param1, ExClass param2)
 {
     DebugMgr.start(10, "ExMethodCall.SecondMethod");
     param1.value++;
     param2.value++;
     DebugMgr.output(10, "During ExStruct.value = " + param1.value);
     DebugMgr.output(10, "During ExClass.value = " + param2.value);
     DebugMgr.end(10);
 }
Ejemplo n.º 4
0
        public static void SimpleOldContainer()
        {
            DebugMgr.start(10, "RunExamples.SimpleOldContainer");
            OldContainer container = new OldContainer();

            container.MyProperty = 2;
            int value = (int)container.MyProperty;

            DebugMgr.output(10, "Value is " + value);
            DebugMgr.end(10);
        }
Ejemplo n.º 5
0
 public static void Main(string[] args)
 {
     DebugMgr.assignDebugFlags(10);
     DebugMgr.start(8, "Main");
     try {
         RunDynamic();
     }
     catch (Exception ex) {
         DebugMgr.output(1, "!!! " + ex.Message + " !!!");
     }
     DebugMgr.end(8);
 }
        private static void SimpleInheritance()
        {
            DebugMgr.start(10, "TestInheritance.SimpleInheritance");
            Subclassed subcls = new Subclassed();

            subcls.SimpleMethod();
            DebugMgr.output(10, "Now assigning to type BaseClass");
            BaseClass basecls = subcls;

            basecls.SimpleMethod();
            DebugMgr.end(10);
        }
        public static void FirstMethod()
        {
            DebugMgr.start(10, "ExMethodCall.FirstMethod");
            ExStruct cls1 = new ExStruct();
            ExClass  cls2 = new ExClass();

            DebugMgr.output(10, "Before ExStruct.value = " + cls1.value);
            DebugMgr.output(10, "Before ExClass.value = " + cls2.value);
            SecondMethod(cls1, cls2);
            DebugMgr.output(10, "After ExStruct.value = " + cls1.value);
            DebugMgr.output(10, "After ExClass.value = " + cls2.value);
            DebugMgr.end(10);
        }
        private static void MultipleInheritance()
        {
            DebugMgr.start(10, "TestInheritance.MultipleInheritance");
            DebugMgr.output(10, "Created NewVersionSubclassed, and assigned to type BaseClass");
            BaseClass baseCls = new NewVersionSubclassed();

            baseCls.VirtualMethod();
            DebugMgr.output(10, "Now assigning to type NewVersion");
            NewVersion newVer = (NewVersion)baseCls;

            newVer.VirtualMethod();
            DebugMgr.end(10);
        }
        private static void PolymorphicInheritance()
        {
            DebugMgr.start(10, "TestInheritance.PolymorphicInheritance");
            DebugMgr.output(10, "Created Human and assigned to Animal");
            Animal animal1 = new Human();

            animal1.WhatAmI();
            DebugMgr.output(10, "Created Dog and assigned to Animal");
            Animal animal2 = new Dog();

            animal2.WhatAmI();
            DebugMgr.end(10);
        }
Ejemplo n.º 10
0
        public static void SimpleNewContainer()
        {
            DebugMgr.start(10, "RunExamples.SimpleNewContainer");
#if GenericsSupported
            NewContainer <int> container = new NewContainer <int>();
            container.MyProperty = 2;
            int value = container.MyProperty;
            DebugMgr.output(10, "Value is " + value);
#else
            DebugMgr.output(10, "Not Implemented");
#endif
            DebugMgr.end(10);
        }
        public static void FirstMethod()
        {
            DebugMgr.start(10, "ExMethodCall.FirstMethod");
            ExStruct2 cls1 = new ExStruct2();
            ExClass2  cls2 = new ExClass2();

            DebugMgr.output(10, "Before ExStruct2.value = " + cls1.GetValue());
            DebugMgr.output(10, "Before ExClass2.value = " + cls2.GetValue());
            SecondMethod(cls1);
            SecondMethod(cls2);
            DebugMgr.output(10, "After ExStruct2.value = " + cls1.GetValue());
            DebugMgr.output(10, "After ExClass2.value = " + cls2.GetValue());
            DebugMgr.end(10);
        }
Ejemplo n.º 12
0
    public static void RunResource()
    {
        IOperations operations = (IOperations)(Reference.Instance().GetUnknownTypeObject("DB", "cgross", "XML"));

        if (operations == null)
        {
            DebugMgr.output(1, "!!! Operations is a null object !!!");
        }
        IUser user = operations.LoadUser("some.identifier");

        DebugMgr.outputVar(8, "name", user.name);
        DebugMgr.outputVar(8, "street", user.street);
        DebugMgr.outputVar(8, "city", user.city);
        DebugMgr.outputVar(8, "country", user.country);
    }
Ejemplo n.º 13
0
    public static void RunIt()
    {
        DebugMgr.start(10, "TestExternalreference.RunIt");

        InAssembly2Class2 cls = new InAssembly2Class2();

        cls.greetings();
        //cls.greetingsProtected();
        cls.greetingsInternal();
        cls.greetingsInternalVirtual();

        DebugMgr.output(10, "-----------");
        InAssembly1Class cls2 = cls;

        cls2.greetings();
        //cls2.greetingsInternal();
        cls2.CallTheInternalMethod();
        DebugMgr.end(10);
    }
Ejemplo n.º 14
0
    public static void RunDynamic()
    {
        string @class = ConfigurationSettings.AppSettings["classload"];

        DebugMgr.outputVar(8, "class to load", @class);

        IOperations operations = (IOperations)(Reference.Instance().GetObject(@class));

        if (operations == null)
        {
            DebugMgr.output(1, "!!! Operations is a null object !!!");
        }
        IUser user = operations.LoadUser("some.identifier");

        DebugMgr.outputVar(8, "name", user.name);
        DebugMgr.outputVar(8, "street", user.street);
        DebugMgr.outputVar(8, "city", user.city);
        DebugMgr.outputVar(8, "country", user.country);
    }
Ejemplo n.º 15
0
 public void MethodToDoItNow(string param)
 {
     DebugMgr.start(10, "ReceiveMessage.MethodToDoItNow");
     DebugMgr.output(10, "Received message " + param);
     DebugMgr.end(10);
 }
 public override void WhatAmI()
 {
     DebugMgr.output(10, "I am a dog");
 }
 public new virtual void WhatAmI()
 {
     DebugMgr.output(10, "I am an English Bulldog");
 }
 public virtual void WhatAmI()
 {
     DebugMgr.output(10, "I don't know what you are");
 }