-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
9b44ec7
commit ffb48df
Showing
6 changed files
with
678 additions
and
30 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,32 +1,103 @@ | ||
using MaterialSkin; | ||
using MaterialSkin.Controls; | ||
using MaterialSkinPlus; | ||
using MaterialSkinPlus.Controls; | ||
using System; | ||
using System.Collections.Generic; | ||
using System.ComponentModel; | ||
using System.Data; | ||
using System.Drawing; | ||
using System.IO; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
using System.Windows.Forms; | ||
using EasyTabs; | ||
|
||
namespace DenebStudio | ||
{ | ||
public partial class DenebStudio : MaterialForm | ||
{ | ||
protected TitleBarTabs ParentTabs | ||
{ | ||
get | ||
{ | ||
return (ParentForm as TitleBarTabs); | ||
} | ||
} | ||
|
||
public DenebStudio() | ||
{ | ||
InitializeComponent(); | ||
InitializeMaterialTheme(); | ||
ListDirectory(trvProjectDirectory, "C:\\Users\\rband\\Documents\\Try\\numberedTextbox_src"); | ||
} | ||
|
||
private void InitializeMaterialTheme() | ||
{ | ||
var materialSkinManager = MaterialSkinManager.Instance; | ||
materialSkinManager.AddFormToManage(this); | ||
materialSkinManager.Theme = MaterialSkinManager.Themes.LIGHT; | ||
materialSkinManager.Theme = MaterialSkinManager.Themes.DARK; | ||
materialSkinManager.ColorScheme = new ColorScheme(Primary.Blue800, Primary.Blue900, Primary.Blue500, Accent.LightBlue200, TextShade.WHITE); | ||
} | ||
|
||
private void ListDirectory(TreeView treeView, string path) | ||
{ | ||
treeView.Nodes.Clear(); | ||
var rootDirectoryInfo = new DirectoryInfo(path); | ||
treeView.Nodes.Add(CreateDirectoryNode(rootDirectoryInfo)); | ||
} | ||
|
||
private static TreeNode CreateDirectoryNode(DirectoryInfo directoryInfo) | ||
{ | ||
var directoryNode = new TreeNode(directoryInfo.Name); | ||
foreach (var directory in directoryInfo.GetDirectories()) | ||
directoryNode.Nodes.Add(CreateDirectoryNode(directory)); | ||
foreach (var file in directoryInfo.GetFiles()) | ||
directoryNode.Nodes.Add(new TreeNode(file.Name) { Tag = file.FullName }); | ||
return directoryNode; | ||
} | ||
|
||
private string GetFileName(string fullPath) | ||
{ | ||
string name = string.Empty; | ||
bool incomplete = true; | ||
for (int i = fullPath.Length-1; i >= 0; i--) | ||
{ | ||
if (fullPath[i] == '\\') | ||
{ | ||
incomplete = false; | ||
} | ||
if (incomplete) | ||
{ | ||
name += fullPath[i]; | ||
} | ||
} | ||
|
||
char[] arr = name.ToCharArray(); | ||
Array.Reverse(arr); | ||
return new string(arr); | ||
|
||
} | ||
|
||
private void trvProjectDirectory_AfterSelect(object sender, TreeViewEventArgs e) | ||
{ | ||
if (e.Node.Nodes.Count == 0) | ||
{ | ||
if (e.Node.Tag != null) | ||
{ | ||
if (tabOpenedFiles.TabPages[0].Text == "Empty") | ||
{ | ||
tabOpenedFiles.TabPages[0].Text = GetFileName(e.Node.Tag.ToString()); | ||
materialTabSelector1.Refresh(); | ||
} | ||
txtCode.richTextBox1.Text = File.ReadAllText(e.Node.Tag.ToString()); | ||
} | ||
} | ||
} | ||
|
||
private void tabOpenedFiles_SelectedIndexChanged(object sender, EventArgs e) | ||
{ | ||
//MessageBox.Show(e.ToString()); | ||
|
||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
MetroFramework - Modern UI for WinForms | ||
|
||
Copyright (c) 2013 Jens Thiel, http://thielj.github.io/MetroFramework | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy of | ||
this software and associated documentation files (the "Software"), to deal in the | ||
Software without restriction, including without limitation the rights to use, copy, | ||
modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, | ||
and to permit persons to whom the Software is furnished to do so, subject to the | ||
following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in | ||
all copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, | ||
INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A | ||
PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT | ||
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF | ||
CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE | ||
OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. | ||
|
||
|
||
Portions of this software are: | ||
|
||
Copyright (c) 2011 Sven Walter, http://github.com/viperneo |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,14 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<packages> | ||
<package id="EasyTabs" version="1.3.3.0" targetFramework="net472" /> | ||
<package id="MaterialSkin.Updated" version="0.2.2" targetFramework="net472" /> | ||
<package id="MetroFramework" version="1.2.0.3" targetFramework="net472" /> | ||
<package id="MetroFramework.Design" version="1.2.0.3" targetFramework="net472" /> | ||
<package id="MetroFramework.Fonts" version="1.2.0.3" targetFramework="net472" /> | ||
<package id="MetroFramework.RunTime" version="1.2.0.3" targetFramework="net472" /> | ||
<package id="Win32Interop.Dwmapi" version="1.0.1" targetFramework="net472" /> | ||
<package id="Win32Interop.Gdi32" version="1.0.1" targetFramework="net472" /> | ||
<package id="Win32Interop.Kernel32" version="1.0.1" targetFramework="net472" /> | ||
<package id="Win32Interop.User32" version="1.0.1" targetFramework="net472" /> | ||
<package id="Win32Interop.Uxtheme" version="1.0.1" targetFramework="net472" /> | ||
</packages> |