示例#1
0
        InterfaceRenderInformation renderInterface(TypeDeclaration interfaceDecl)
        {
            var ret = new InterfaceRenderInformation();

            ret.isRoutableViewModel = interfaceDecl.BaseTypes
                                      .OfType <SimpleType>()
                                      .Any(x => x.Identifier == "IRoutableViewModel") ? ret : null;

            ret.definition    = "public " + chompedString(interfaceDecl.ToString().Replace("[Once]", ""));
            ret.interfaceName = chompedString(interfaceDecl.Name);
            ret.implClassName = ret.interfaceName.Substring(1); // Skip the 'I'

            ret.properties = interfaceDecl.Children
                             .Where(x => x is PropertyDeclaration || x is MethodDeclaration)
                             .Select(renderPropertyDeclaration)
                             .ToArray();

            ret.onceProperties = ret.properties
                                 .Where(x => x.onceProp != null)
                                 .Select(x => x.onceProp)
                                 .ToArray();

            return(ret);
        }
示例#2
0
        InterfaceRenderInformation renderInterface(TypeDeclaration interfaceDecl)
        {
            var ret = new InterfaceRenderInformation();

            ret.isRoutableViewModel = interfaceDecl.BaseTypes
                .OfType<SimpleType>()
                .Any(x => x.Identifier == "IRoutableViewModel") ? ret : null;

            ret.definition = "public " + chompedString(interfaceDecl.ToString().Replace("[Once]", ""));
            ret.interfaceName = chompedString(interfaceDecl.Name);
            ret.implClassName = ret.interfaceName.Substring(1); // Skip the 'I'

            ret.properties = interfaceDecl.Children
                .Where(x => x is PropertyDeclaration || x is MethodDeclaration)
                .Select(renderPropertyDeclaration)
                .ToArray();

            ret.onceProperties = ret.properties
                .Where(x => x.onceProp != null)
                .Select(x => x.onceProp)
                .ToArray();

            return ret;
        }