public void LoadSimpleTheme()
        {
            File.WriteAllText("test.theme", "$Variables {v1:1;v2:2;}.Button { BackColor:Blue;}");

            var theme = WinformsThemeLoader.Load("test.theme");

            Assert.Equal(1, theme.Selectors.Count());
            Assert.Equal(2, theme.Variables.ElementsDictionary.Count);
        }
Esempio n. 2
0
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            var theme = WinformsThemeLoader.Load("sample.theme");

            using (ThemeHooker.HookTheme(theme))
            {
                Application.Run(new Form1());
            }
        }
        public void LoadThemeWithComments()
        {
            File.WriteAllText("test.theme",
                              @"// SomeComments 
                       $Variables {v1:1;v2:2;} // another
                       .Button { BackColor:Blue;
                            /* A block
                            *
                            */
                            }
                 ");

            var theme = WinformsThemeLoader.Load("test.theme");

            Assert.Equal(1, theme.Selectors.Count());
            Assert.Equal(2, theme.Variables.ElementsDictionary.Count);
        }