public void EmitUsingStatements(SessionGeneratorContext context)
 {
     helper.EmitUsings(new string[] {
         "System.Collections",
         "System.Windows",
         "System.Windows.Input",
     });
 }
 public void EmitUsingStatements(SessionGeneratorContext context)
 {
     helper.EmitUsings(new string[]
     {
         "PhillipScottGivens.Library.AppSessionFramework",
         //"PhillipScottGivens.Library.AppSessionFramework.ComponentModel",
         "System",
         "System.ComponentModel",
     });
 }
Esempio n. 3
0
        protected override void GenerateProxiesCore(string proxyLocation, string @namespace, SessionGeneratorContext context)
        {
            SessionProxyEmitter emitter = new SessionProxyEmitter();

            AddSessionBasesToContext();

            TemplateFileManager fileManager = new TemplateFileManager(emitter.GenerationEnvironment);

            fileManager.StartNewFile("SessionProxies.cs");
            emitter.EmitUsingStatements(context);
            using (emitter.BeginNamespace(@namespace)) {
                using (emitter.BeginEmitSessionContainer())
                    using (emitter.BeginEmitSessionContainerInitialize()) {
                        foreach (var info in from i in context.SessionInfos
                                 where !i.IsAbstractBase
                                 select i)
                        {
                            emitter.EmitSessionContainerRegistration(info.Type);
                        }
                    }
            }

            foreach (var info in from i in context.SessionInfos
                     where !i.IsAbstractBase
                     select i)
            {
                using (emitter.BeginNamespace(info.Type.Namespace + ".Proxies")) {
                    using (emitter.BeginEmitSessionClass(info.Type)) {
                        emitter.EmitConstructor(info.Type);
                        foreach (var method in info.Operations)
                        {
                            emitter.EmitOperation(method);
                        }
                        foreach (var property in info.DataProperties)
                        {
                            emitter.EmitDataProperty(property);
                        }
                    }
                }
            }
            fileManager.Process(proxyLocation, true);
        }
 protected abstract void GenerateProxiesCore(string proxyLocation, string @namespace, SessionGeneratorContext context);