コード例 #1
0
        public void OpenUrl()
        {
            // see also https://support.microsoft.com/en-us/help/305703/how-to-start-the-default-internet-browser-programmatically-by-using-vi

            string target = "https://www.featureadmin.com";

            try
            {
                System.Diagnostics.Process.Start(target);
            }
            catch
            (
                System.ComponentModel.Win32Exception noBrowser)
            {
                if (noBrowser.ErrorCode == -2147467259)
                {
                    var dialog = new ConfirmationRequest(
                        "No Browser found",
                        noBrowser.Message
                        );
                    DialogViewModel dialogVm = new DialogViewModel(eventAggregator, dialog);
                    this.windowManager.ShowDialog(dialogVm, null, GetDialogSettings());
                }
            }
            catch (System.Exception other)
            {
                var dialog = new ConfirmationRequest(
                    "System Exception when opening browser",
                    other.Message
                    );
                DialogViewModel dialogVm = new DialogViewModel(eventAggregator, dialog);
                this.windowManager.ShowDialog(dialogVm, null, GetDialogSettings());
            }
        }
コード例 #2
0
        public void OpenDialog(string title, string message)
        {
            DialogViewModel dialogVm = new DialogViewModel(title, message);

            dynamic settings = new System.Dynamic.ExpandoObject();

            settings.WindowStartupLocation = System.Windows.WindowStartupLocation.CenterOwner;
            settings.ResizeMode            = System.Windows.ResizeMode.NoResize;
            settings.Width  = 300;
            settings.Height = 200;
            // settings.Title = "window title";
            // settings.Icon = new BitmapImage(new Uri("pack://application:,,,/MyApplication;component/Assets/myicon.ico"));

            this.windowManager.ShowDialog(dialogVm, null, settings);
        }
コード例 #3
0
        public void About()
        {
            var version = System.Reflection.Assembly.GetExecutingAssembly().GetName().Version;

            var year = System.IO.File.GetCreationTime(
                System.Reflection.Assembly.GetExecutingAssembly().Location).Year;

            var dialog = new ConfirmationRequest(
                "About Feature Admin",
                "SharePoint Feature Admin\n" +
                "Current version " + version + "\n\n" +
                "Created by Achim Ismaili in " + year + "\n" +
                "https://www.featureadmin.com"
                );
            DialogViewModel dialogVm = new DialogViewModel(eventAggregator, dialog);

            this.windowManager.ShowDialog(dialogVm, null, GetDialogSettings());
        }
コード例 #4
0
        public void Handle(DecisionRequest message)
        {
            DialogViewModel dialogVm = new DialogViewModel(eventAggregator, message);

            this.windowManager.ShowDialog(dialogVm, null, GetDialogSettings());
        }