Esempio n. 1
0
        private void bemail_Click(object sender, RoutedEventArgs e)
        {
            if (false == string.IsNullOrEmpty(Email))
            {
                var    tuple   = AbnakiReflection.ApplicationNameVersionSplit();
                string subject = string.Format("{0}%20{1}%20", tuple.Item1, tuple.Item2);
                string uri     = string.Format("mailto:{0}?subject={1}", Email, subject);

                using (var p = Process.Start(uri))
                {
                    // ok
                }
            }
        }
Esempio n. 2
0
        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");
        }