Compare commits
3 Commits
Author | SHA1 | Date | |
---|---|---|---|
eac10a46e6 | |||
|
32bd4a9142 | ||
|
49223ba8f0 |
@ -14,7 +14,7 @@
|
||||
<Copyright>Ray Lam</Copyright>
|
||||
<AssemblyVersion>1.0.0.0</AssemblyVersion>
|
||||
<FileVersion>1.0.0.0</FileVersion>
|
||||
<Version>0.6.2.092</Version>
|
||||
<Version>0.6.3.048</Version>
|
||||
<PackageId>bukkubuddy</PackageId>
|
||||
<RunAnalyzersDuringLiveAnalysis>True</RunAnalyzersDuringLiveAnalysis>
|
||||
<SupportedOSPlatformVersion>8.0</SupportedOSPlatformVersion>
|
||||
|
31
MainForm.cs
31
MainForm.cs
@ -748,9 +748,21 @@ namespace FizzyLauncher
|
||||
|
||||
InvalidateOptions();
|
||||
|
||||
// Load items
|
||||
// Clear treeview
|
||||
treeView1.Clear("New Session");
|
||||
|
||||
// Load directories
|
||||
foreach (var item in this.CurrentSession.Directories ?? new List<string>())
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(item))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
treeView1.CreateNodePath(item, (int)NodeIcon.Folder1, (int)NodeIcon.Folder2);
|
||||
}
|
||||
|
||||
// Load bookmarks
|
||||
foreach (var item in this.CurrentSession.Items ?? new List<BookmarkModel>())
|
||||
{
|
||||
treeView1.AddNode(item);
|
||||
@ -798,18 +810,11 @@ namespace FizzyLauncher
|
||||
this.CurrentSession.Width = this.Width;
|
||||
this.CurrentSession.Height = this.Height;
|
||||
|
||||
var nodeList = treeView1.ToNodeList<BookmarkModel>() ?? new List<KeyValuePair<TreeNode, BookmarkModel>>();
|
||||
foreach (var node in nodeList)
|
||||
{
|
||||
node.Value.Path = treeView1.GetNodePath(node.Key);
|
||||
var directoryList = treeView1.GetAllDirectories();
|
||||
var bookmarkList = treeView1.GetAllNodes();
|
||||
|
||||
if (node.Value.Path.Contains('\n'))
|
||||
{
|
||||
node.Value.Path = node.Value.Path.Substring(0, node.Value.Path.LastIndexOf('\n'));
|
||||
}
|
||||
}
|
||||
|
||||
this.CurrentSession.Items = nodeList.Select(x => x.Value).ToList();
|
||||
this.CurrentSession.Directories = directoryList ?? new List<string>();
|
||||
this.CurrentSession.Items = bookmarkList.Select(x => x.Value)?.ToList() ?? new List<BookmarkModel>();
|
||||
|
||||
var result = GenericResult.Create();
|
||||
|
||||
@ -825,7 +830,7 @@ namespace FizzyLauncher
|
||||
if (result.IsSuccess)
|
||||
{
|
||||
// Add icons to save file
|
||||
var result2 = AddImagesToZipFile(filename, nodeList);
|
||||
var result2 = AddImagesToZipFile(filename, bookmarkList);
|
||||
if (!result2.IsSuccess)
|
||||
{
|
||||
if (showNotices)
|
||||
|
@ -20,6 +20,8 @@ namespace FizzyLauncher.Models
|
||||
|
||||
public int Height { get; set; } = 0;
|
||||
|
||||
public List<string> Directories { get; set; } = new List<string>();
|
||||
|
||||
public List<BookmarkModel> Items { get; set; } = new List<BookmarkModel>();
|
||||
|
||||
}
|
||||
|
@ -1,7 +1,8 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Drawing;
|
||||
using System.Reflection;
|
||||
using System.Linq;
|
||||
using System.Windows.Forms;
|
||||
using bzit.bomg.Models;
|
||||
using FizzyLauncher;
|
||||
@ -421,6 +422,53 @@ namespace RyzStudio.Windows.Forms
|
||||
this.HasChanged = true;
|
||||
}
|
||||
|
||||
public List<string> GetAllDirectories()
|
||||
{
|
||||
var nodes = GetAllTreeNodes();
|
||||
nodes = nodes.Where(x => this.GetNodeType(x) == NodeType.Folder)?.ToList() ?? new List<TreeNode>();
|
||||
|
||||
var result = new List<string>();
|
||||
|
||||
foreach (var item in nodes)
|
||||
{
|
||||
result.Add(this.GetNodePath(item));
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
public List<KeyValuePair<TreeNode, BookmarkModel>> GetAllNodes()
|
||||
{
|
||||
var result = this.ToNodeList<BookmarkModel>() ?? new List<KeyValuePair<TreeNode, BookmarkModel>>();
|
||||
foreach (var node in result)
|
||||
{
|
||||
node.Value.Path = this.GetNodePath(node.Key);
|
||||
|
||||
if (node.Value.Path.Contains('\n'))
|
||||
{
|
||||
node.Value.Path = node.Value.Path.Substring(0, node.Value.Path.LastIndexOf('\n'));
|
||||
}
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
public List<TreeNode> GetAllTreeNodes()
|
||||
{
|
||||
var result = new List<TreeNode>();
|
||||
if (this.Nodes.Count <= 0)
|
||||
{
|
||||
return result;
|
||||
}
|
||||
|
||||
foreach (TreeNode node in this.Nodes)
|
||||
{
|
||||
TraverseNodeTree(result, node);
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
private void ClearImageList()
|
||||
{
|
||||
@ -468,5 +516,18 @@ namespace RyzStudio.Windows.Forms
|
||||
return this.ImageList.Images.IndexOfKey(key);
|
||||
}
|
||||
|
||||
protected void TraverseNodeTree(List<TreeNode> result, TreeNode node)
|
||||
{
|
||||
foreach (TreeNode node2 in node.Nodes)
|
||||
{
|
||||
result.Add(node2);
|
||||
|
||||
foreach (TreeNode node3 in node2.Nodes)
|
||||
{
|
||||
result.Add(node3);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
@ -2,13 +2,13 @@
|
||||
; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!
|
||||
|
||||
#define MyAppName "BukkuBuddy Bookmark Manager"
|
||||
#define MyAppVersion "0.6.2.092"
|
||||
#define MyAppVersion "0.6.3.048"
|
||||
#define MyAppPublisher "Hi, I'm Ray"
|
||||
#define MyAppURL "https://www.hiimray.co.uk/software-bookmark-manager"
|
||||
#define MyAppURL "https://www.hiimray.co.uk/software-bukkubuddy-bookmark-manager"
|
||||
#define MyAppExeName "bukkubuddy.exe"
|
||||
|
||||
#define AppSourcePath "L:\gitea-hiimray\bookmark-manager-r4\bin"
|
||||
#define AppReleasePath "L:\gitea-hiimray\bookmark-manager-r4\bin"
|
||||
#define AppSourcePath "L:\gitea-hiimray\bukkubuddy-bookmark-manager\bin"
|
||||
#define AppReleasePath "L:\gitea-hiimray\bukkubuddy-bookmark-manager\bin"
|
||||
#define AppReleaseName "bukkubuddy-installer"
|
||||
|
||||
[Setup]
|
||||
|
Reference in New Issue
Block a user