Inheritance: System.Windows.Forms.TabPage
コード例 #1
0
ファイル: FileManager.cs プロジェクト: remco138/amanda
        private void OpenExistingFile(string pathToFile)
        {
            // Is this file already open?
            //
            foreach (FileEditorTab page in TabPages)
            {
                if (page.FileLocation == pathToFile)
                {
                    return;
                }
            }


            // Read file & Open a new Tab
            //
            try
            {
                String txt = File.ReadAllText(pathToFile);

                FileEditorTab newPage = new FileEditorTab();
                newPage.FileLocation = pathToFile;
                newPage.Content      = txt;

                this.TabPages.Add(newPage);
                SelectedIndex = TabCount - 1;
            }
            catch (IOException ex)
            {
                Console.WriteLine("Unable to open file: {0}", ex.Message);
            }
        }
コード例 #2
0
ファイル: FileManager.cs プロジェクト: remco138/amanda
        public void AddNewFile()
        {
            // Add a new FileEditorTab (which has a FastColoredTextbox inside it)
            FileEditorTab newPage = new FileEditorTab();

            newPage.Padding = new System.Windows.Forms.Padding(3);

            this.TabPages.Add(newPage);
            SelectedIndex = TabCount - 1;
        }
コード例 #3
0
ファイル: FileManager.cs プロジェクト: remco138/amanda
        public void CloseFile(FileEditorTab fileTab)
        {
            // TODO: Make AskToSaveFile so that it also has a CANCEL button
            //
            fileTab.AskToSaveFile();
            TabPages.Remove(fileTab);

            if (TabCount == 0)
            {
                this.AddNewFile();
            }
        }
コード例 #4
0
ファイル: FileManager.cs プロジェクト: remco138/amanda
        private void OpenExistingFile(string pathToFile)
        {
            // Is this file already open?
            //
            foreach (FileEditorTab page in TabPages)
            {
                if (page.FileLocation == pathToFile)
                    return;
            }

            // Read file & Open a new Tab
            //
            try
            {
                String txt = File.ReadAllText(pathToFile);

                FileEditorTab newPage = new FileEditorTab();
                newPage.FileLocation = pathToFile;
                newPage.Content = txt;

                this.TabPages.Add(newPage);
                SelectedIndex = TabCount - 1;
            }
            catch (IOException ex)
            {
                Console.WriteLine("Unable to open file: {0}", ex.Message);
            }
        }
コード例 #5
0
ファイル: FileManager.cs プロジェクト: remco138/amanda
        public void CloseFile(FileEditorTab fileTab)
        {
            // TODO: Make AskToSaveFile so that it also has a CANCEL button
            //
            fileTab.AskToSaveFile();
            TabPages.Remove(fileTab);

            if (TabCount == 0)
            {
                this.AddNewFile();
            }
        }
コード例 #6
0
ファイル: FileManager.cs プロジェクト: remco138/amanda
        public void AddNewFile()
        {
            // Add a new FileEditorTab (which has a FastColoredTextbox inside it)
            FileEditorTab newPage = new FileEditorTab();
            newPage.Padding = new System.Windows.Forms.Padding(3);

            this.TabPages.Add(newPage);
            SelectedIndex = TabCount - 1;
        }