This repository has been archived by the owner on Dec 22, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #16 from MatthiWare/development
[UI] Update Generator
- Loading branch information
Showing
70 changed files
with
3,505 additions
and
325 deletions.
There are no files selected for viewing
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
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
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,38 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.IO; | ||
using System.Linq; | ||
using System.Text; | ||
|
||
namespace MatthiWare.UpdateLib.Generator.Data.FilesPage | ||
{ | ||
public class GenFile | ||
{ | ||
private FileInfo m_file; | ||
|
||
public string Name { get { return m_file.Name; } } | ||
public string RealPath { get { return m_file.FullName; } } | ||
public string Extension { get { return m_file.Extension; } } | ||
public string Size { get { return ConvertBytesToSizeString(m_file.Length); } } | ||
|
||
public GenFolder ParentFolder { get; set; } | ||
|
||
public ListViewItemFile FileListView { get; set; } | ||
|
||
public GenFile(FileInfo file) | ||
{ | ||
m_file = file; | ||
|
||
FileListView = new ListViewItemFile(file); | ||
} | ||
|
||
private static string ConvertBytesToSizeString(long size) | ||
{ | ||
size = Math.Max(0, size); | ||
|
||
double kb = Math.Ceiling(size / 1024.0); | ||
|
||
return $"{kb.ToString("N0")} kB"; | ||
} | ||
} | ||
} |
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,27 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
|
||
namespace MatthiWare.UpdateLib.Generator.Data.FilesPage | ||
{ | ||
public class GenFolder | ||
{ | ||
public string Name { get; set; } | ||
public List<GenFile> Files { get; private set; } = new List<GenFile>(); | ||
public List<GenFolder> Directories { get; private set; } = new List<GenFolder>(); | ||
public GenFolder ParentFolder { get; set; } | ||
public bool IsRoot { get { return ParentFolder == null; } } | ||
|
||
|
||
public ListViewItemFolder FolderListView { get; set; } | ||
public TreeViewFolderNode FolderTreeView { get; set; } | ||
|
||
|
||
public GenFolder(string name) | ||
{ | ||
Name = name; | ||
} | ||
|
||
} | ||
} |
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,33 @@ | ||
using MatthiWare.UpdateLib.Generator.Data.FilesPage; | ||
using System; | ||
using System.Collections.Generic; | ||
using System.IO; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Windows.Forms; | ||
|
||
namespace MatthiWare.UpdateLib.Generator.Data | ||
{ | ||
public class ListViewItemFile : ListViewItem | ||
{ | ||
public GenFile File { get; set; } | ||
|
||
private ListViewItemFile(string[] items, string imageKey) | ||
: base(items, imageKey) | ||
{ } | ||
|
||
public ListViewItemFile(FileInfo file) | ||
: this(new string[] { "", file.Name, file.LastWriteTime.ToString(), "File", ConvertBytesToSizeString(file.Length)}, file.Extension) | ||
{ | ||
} | ||
|
||
private static string ConvertBytesToSizeString(long size) | ||
{ | ||
size = Math.Max(0, size); | ||
|
||
double kb = Math.Ceiling(size / 1024.0); | ||
|
||
return $"{kb.ToString("N0")} kB"; | ||
} | ||
} | ||
} |
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,26 @@ | ||
using MatthiWare.UpdateLib.Generator.Data.FilesPage; | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Windows.Forms; | ||
|
||
namespace MatthiWare.UpdateLib.Generator.Data | ||
{ | ||
public class ListViewItemFolder : ListViewItem | ||
{ | ||
internal const string FOLDER_KEY = "folderimagekey"; | ||
|
||
public GenFolder Folder { get; set; } | ||
|
||
private ListViewItemFolder(string[] items, string imageKey) | ||
: base(items, imageKey) | ||
{ } | ||
|
||
public ListViewItemFolder(string folderName, GenFolder folder) | ||
: this(new string[] { "", folderName, "", "Folder", "" }, FOLDER_KEY) | ||
{ | ||
Folder = folder; | ||
} | ||
} | ||
} |
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 @@ | ||
using MatthiWare.UpdateLib.Generator.Data.FilesPage; | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Windows.Forms; | ||
|
||
namespace MatthiWare.UpdateLib.Generator.Data | ||
{ | ||
public class TreeViewFolderNode : TreeNode | ||
{ | ||
internal const string FOLDER_KEY = "folderimagekey"; | ||
|
||
public GenFolder Folder { get; set; } | ||
|
||
public TreeViewFolderNode(string folderName, GenFolder folder) | ||
{ | ||
Text = folderName; | ||
ImageKey = FOLDER_KEY; | ||
SelectedImageKey = FOLDER_KEY; | ||
Folder = folder; | ||
} | ||
|
||
} | ||
} |
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,22 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
|
||
namespace MatthiWare.UpdateLib.Generator.Files | ||
{ | ||
[Serializable] | ||
public class ProjectFile | ||
{ | ||
|
||
#region General Info | ||
#endregion | ||
|
||
#region Files | ||
#endregion | ||
|
||
#region Registry | ||
#endregion | ||
|
||
} | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.