Esempio n. 1
0
        /// <summary>Load the splash screens.</summary>
        private void LoadSplashScreens()
        {
            string name = Configuration.GetDataStoragePath();
            string path = Path.Combine(Path.GetDirectoryName(name), "Files");

            path = Path.Combine(path, "SplashScreens");

            var viewEngine = new ViewEngine();

            viewEngine.AddContext("MudAttributes", MudEngineAttributes.Instance);

            var dirInfo = new DirectoryInfo(path);
            var files   = new List <FileInfo>(dirInfo.GetFiles());

            foreach (var fileInfo in files)
            {
                var    sr            = new StreamReader(fileInfo.FullName);
                string splashContent = sr.ReadToEnd();
                sr.Close();

                string renderedScreen = viewEngine.RenderView(splashContent);

                splashScreens.Add(renderedScreen);
                this.SystemHost.UpdateSystemHost(this, string.Format("{0} has been loaded.", fileInfo.Name));
            }
        }
Esempio n. 2
0
 /// <summary>Sets the default properties of this behavior instance.</summary>
 protected override void SetDefaultProperties()
 {
     this.Controller = null;
     this.ViewEngine = new ViewEngine();
 }