Exemplo n.º 1
0
        public ShellView()
        {
            InitializeComponent();
            _isLocked = true;
            HideFullScreenPanel.IsHitTestVisible = false;
            ShowFullScreenPanel.IsHitTestVisible = false;
            Loaded            += OnLoaded;
            KeyDown           += Shell_KeyDown;
            SourceInitialized += WinSourceInitialized;

            if (File.Exists(FilePath))
            {
                GetFilePath();
                using (FileStream fs = new FileStream(FilePath, FileMode.Open, FileAccess.Read))
                {
                    var streamReader = new StreamReader(fs);
                    _savedLayout = streamReader.ReadToEnd();
                }
                if (!string.IsNullOrEmpty(_savedLayout))
                {
                    try
                    {
                        DockManager.LoadLayout(_savedLayout);
                    }
                    catch (Exception err)
                    {
                        _savedLayout = null;
                        File.Delete(FilePath);
                        Dev2Logger.Error("Unable to load layout", GlobalConstants.WarewolfError);
                        Dev2Logger.Error(err, GlobalConstants.WarewolfError);
                    }
                }
            }

#pragma warning disable S3010 // For testing (Studio reset shortcut)
            _this = this;
#pragma warning restore S3010
        }
Exemplo n.º 2
0
        public ShellView()
        {
            InitializeComponent();
            _isSuperMaximising = false;
            _isLocked          = true;
            HideFullScreenPanel.IsHitTestVisible = false;
            ShowFullScreenPanel.IsHitTestVisible = false;
            Loaded            += OnLoaded;
            KeyDown           += Shell_KeyDown;
            SourceInitialized += WinSourceInitialized;

            if (File.Exists(FilePath))
            {
                GetFilePath();
                using (FileStream fs = new FileStream(FilePath, FileMode.Open, FileAccess.Read))
                {
                    var streamReader = new StreamReader(fs);
                    _savedLayout = streamReader.ReadToEnd();
                }
                if (!string.IsNullOrEmpty(_savedLayout))
                {
                    try
                    {
                        DockManager.LoadLayout(_savedLayout);
                    }
                    catch (Exception err)
                    {
                        _savedLayout = null;
                        File.Delete(FilePath);
                        Dev2Logger.Error("Unable to load layout");
                        Dev2Logger.Error(err);
                    }
                }
            }

            _this = this;
        }