Beispiel #1
0
        /// <summary>
        /// Creates a tab and shows a project file, if the tab is already created it is made active
        /// </summary>
        /// <param name="file">The file to show</param>
        public void ShowProjectFile(OpenedFile file)
        {
            if (IsProjectFileShown(file))
            {
                MakeProjectFileActive(file);
                return;
            }

            if (File.Exists(file.FullName))
            {
                file.Valid = true;
                file.Node.ImageKey = "code";
                file.Node.SelectedImageKey = "code";
            }
            else
            {
                Util.ShowError(StringTable.ProjectFileLost.Replace("%FILE%", file.Name));
                return;
            }

            if (_fileLoading) return;
            _fileLoading = true;

            var ct = new CodeTab(file) {TabText = file.Name};
            ct.Show(Manager);

            file.Editor = ct.Editor;

            _fileLoading = false;
        }
Beispiel #2
0
        /// <summary>
        /// Creates and shows a tab for an opened file which is sperate from the project
        /// </summary>
        /// <param name="file">The file to open</param>
        public void ShowOpenedFile(OpenedFile file)
        {
            _fileLoading = true;

            var ct = new CodeTab(file) {TabText = file.Name};
            ct.Show(Manager);

            if (file.Editor == null)
                file.Editor = ct.Editor;

            _fileLoading = false;
        }