コード例 #1
0
        protected override void Seed(AppContext context)
        {
            //  UserSeed.VandGrow(context);
            EstateStatusSeed.VandGrow(context);
            CourseHoldingTypeSeed.VandGrow(context);
            BankSeed.VandGrow(context);
            MaritalStatusSeed.VandGrow(context);
            ReligionSeed.VandGrow(context);
            EducationDegreeSeed.VandGrow(context);
            MilitaryStatusSeed.VandGrow(context);

            ShiftSeed.VandGrow(context);
            RoleSeed.VandGrow(context);
            MenuSeed.VandGrow(context);
            SexSeed.VandGrow(context);
            //ProvinceSeed.VandGrow(context);
            CategorySeed.VandGrow(context);
            SiteSeed.VandGrow(context);

            TeacherSeed.VandGrow(context);
            EducationalCenterUserSeed.VandGrow(context);
            StudentSeed.VandGrow(context);

            MenuSeed.VandGrow(context);
            RecruitmentTypeSeed.VandGrow(context);

            //OrganizationSeed.VandGrow(context);

            //DepartmentTypeSeed.VandGrow(context);
            //SiteSeed.VandGrow(context);
            //LanguageCenterUserRoleSeed.VandGrow(context);
            ClassroomTypeSeed.VandGrow(context);
            //MinistryOfEducationUserSeed.VandGrow(context);
            base.Seed(context);
        }
コード例 #2
0
        public void ConfigureMenu(IMainMenu menu)
        {
            menu.AddCommandChild(TopMenuKey.File, ExMenuKey.FileNew, "_New");

            MenuSeed <ExMenuKey> seed = new MenuSeed <ExMenuKey>(ExMenuKey.FileDemoKey, "Demo");

            seed.ParentKey   = TopMenuKey.File;
            seed.ShortcutKey = Key.D; seed.ShortcutModifier = ModifierKeys.Control;
            seed.Tooltip     = "Uses keyboard shortcut to invoke something.";
            menu.AddCommand(seed);

            menu.AddCommandChild(TopMenuKey.Option, ExMenuKey.OptionFlag, "_Flag");
            ButtonBus <ExMenuKey> .AddExclusiveCommands(menu, ExMenuKey.OptionFlag,
                                                        new[] { ExMenuKey.OptionFlagAustria, ExMenuKey.OptionFlagBulg, ExMenuKey.OptionFlagNed });
        }
コード例 #3
0
ファイル: ButtonBus.cs プロジェクト: abnaki/windows
        /// <summary>
        /// First command shall be checked; remainder false.
        /// </summary>
        public static void AddExclusiveCommands(IMainMenu menu, object parentKey, IEnumerable <Tenum> keys)
        {
            bool chk = true;

            foreach (Tenum key in keys)
            {
                MenuSeed <Tenum> seed = new MenuSeed <Tenum>()
                {
                    ParentKey = parentKey, Key = key, DefaultCheck = chk
                };
                seed.MutuallyExclusive = true;
                menu.AddCommand(seed);
                chk = false;
            }
        }
コード例 #4
0
        //public void AddExclusiveCommands<TKey>(object parentKey, IEnumerable<MenuSeed<TKey>> seeds)
        //{
        //    foreach ( var seed in seeds )
        //    {
        //        seed.MutuallyExclusive = true;
        //        seed.ParentKey = parentKey;
        //        AddCommand(seed);
        //    }
        //}

        void CompleteItem <Tkey>(MenuItem item, MenuSeed <Tkey> seed)
        {
            RichTag  rt      = (RichTag)item.Tag;
            ICommand command = seed.MutuallyExclusive ? new ClickCommandExclusive <Tkey>() : new ClickCommand <Tkey>();

            item.Command          = command;
            item.CommandParameter = item.Tag;

            if (seed.DefaultCheck.HasValue)
            {
                mapKeyExclusivity[seed.Key] = seed.MutuallyExclusive;
            }

            string tip = seed.Tooltip ?? rt.LabelDetail;

            //  maybe wrap
            //  Regex rgx = new Regex("(.{50}\\s)"); string s = rgx.Replace(longMessage,"$1\n");

            if (seed.ShortcutKey != Key.None)
            {
                KeyGesture keyg = new KeyGesture(seed.ShortcutKey, seed.ShortcutModifier);
                Application.Current.MainWindow.InputBindings.Add(new InputBinding(item.Command, keyg)
                {
                    CommandParameter = item.CommandParameter
                });

                if (!string.IsNullOrWhiteSpace(seed.Tooltip))
                {
                    tip += " ";
                }

                tip += "(";
                if (seed.ShortcutModifier != ModifierKeys.None)
                {
                    tip += seed.ShortcutModifier + "-";
                }

                tip += seed.ShortcutKey + ")";
            }
            item.ToolTip = tip;

            if (seed.Enabled.HasValue)
            {
                item.IsEnabled = seed.Enabled.Value;
            }

            CompleteParentMenuItem(item);
        }
