/// <summary>
        /// Populate Layout info
        /// </summary>
        private void PopulateLayout()
        {
            var fp     = Path.Combine(DirectoryManagement.sConfigurationFolderPath, LayoutFileName);
            var window = Application.Current.MainWindow;

            // Layout
            try
            {
                this.AppLayout = AppLayout.LoadFromJSON <AppLayout>(fp);

                this.AppLayout.LoadLayoutIfPrevVersion(window.Top, window.Left);
            }
            catch (Exception)
            {
                AppLayout.RemoveConfiguration(fp);
                this.AppLayout = new AppLayout(window.Top, window.Left);
                this.AppLayout.SerializeInJSON(fp);
            }
        }
Exemple #2
0
        /// <summary>
        /// Populate Layout info
        /// </summary>
        private void PopulateLayout()
        {
            var fp = Path.Combine(SettingsProvider.ConfigurationFolderPath, LayoutFileName);
            var window = Application.Current.MainWindow;

            // Layout
            try
            {
                this.AppLayout = AppLayout.LoadFromJSON<AppLayout>(fp);

                this.AppLayout.LoadLayoutIfPrevVersion(window.Top, window.Left);
            }
#pragma warning disable CA1031 // Do not catch general exception types
            catch (Exception e)
            {
                e.ReportException();
                AppLayout.RemoveConfiguration(fp);
                this.AppLayout = new AppLayout(window.Top, window.Left);
                this.AppLayout.SerializeInJSON(fp);
            }
#pragma warning restore CA1031 // Do not catch general exception types
        }