コード例 #1
0
        public static MockApplication Setup(TemplateSettings settings, bool usePreCompiledTemplates = false)
        {
            MockApplication app = new MockApplication(usePreCompiledTemplates, settings, null, null);

            app.Initialize();
            return(app);
        }
コード例 #2
0
        public static MockApplication Setup <T>(TemplateSettings settings = null) where T : UIElement
        {
            string appName = settings?.applicationName;

            if (appName == null)
            {
                StackTrace stackTrace = new StackTrace();
                appName = stackTrace.GetFrame(1).GetMethod().Name;
            }

            if (settings == null)
            {
                settings = GetDefaultSettings <T>(appName);
            }

            if (s_GenerateCode)
            {
                TemplateCodeGenerator.Generate(typeof(T), settings);
            }

            MockApplication app = new MockApplication(s_UsePreCompiledTemplates, settings, null, null);

            app.Initialize();
            return(app);
        }