コード例 #5
0
ファイル: Configuration.cs プロジェクト: willvin313/PortalCMS
        protected override void Seed(Portal.CMS.Entities.PortalEntityModel context)
        {
            ThemeSeed.Seed(context);
            RoleSeed.Seed(context);
            SettingSeed.Seed(context);
            PostCategorySeed.Seed(context);
            PageSectionTypeSeed.Seed(context);
            PageComponentTypeSeed.Seed(context);
            MediaSeed.Seed(context);
            CopySeed.Seed(context);
            context.SaveChanges();

            MenuSeed.Seed(context);
            PageSeed.Seed(context);
            PostSeed.Seed(context);
        }
コード例 #6
0
ファイル: MainMenuBus.cs プロジェクト: abnaki/windows
        public MainMenuBus(MainMenu menu)
        {
            MenuSeed <SubMenuKey> seed;

            menu.AddCommand(TopMenuKey.File, "_File");
            menu.AddCommand(TopMenuKey.Option, "_Option");
            menu.AddCommand(TopMenuKey.Window, "_Window");
            menu.AddCommand(TopMenuKey.Help, "_Help");

            menu.AddCommandChild(TopMenuKey.File, SubMenuKey.FileExit, "E_xit");

            // FYI some attributes of SubMenuKey enum values will be respected

            if (UpgradeUri != null)
            {
                var appTuple = AbnakiReflection.ApplicationNameVersionSplit();

                seed = new MenuSeed <SubMenuKey>(SubMenuKey.HelpUpgrade, "_Upgrade...")
                {
                    ParentKey = TopMenuKey.Help,
                    Tooltip   = "Open web browser for upgrade of your current " + appTuple.Item1 + " " + appTuple.Item2
                };
                menu.AddCommand(seed);
            }

            seed = new MenuSeed <SubMenuKey>(SubMenuKey.HelpTroubleshoot, "_Troubleshoot...")
            {
                ParentKey = TopMenuKey.Help,
                Tooltip   = "Instructions for you to seek help or report issues."
            };
            menu.AddCommand(seed);

            menu.AddCommandChild(TopMenuKey.Window, SubMenuKey.SaveUserPlacement, "Save Placement");
            menu.AddCommand(new MenuSeed <SubMenuKey>()
            {
                ParentKey = TopMenuKey.Window, Key = SubMenuKey.SaveAsPlacement,
                Label     = "Save Placement As...", DebugOnly = true
            });
            menu.AddCommandChild(TopMenuKey.Window, SubMenuKey.ReadUserPlacement, "Restore Own Placement");
            menu.AddCommandChild(TopMenuKey.Window, SubMenuKey.ReadDefaultPlacement, "Restore Default Placement");
        }
コード例 #7
0
        public void AddCommand <Tkey>(MenuSeed <Tkey> seed)
        {
#if DEBUG
#else
            if (seed.DebugOnly)
            {
                return;
            }
#endif

            MenuItem item;
            string   label = seed.Label ?? AbnakiReflection.LabelOfEnum(seed.Key);

            if (seed.ParentKey == null)
            {
                item = AddMenuItem(seed.Key, label, seed.DefaultCheck);
            }
            else
            {
                item = AddItemChild(seed.ParentKey, seed.Key, label, seed.DefaultCheck);
            }

            CompleteItem <Tkey>(item, seed);
        }