Ejemplo n.º 1
0
        private void LoadMacros()
        {
            var macroTypes = Assembly
                             .GetExecutingAssembly()
                             .GetTypes()
                             .Where(t => typeof(IMacro).IsAssignableFrom(t) && t.IsClass && !t.IsAbstract && t.GetCustomAttribute <MacroAttribute>() != null)
                             .OrderBy(t => t.GetCustomAttribute <MacroAttribute>().Order);

            foreach (var type in macroTypes)
            {
                var macroViewModel = new MacroViewModel()
                {
                    Type = type
                };

                Macros.Add(macroViewModel);
            }

            foreach (var lineValues in FileUtil.GetFileLines(MACROS_FILE_NAME, MACROS_FILE_SEPARATOR))
            {
                if (lineValues.Length >= 2)
                {
                    var macro = Macros.FirstOrDefault(m => m.Name == lineValues[0]);
                    if (macro != null)
                    {
                        macro.IsActive = bool.Parse(lineValues[1]);
                    }
                }
            }
        }
Ejemplo n.º 2
0
        private void LoadMacros()
        {
            var macroTypes = Assembly
                             .GetExecutingAssembly()
                             .GetTypes()
                             .Where(t => typeof(IMacro).IsAssignableFrom(t) && t.IsClass && !t.IsAbstract);

            foreach (var type in macroTypes)
            {
                var macroViewModel = new MacroViewModel()
                {
                    Type = type
                };

                this.Macros.Add(macroViewModel);
            }
        }
Ejemplo n.º 3
0
        private void LoadMacros()
        {
            var macroTypes = Assembly
                             .GetExecutingAssembly()
                             .GetTypes()
                             .Where(t => typeof(IMacro).IsAssignableFrom(t) && t.IsClass && !t.IsAbstract && t.GetCustomAttribute <MacroAttribute>() != null)
                             .OrderBy(t => t.GetCustomAttribute <MacroAttribute>().Order);

            foreach (var type in macroTypes)
            {
                var macroViewModel = new MacroViewModel()
                {
                    Type = type
                };

                Macros.Add(macroViewModel);
            }
        }
Ejemplo n.º 4
0
        private void LoadMacros()
        {
            var macroTypes = Assembly
                .GetExecutingAssembly()
                .GetTypes()
                .Where(t => typeof(IMacro).IsAssignableFrom(t) && t.IsClass && !t.IsAbstract);

            foreach (var type in macroTypes)
            {
                var macroViewModel = new MacroViewModel()
                {
                    Type = type
                };

                this.Macros.Add(macroViewModel);
            }
        }