Esempio n. 1
0
        private void FrmMain_Load(object sender, EventArgs e)
        {
            try
            {
                dictionary = LanguageDictionary.loadInternalEnglish();
            }
            catch (Exception ex)
            {
            }

            if (dictionary == null)
            {
                MessageBox.Show("Fatal error, unable to load dictionary.");
                Application.Exit();
            }

            //MenuHelper.visitAllUnimplementedMenuItems(mnuMain.GetMenuItemWrapper(), M => M.Enabled = false);

            //disalbe all menu items that are not implemented
            string        clickEndig   = "_click";
            List <string> clickMethods = (from info in typeof(FrmMain).GetMethods(BindingFlags.Instance | BindingFlags.NonPublic | BindingFlags.Public)
                                          where info.Name.ToLower().EndsWith(clickEndig)
                                          select info.Name.Substring(0, info.Name.Length - clickEndig.Length)).ToList();

            MenuHelper.visitAllMenuItems(mnuMain.GetMenuItemWrapper(),
                                         M => M.Enabled = false,
                                         M => !clickMethods.Contains(M.Name) && (!M.HasSubMenus));
        }
Esempio n. 2
0
        static void Main(string[] args)
        {
            int min_len = 20;

            Console.WriteLine("Loading default English dictionary.");
            var dictionary = LanguageDictionary.loadInternalEnglish();

            Console.WriteLine($"Finding words longer than {min_len} characters:");
            Console.WriteLine();
            foreach (Word word in dictionary)
            {
                if ((word.PrimarySpelling.Length > 20) && (!word.PrimarySpelling.Contains('-')))
                {
                    Console.WriteLine(word);
                    Console.WriteLine();
                }
            }
        }