Ejemplo n.º 1
0
 protected override void Run()
 {
     if (!PropertyService.HasValue(Constants.Properties.HasDisplayedWelcomeKey))
     {
         var dialog = new WelcomeDialog();
         dialog.Show();
     }
 }
Ejemplo n.º 2
0
        public MainForm(string[] args)
        {
            pluginsModels         = new List <PluginModel>();
            pluginControlStatuses = new List <PluginControlStatus>();

            // Set drawing optimizations
            SetStyle(ControlStyles.OptimizedDoubleBuffer, true);
            SetStyle(ControlStyles.AllPaintingInWmPaint, true);

            // Displaying Welcome screen
            var version = Assembly.GetExecutingAssembly().GetName().Version.ToString();

            blackScreen = new WelcomeDialog(version)
            {
                StartPosition = FormStartPosition.CenterScreen
            };
            blackScreen.Show(this);
            blackScreen.SetWorkingMessage("Loading...");

            // Loading XrmToolBox options
            string errorMessage;

            if (!Options.Load(out currentOptions, out errorMessage))
            {
                MessageBox.Show(this,
                                "An error ocurred when loading XrmToolBox options. A new options file has been created.\n\n" +
                                errorMessage);
            }
            if (currentOptions.RememberSession)
            {
                if (!string.IsNullOrEmpty(currentOptions.LastConnection))
                {
                    initialConnectionName = currentOptions.LastConnection;
                }
                if (!string.IsNullOrEmpty(currentOptions.LastPlugin))
                {
                    initialPluginName = currentOptions.LastPlugin;
                }
            }
            // Read arguments to detect if a plugin should be displayed automatically
            if (args.Length > 0)
            {
                initialConnectionName = ExtractSwitchValue("/connection:", ref args);
                initialPluginName     = ExtractSwitchValue("/plugin:", ref args);
            }

            InitializeComponent();

            ProcessMenuItemsForPlugin();
            MouseWheel += (sender, e) => pnlPlugins.Focus();

            Text = string.Format("{0} (v{1})", Text, Assembly.GetExecutingAssembly().GetName().Version);

            // Loading connection controls
            blackScreen.SetWorkingMessage("Loading connection controls...");
            ManageConnectionControl();
            ccsb.MergeConnectionsFiles = currentOptions.MergeConnectionFiles;
        }
Ejemplo n.º 3
0
        void IMainViewAccess.DisplayWelcomeDialog()
        {
            var welcomeDialog = new WelcomeDialog(this, LayoutInflater, viewModel, FragmentManager);

            welcomeDialog.Show();
        }