Beispiel #1
0
        public static InterfaceData fromExistingInterface(string s)
        {
            var data = new InterfaceData();

            data.accessmodifier = AccessLevel.@public;
            var t = System.Reflection.TypeInfo.GetType(s);

            data.@namespace = t.Namespace;
            data.name       = MiscUtils.getClassName(t);
            var funcs = t.GetMethods();

            foreach (var func in funcs)
            {
                data.functions.Add(FunctionData.getDataForExistingFunction(func));
            }
            return(data);
        }
Beispiel #2
0
        public void TestInterfacePrintout()
        {
            var protocol = new QuickClassDesigner.InterfaceData();

            protocol.@namespace     = "TestableClasses";
            protocol.accessmodifier = AccessLevel.@public;
            protocol.name           = "ITestable";
            var func = new QuickClassDesigner.FunctionData();

            func.accessmodifer = AccessLevel.@public;
            func.returnType    = typeof(void);
            func.name          = "makeMeAFunction";
            protocol.functions.Add(func);
            var src = protocol.generateSourceCode();

            Console.WriteLine(src);
        }