Пример #1
0
        /// <summary>
        /// Restores the layout.
        /// </summary>
        public void RestoreLayout()
        {
            string path = GetFilePath();

            if (File.Exists(path))
            {
                try
                {
                    dockManager.RestoreLayoutFromXml(path);
                }
                catch (ArgumentOutOfRangeException)
                {
                    // There were more plugins the last time the layout was saved than there are now.
                    Trace.WriteLine("ArgumentOutOfRangeException while restoring dock layout.");
                }
                catch (InvalidCastException)
                {
                    // There were more plugins the last time the layout was saved than there are now.
                    Trace.WriteLine("InvalidCastException while restoring dock layout.");

                    ResetLayout();
                }
            }
        }