Skip to content

Commit

Permalink
Add Basics
Browse files Browse the repository at this point in the history
  • Loading branch information
andresruizdev committed Sep 25, 2019
1 parent 9b44ec7 commit ffb48df
Show file tree
Hide file tree
Showing 6 changed files with 678 additions and 30 deletions.
550 changes: 526 additions & 24 deletions DenebStudio/DenebStudio/DenebStudio.Designer.cs

Large diffs are not rendered by default.

77 changes: 74 additions & 3 deletions DenebStudio/DenebStudio/DenebStudio.cs
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());

}
}
}
40 changes: 39 additions & 1 deletion DenebStudio/DenebStudio/DenebStudio.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,28 @@
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="EasyTabs, Version=1.3.3.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\EasyTabs.1.3.3.0\lib\net40\EasyTabs.dll</HintPath>
</Reference>
<Reference Include="MaterialSkin, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\MaterialSkin.Updated.0.2.2\lib\MaterialSkin.dll</HintPath>
<SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\MaterialSkinPlus\lib\MaterialSkin.dll</HintPath>
</Reference>
<Reference Include="MetroFramework, Version=1.2.0.3, Culture=neutral, PublicKeyToken=5f91a84759bf584a, processorArchitecture=MSIL">
<HintPath>..\packages\MetroFramework.RunTime.1.2.0.3\lib\net40-Client\MetroFramework.dll</HintPath>
</Reference>
<Reference Include="MetroFramework.Design, Version=1.2.0.3, Culture=neutral, PublicKeyToken=5f91a84759bf584a, processorArchitecture=MSIL">
<HintPath>..\packages\MetroFramework.Design.1.2.0.3\lib\net40\MetroFramework.Design.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="MetroFramework.Fonts, Version=1.2.0.3, Culture=neutral, PublicKeyToken=5f91a84759bf584a, processorArchitecture=MSIL">
<HintPath>..\packages\MetroFramework.Fonts.1.2.0.3\lib\net40\MetroFramework.Fonts.dll</HintPath>
</Reference>
<Reference Include="Microsoft.WindowsAPICodePack, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\EasyTabs.1.3.3.0\lib\net40\Microsoft.WindowsAPICodePack.dll</HintPath>
</Reference>
<Reference Include="Microsoft.WindowsAPICodePack.Shell, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\EasyTabs.1.3.3.0\lib\net40\Microsoft.WindowsAPICodePack.Shell.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
Expand All @@ -47,6 +67,21 @@
<Reference Include="System.Net.Http" />
<Reference Include="System.Windows.Forms" />
<Reference Include="System.Xml" />
<Reference Include="Win32Interop.Dwmapi, Version=1.0.1.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\Win32Interop.Dwmapi.1.0.1\lib\Win32Interop.Dwmapi.dll</HintPath>
</Reference>
<Reference Include="Win32Interop.Gdi32, Version=1.0.1.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\Win32Interop.Gdi32.1.0.1\lib\Win32Interop.Gdi32.dll</HintPath>
</Reference>
<Reference Include="Win32Interop.Kernel32, Version=1.0.1.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\Win32Interop.Kernel32.1.0.1\lib\Win32Interop.Kernel32.dll</HintPath>
</Reference>
<Reference Include="Win32Interop.User32, Version=1.0.1.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\Win32Interop.User32.1.0.1\lib\Win32Interop.User32.dll</HintPath>
</Reference>
<Reference Include="Win32Interop.Uxtheme, Version=1.0.1.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\Win32Interop.Uxtheme.1.0.1\lib\Win32Interop.Uxtheme.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup>
<Compile Include="DenebStudio.cs">
Expand Down Expand Up @@ -92,5 +127,8 @@
<ItemGroup>
<None Include="App.config" />
</ItemGroup>
<ItemGroup>
<Content Include="MetroFramework.txt" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>
6 changes: 4 additions & 2 deletions DenebStudio/DenebStudio/IndexedTextbox.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

25 changes: 25 additions & 0 deletions DenebStudio/DenebStudio/MetroFramework.txt
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
10 changes: 10 additions & 0 deletions DenebStudio/DenebStudio/packages.config
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>

0 comments on commit ffb48df

Please sign in to comment.