Beispiel #1
0
        private void TabContextFlyout_Opening(object sender, object e)
        {
            if (_textEditor.EditingFile != null)
            {
                _filePath             = _textEditor.EditingFile.Path;
                _containingFolderPath = Path.GetDirectoryName(_filePath);
            }

            CloseOthers.IsEnabled          = CloseRight.IsEnabled = _notepadsCore.GetNumberOfOpenedTextEditors() > 1;
            CopyFullPath.IsEnabled         = !string.IsNullOrEmpty(_filePath);
            OpenContainingFolder.IsEnabled = !string.IsNullOrEmpty(_containingFolderPath);
        }
        private void TabContextFlyout_Opening(object sender, object e)
        {
            var isFileReadonly = false;

            if (_textEditor.EditingFile != null)
            {
                _filePath             = _textEditor.EditingFile.Path;
                _containingFolderPath = Path.GetDirectoryName(_filePath);
                isFileReadonly        = FileSystemUtility.IsFileReadOnly(_textEditor.EditingFile);
            }

            CloseOthers.IsEnabled          = CloseRight.IsEnabled = _notepadsCore.GetNumberOfOpenedTextEditors() > 1;
            CopyFullPath.IsEnabled         = !string.IsNullOrEmpty(_filePath);
            OpenContainingFolder.IsEnabled = !string.IsNullOrEmpty(_containingFolderPath);
            Rename.IsEnabled = _textEditor.FileModificationState != FileModificationState.RenamedMovedOrDeleted && !isFileReadonly;

            if (App.IsGameBarWidget)
            {
                OpenContainingFolder.Visibility = Visibility.Collapsed;
            }
        }