Initial commit

This commit is contained in:
Ray 2021-09-07 12:32:24 +01:00
commit 1cdcca7267
143 changed files with 18199 additions and 0 deletions

6
.gitignore vendored Normal file
View File

@ -0,0 +1,6 @@
/.vs
/bin
/obj
*.user
*.pubxml.user
*.csproj.user

160
AppResource.Designer.cs generated Normal file
View File

@ -0,0 +1,160 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.42000
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace BookmarkManager {
using System;
/// <summary>
/// A strongly-typed resource class, for looking up localized strings, etc.
/// </summary>
// This class was auto-generated by the StronglyTypedResourceBuilder
// class via a tool like ResGen or Visual Studio.
// To add or remove a member, edit your .ResX file then rerun ResGen
// with the /str option, or rebuild your VS project.
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "16.0.0.0")]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
internal class AppResource {
private static global::System.Resources.ResourceManager resourceMan;
private static global::System.Globalization.CultureInfo resourceCulture;
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
internal AppResource() {
}
/// <summary>
/// Returns the cached ResourceManager instance used by this class.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Resources.ResourceManager ResourceManager {
get {
if (object.ReferenceEquals(resourceMan, null)) {
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("BookmarkManager.AppResource", typeof(AppResource).Assembly);
resourceMan = temp;
}
return resourceMan;
}
}
/// <summary>
/// Overrides the current thread's CurrentUICulture property for all
/// resource lookups using this strongly typed resource class.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Globalization.CultureInfo Culture {
get {
return resourceCulture;
}
set {
resourceCulture = value;
}
}
/// <summary>
/// Looks up a localized string similar to Ray Lam.
/// </summary>
internal static string app_author {
get {
return ResourceManager.GetString("app_author", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Bookmark Manager.
/// </summary>
internal static string app_name {
get {
return ResourceManager.GetString("app_name", resourceCulture);
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap file_text {
get {
object obj = ResourceManager.GetObject("file_text", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap folder {
get {
object obj = ResourceManager.GetObject("folder", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap folder_32 {
get {
object obj = ResourceManager.GetObject("folder_32", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap folder_explore {
get {
object obj = ResourceManager.GetObject("folder_explore", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap hexagon {
get {
object obj = ResourceManager.GetObject("hexagon", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap toggle_left_ea_16 {
get {
object obj = ResourceManager.GetObject("toggle_left_ea_16", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap toggle_right_ea_16 {
get {
object obj = ResourceManager.GetObject("toggle_right_ea_16", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Looks up a localized string similar to https://www.hiimray.co.uk/software-bookmark-manager.
/// </summary>
internal static string url_help {
get {
return ResourceManager.GetString("url_help", resourceCulture);
}
}
}
}

151
AppResource.resx Normal file
View File

@ -0,0 +1,151 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=5.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=5.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="app_author" xml:space="preserve">
<value>Ray Lam</value>
</data>
<data name="app_name" xml:space="preserve">
<value>Bookmark Manager</value>
</data>
<assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=5.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<data name="file_text" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>Resources\file-text.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="folder" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>Resources\folder.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="folder_32" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>Resources\folder_32.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="folder_explore" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>Resources\folder_explore.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="hexagon" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>Resources\hexagon.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="toggle_left_ea_16" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>Resources\toggle-left-ea-16.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="toggle_right_ea_16" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>Resources\toggle-right-ea-16.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="url_help" xml:space="preserve">
<value>https://www.hiimray.co.uk/software-bookmark-manager</value>
</data>
</root>

134
BookmarkManager.csproj Normal file
View File

@ -0,0 +1,134 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>WinExe</OutputType>
<TargetFramework>net5.0-windows</TargetFramework>
<UseWindowsForms>true</UseWindowsForms>
<NoWin32Manifest>true</NoWin32Manifest>
<ApplicationIcon>favicon.ico</ApplicationIcon>
<SignAssembly>false</SignAssembly>
<AssemblyName>bookmarkmanager</AssemblyName>
<Authors>Ray Lam</Authors>
<Company>Hi, I'm Ray</Company>
<Product>Bookmark Manager</Product>
<Copyright>Ray Lam</Copyright>
<AssemblyVersion>0.4.0.061</AssemblyVersion>
<FileVersion>0.4.0.061</FileVersion>
<Version>0.4.0.061</Version>
<PackageId>bookmarkmanager</PackageId>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
<OutputPath>bin\Debug\</OutputPath>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
<DebugType>none</DebugType>
<DebugSymbols>false</DebugSymbols>
</PropertyGroup>
<ItemGroup>
<Compile Remove="#\**" />
<Compile Remove="RyzStudio\Data\**" />
<Compile Remove="RyzStudio\IO\**" />
<Compile Remove="RyzStudio\Net\**" />
<EmbeddedResource Remove="#\**" />
<EmbeddedResource Remove="RyzStudio\Data\**" />
<EmbeddedResource Remove="RyzStudio\IO\**" />
<EmbeddedResource Remove="RyzStudio\Net\**" />
<None Remove="#\**" />
<None Remove="RyzStudio\Data\**" />
<None Remove="RyzStudio\IO\**" />
<None Remove="RyzStudio\Net\**" />
</ItemGroup>
<ItemGroup>
<Compile Remove="Models\TileGroupModel.cs" />
<Compile Remove="Models\TileModel.cs" />
<Compile Remove="NewForm.cs" />
<Compile Remove="OpenFileForm.cs" />
<Compile Remove="RyzStudio\Windows\Forms\StackLayoutPanel.cs" />
<Compile Remove="RyzStudio\Windows\Forms\TFlatButton.cs" />
<Compile Remove="RyzStudio\Windows\Forms\TForm.cs" />
<Compile Remove="RyzStudio\Windows\Forms\TPanelBook.cs" />
<Compile Remove="RyzStudio\Windows\ThemedForms\BorderlessForm.cs" />
<Compile Remove="RyzStudio\Windows\ThemedForms\BorderlessForm.Designer.cs" />
<Compile Remove="RyzStudio\Windows\ThemedForms\BorderlessToolForm.cs" />
<Compile Remove="RyzStudio\Windows\ThemedForms\BorderlessToolForm.Designer.cs" />
<Compile Remove="Windows\Forms\BookmarkTreeViewSNode.cs" />
<Compile Remove="Windows\Forms\EditGroupForm.cs" />
<Compile Remove="Windows\Forms\EditTileFolderForm.cs" />
<Compile Remove="Windows\Forms\EditTileForm.cs" />
<Compile Remove="Windows\Forms\TileContainer.cs" />
<Compile Remove="Windows\Forms\TilePanel.cs" />
<Compile Remove="Windows\Forms\TilePanel.Designer.cs" />
<Compile Remove="Windows\Forms\TilePanelLayout.cs" />
<Compile Remove="Windows\Forms\TilePanelLayout.Designer.cs" />
</ItemGroup>
<ItemGroup>
<EmbeddedResource Remove="NewForm.resx" />
<EmbeddedResource Remove="OpenFileForm.resx" />
<EmbeddedResource Remove="RyzStudio\Windows\Forms\TForm.resx" />
<EmbeddedResource Remove="RyzStudio\Windows\ThemedForms\BorderlessForm.resx" />
<EmbeddedResource Remove="RyzStudio\Windows\ThemedForms\BorderlessToolForm.resx" />
<EmbeddedResource Remove="Windows\Forms\EditGroupForm.resx" />
<EmbeddedResource Remove="Windows\Forms\EditTileFolderForm.resx" />
<EmbeddedResource Remove="Windows\Forms\EditTileForm.resx" />
<EmbeddedResource Remove="Windows\Forms\TileContainer.resx" />
<EmbeddedResource Remove="Windows\Forms\TilePanel.resx" />
<EmbeddedResource Remove="Windows\Forms\TilePanelLayout.resx" />
</ItemGroup>
<ItemGroup>
<None Remove=".gitignore" />
<None Remove="installer-64.iss" />
<None Remove="installer-86.iss" />
</ItemGroup>
<ItemGroup>
<Compile Include="RyzStudio\IO\FileType.cs" />
<Compile Include="RyzStudio\IO\SharpZipLib.cs" />
<Compile Include="RyzStudio\Net\HttpWeb.cs" />
</ItemGroup>
<ItemGroup>
<Compile Update="AppResource.Designer.cs">
<DesignTime>True</DesignTime>
<AutoGen>True</AutoGen>
<DependentUpon>AppResource.resx</DependentUpon>
</Compile>
<Compile Update="PasswordForm.cs">
<SubType>Form</SubType>
</Compile>
<Compile Update="RyzStudio\Windows\ThemedForms\TextBox\TKeyCodeTextBox.cs">
<SubType>UserControl</SubType>
</Compile>
<Compile Update="UIResource.Designer.cs">
<DesignTime>True</DesignTime>
<AutoGen>True</AutoGen>
<DependentUpon>UIResource.resx</DependentUpon>
</Compile>
</ItemGroup>
<ItemGroup>
<EmbeddedResource Update="AppResource.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>AppResource.Designer.cs</LastGenOutput>
</EmbeddedResource>
<EmbeddedResource Update="RyzStudio\Windows\ThemedForms\TextBox\TFolderTextBox - Copy.resx">
<DependentUpon>TFolderTextBox.resx</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Update="UIResource.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>UIResource.Designer.cs</LastGenOutput>
</EmbeddedResource>
</ItemGroup>
<ItemGroup>
<PackageReference Include="HtmlAgilityPack" Version="1.11.34" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
<PackageReference Include="SharpZipLib" Version="1.3.2" />
</ItemGroup>
</Project>

25
BookmarkManager.sln Normal file
View File

@ -0,0 +1,25 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16
VisualStudioVersion = 16.0.31410.357
MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BookmarkManager", "BookmarkManager.csproj", "{4833FB27-0817-4720-A54B-180369B0C374}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{4833FB27-0817-4720-A54B-180369B0C374}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{4833FB27-0817-4720-A54B-180369B0C374}.Debug|Any CPU.Build.0 = Debug|Any CPU
{4833FB27-0817-4720-A54B-180369B0C374}.Release|Any CPU.ActiveCfg = Release|Any CPU
{4833FB27-0817-4720-A54B-180369B0C374}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {CB4C1DB0-19FE-4AA0-9621-D66FAC4CF7C5}
EndGlobalSection
EndGlobal

29
Classes/Result.cs Normal file
View File

@ -0,0 +1,29 @@
namespace BookmarkManager
{
public class Result
{
public static Result Create() => new Result()
{
IsSuccess = true,
Message = null
};
public static Result Create(bool isSuccess) => new Result()
{
IsSuccess = isSuccess,
Message = null
};
public static Result Create(bool isSuccess, string message) => new Result()
{
IsSuccess = isSuccess,
Message = message
};
public bool IsSuccess { get; set; } = false;
public string Message { get; set; }
}
}

View File

@ -0,0 +1,21 @@
using RyzStudio.Windows.Forms;
namespace BookmarkManager
{
public interface ISupportedFile
{
bool IsEncryptionSupported { get; set; }
bool IsSupported(string filename);
bool IsEncrypted(string filename);
Result Load(BookmarkTreeView treeview, string filename, string password);
Result Save(BookmarkTreeView treeview, string filename, string password);
}
}

View File

@ -0,0 +1,84 @@
using BookmarkManager.DTO;
using bzit.bomg.Models;
using ICSharpCode.SharpZipLib.Zip;
using Newtonsoft.Json;
using RyzStudio.IO;
using RyzStudio.Windows.Forms;
using System;
using System.Collections.Generic;
using System.IO;
using System.Windows.Forms;
namespace BookmarkManager
{
public class JSNXSupportedFile : SupportedFileBase
{
public JSNXSupportedFile()
{
supportedExtensions = new List<string>() { ".jsnx" };
}
public override bool IsEncryptionSupported { get; set; } = true;
public override bool IsEncrypted(string filename) => SharpZipLib.IsZipEncrypted(filename);
public override Result Load(BookmarkTreeView treeview, string filename, string password)
{
treeview.Clear();
if (!SharpZipLib.TestArchive(filename, password))
{
return Result.Create(false, "Could not read file, is password correct?");
}
string sourceCode = SharpZipLib.ReadSingle(filename, password, "bookmarks.json");
if (string.IsNullOrWhiteSpace(sourceCode))
{
return Result.Create(false, "Could not read file, unexpected format");
}
List<BookmarkItemViewModel> rs = JsonConvert.DeserializeObject<List<BookmarkItemViewModel>>(sourceCode);
if (rs == null)
{
return Result.Create(false, "Could not read file, incorrect format");
}
//// load bookmark items
//ThreadControl.SetValue(progressBar1, 0, rs.Count);
for (int i = 0; i < rs.Count; i++)
{
// ThreadControl.SetValue(progressBar1, (i + 1));
if (treeview.InvokeRequired)
{
treeview.Invoke(new MethodInvoker(() => {
treeview.AddItem(rs[i]);
}));
}
else
{
treeview.AddItem(rs[i]);
}
}
treeview.SetNoChanges();
return Result.Create(true);
}
public override Result Save(BookmarkTreeView treeview, string filename, string password)
{
List<BookmarkItemViewModel> rs = treeview.GetBookmarkList();
bool rv = SharpZipLib.CreateSingle(filename, password, "bookmarks.json", JsonConvert.SerializeObject(rs));
return Result.Create(rv);
}
}
}

View File

@ -0,0 +1,33 @@
using RyzStudio.IO;
using RyzStudio.Windows.Forms;
using System.Collections.Generic;
namespace BookmarkManager
{
public class RYZSupportedFile : SupportedFileBase
{
public RYZSupportedFile()
{
supportedExtensions = new List<string>() { ".ryz" };
}
public override bool IsEncryptionSupported { get; set; } = true;
public override bool IsEncrypted(string filename) => SharpZipLib.IsZipEncrypted(filename);
public override Result Load(BookmarkTreeView treeview, string filename, string password)
{
return Result.Create(false);
}
public override Result Save(BookmarkTreeView treeview, string filename, string password)
{
return Result.Create(false);
}
}
}

View File

@ -0,0 +1,47 @@
using RyzStudio.Windows.Forms;
using System.Collections.Generic;
using System.IO;
namespace BookmarkManager
{
public abstract class SupportedFileBase : ISupportedFile
{
protected List<string> supportedExtensions = new List<string>();
public SupportedFileBase()
{
}
public virtual bool IsEncryptionSupported { get; set; } = false;
public virtual bool IsSupported(string filename)
{
if (string.IsNullOrWhiteSpace(filename))
{
return false;
}
if (supportedExtensions == null)
{
return false;
}
if (supportedExtensions.Count <= 0)
{
return false;
}
return supportedExtensions.Contains(Path.GetExtension(filename)?.Trim()?.ToLower());
}
public virtual bool IsEncrypted(string filename) => false;
public virtual Result Load(BookmarkTreeView treeview, string filename, string password) => Result.Create(false);
public virtual Result Save(BookmarkTreeView treeview, string filename, string password) => Result.Create(false);
}
}

40
DTO/BookmarkItem.cs Normal file
View File

@ -0,0 +1,40 @@
using System.Text;
namespace BookmarkManager.DTO
{
public class BookmarkItem
{
public string SiteName { get; set; }
public string SiteAddress { get; set; }
public string SiteDescription { get; set; }
public string FaviconAddress { get; set; }
public string TreeviewPath { get; set; }
//public BookmarkItemModel ToModel()
//{
// return new BookmarkItemModel()
// {
// SiteName = this.SiteName,
// SiteAddress = this.SiteAddress,
// SiteDescription = this.SiteDescription,
// FaviconAddress = this.FaviconAddress,
// TreeviewPath = this.TreeviewPath
// };
//}
public new string ToString()
{
StringBuilder sb = new StringBuilder();
sb.AppendLine("Name = " + this.SiteName ?? string.Empty);
sb.AppendLine("Address = " + this.SiteAddress ?? string.Empty);
sb.AppendLine("Description = " + this.SiteDescription ?? string.Empty);
return sb.ToString();
}
}
}

350
MainForm.Designer.cs generated Normal file
View File

@ -0,0 +1,350 @@
namespace FizzyLauncher
{
partial class MainForm
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.components = new System.ComponentModel.Container();
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(MainForm));
this.saveFileDialog1 = new System.Windows.Forms.SaveFileDialog();
this.contextMenuStrip2 = new System.Windows.Forms.ContextMenuStrip(this.components);
this.exitToolStripMenuItem1 = new System.Windows.Forms.ToolStripMenuItem();
this.menuStrip1 = new System.Windows.Forms.MenuStrip();
this.fileToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.newToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.openToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.toolStripMenuItem13 = new System.Windows.Forms.ToolStripSeparator();
this.closeToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.toolStripMenuItem14 = new System.Windows.Forms.ToolStripSeparator();
this.saveToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.saveAsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.toolStripMenuItem15 = new System.Windows.Forms.ToolStripSeparator();
this.exitToolStripMenuItem2 = new System.Windows.Forms.ToolStripMenuItem();
this.toolStripMenuItem1 = new System.Windows.Forms.ToolStripMenuItem();
this.findToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.viewToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.expandAllToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.collapseAllToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.toolStripSeparator1 = new System.Windows.Forms.ToolStripSeparator();
this.alwaysOnTopToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.toolsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.optionsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.helpToolStripMenuItem1 = new System.Windows.Forms.ToolStripMenuItem();
this.viewHelpToolStripMenuItem1 = new System.Windows.Forms.ToolStripMenuItem();
this.toolStripMenuItem16 = new System.Windows.Forms.ToolStripSeparator();
this.aboutToolStripMenuItem1 = new System.Windows.Forms.ToolStripMenuItem();
this.treeView1 = new RyzStudio.Windows.Forms.BookmarkTreeView();
this.openFileDialog1 = new System.Windows.Forms.OpenFileDialog();
this.contextMenuStrip2.SuspendLayout();
this.menuStrip1.SuspendLayout();
this.SuspendLayout();
//
// saveFileDialog1
//
this.saveFileDialog1.DefaultExt = "jsnx";
this.saveFileDialog1.Filter = "Bookmarks files (*.jsnx)|*.jsnx|Bookmarks files (*.ryz)|*.ryz";
this.saveFileDialog1.Title = "Save bookmarks file";
//
// contextMenuStrip2
//
this.contextMenuStrip2.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.exitToolStripMenuItem1});
this.contextMenuStrip2.Name = "contextMenuStrip2";
this.contextMenuStrip2.Size = new System.Drawing.Size(94, 26);
//
// exitToolStripMenuItem1
//
this.exitToolStripMenuItem1.Name = "exitToolStripMenuItem1";
this.exitToolStripMenuItem1.Size = new System.Drawing.Size(93, 22);
this.exitToolStripMenuItem1.Text = "E&xit";
this.exitToolStripMenuItem1.Click += new System.EventHandler(this.exitToolStripMenuItem_Click);
//
// menuStrip1
//
this.menuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.fileToolStripMenuItem,
this.toolStripMenuItem1,
this.viewToolStripMenuItem,
this.toolsToolStripMenuItem,
this.helpToolStripMenuItem1});
this.menuStrip1.Location = new System.Drawing.Point(0, 0);
this.menuStrip1.Name = "menuStrip1";
this.menuStrip1.Size = new System.Drawing.Size(300, 24);
this.menuStrip1.TabIndex = 2;
//
// fileToolStripMenuItem
//
this.fileToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.newToolStripMenuItem,
this.openToolStripMenuItem,
this.toolStripMenuItem13,
this.closeToolStripMenuItem,
this.toolStripMenuItem14,
this.saveToolStripMenuItem,
this.saveAsToolStripMenuItem,
this.toolStripMenuItem15,
this.exitToolStripMenuItem2});
this.fileToolStripMenuItem.Name = "fileToolStripMenuItem";
this.fileToolStripMenuItem.Size = new System.Drawing.Size(37, 20);
this.fileToolStripMenuItem.Text = "&File";
//
// newToolStripMenuItem
//
this.newToolStripMenuItem.Image = global::BookmarkManager.UIResource.file2;
this.newToolStripMenuItem.Name = "newToolStripMenuItem";
this.newToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.N)));
this.newToolStripMenuItem.Size = new System.Drawing.Size(146, 22);
this.newToolStripMenuItem.Text = "&New";
this.newToolStripMenuItem.Click += new System.EventHandler(this.newToolStripMenuItem_Click);
//
// openToolStripMenuItem
//
this.openToolStripMenuItem.Image = global::BookmarkManager.UIResource.folder2;
this.openToolStripMenuItem.Name = "openToolStripMenuItem";
this.openToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.O)));
this.openToolStripMenuItem.Size = new System.Drawing.Size(146, 22);
this.openToolStripMenuItem.Text = "&Open";
this.openToolStripMenuItem.Click += new System.EventHandler(this.openToolStripMenuItem_Click);
//
// toolStripMenuItem13
//
this.toolStripMenuItem13.Name = "toolStripMenuItem13";
this.toolStripMenuItem13.Size = new System.Drawing.Size(143, 6);
//
// closeToolStripMenuItem
//
this.closeToolStripMenuItem.Name = "closeToolStripMenuItem";
this.closeToolStripMenuItem.Size = new System.Drawing.Size(146, 22);
this.closeToolStripMenuItem.Text = "&Close";
this.closeToolStripMenuItem.Click += new System.EventHandler(this.closeToolStripMenuItem_Click);
//
// toolStripMenuItem14
//
this.toolStripMenuItem14.Name = "toolStripMenuItem14";
this.toolStripMenuItem14.Size = new System.Drawing.Size(143, 6);
//
// saveToolStripMenuItem
//
this.saveToolStripMenuItem.Image = global::BookmarkManager.UIResource.disk2;
this.saveToolStripMenuItem.Name = "saveToolStripMenuItem";
this.saveToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.S)));
this.saveToolStripMenuItem.Size = new System.Drawing.Size(146, 22);
this.saveToolStripMenuItem.Text = "&Save";
this.saveToolStripMenuItem.Click += new System.EventHandler(this.saveToolStripMenuItem_Click);
//
// saveAsToolStripMenuItem
//
this.saveAsToolStripMenuItem.Name = "saveAsToolStripMenuItem";
this.saveAsToolStripMenuItem.Size = new System.Drawing.Size(146, 22);
this.saveAsToolStripMenuItem.Text = "Save &As...";
this.saveAsToolStripMenuItem.Click += new System.EventHandler(this.saveAsToolStripMenuItem_Click);
//
// toolStripMenuItem15
//
this.toolStripMenuItem15.Name = "toolStripMenuItem15";
this.toolStripMenuItem15.Size = new System.Drawing.Size(143, 6);
//
// exitToolStripMenuItem2
//
this.exitToolStripMenuItem2.Name = "exitToolStripMenuItem2";
this.exitToolStripMenuItem2.Size = new System.Drawing.Size(146, 22);
this.exitToolStripMenuItem2.Text = "E&xit";
this.exitToolStripMenuItem2.Click += new System.EventHandler(this.exitToolStripMenuItem_Click);
//
// toolStripMenuItem1
//
this.toolStripMenuItem1.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.findToolStripMenuItem});
this.toolStripMenuItem1.Name = "toolStripMenuItem1";
this.toolStripMenuItem1.Size = new System.Drawing.Size(39, 20);
this.toolStripMenuItem1.Text = "&Edit";
//
// findToolStripMenuItem
//
this.findToolStripMenuItem.Name = "findToolStripMenuItem";
this.findToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.F)));
this.findToolStripMenuItem.Size = new System.Drawing.Size(137, 22);
this.findToolStripMenuItem.Text = "&Find";
this.findToolStripMenuItem.Click += new System.EventHandler(this.findToolStripMenuItem_Click);
//
// viewToolStripMenuItem
//
this.viewToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.expandAllToolStripMenuItem,
this.collapseAllToolStripMenuItem,
this.toolStripSeparator1,
this.alwaysOnTopToolStripMenuItem});
this.viewToolStripMenuItem.Name = "viewToolStripMenuItem";
this.viewToolStripMenuItem.Size = new System.Drawing.Size(44, 20);
this.viewToolStripMenuItem.Text = "&View";
//
// expandAllToolStripMenuItem
//
this.expandAllToolStripMenuItem.Name = "expandAllToolStripMenuItem";
this.expandAllToolStripMenuItem.Size = new System.Drawing.Size(152, 22);
this.expandAllToolStripMenuItem.Text = "&Expand All";
this.expandAllToolStripMenuItem.Click += new System.EventHandler(this.expandAllToolStripMenuItem_Click);
//
// collapseAllToolStripMenuItem
//
this.collapseAllToolStripMenuItem.Name = "collapseAllToolStripMenuItem";
this.collapseAllToolStripMenuItem.Size = new System.Drawing.Size(152, 22);
this.collapseAllToolStripMenuItem.Text = "&Collapse All";
this.collapseAllToolStripMenuItem.Click += new System.EventHandler(this.collapseAllToolStripMenuItem_Click);
//
// toolStripSeparator1
//
this.toolStripSeparator1.Name = "toolStripSeparator1";
this.toolStripSeparator1.Size = new System.Drawing.Size(149, 6);
//
// alwaysOnTopToolStripMenuItem
//
this.alwaysOnTopToolStripMenuItem.Name = "alwaysOnTopToolStripMenuItem";
this.alwaysOnTopToolStripMenuItem.Size = new System.Drawing.Size(152, 22);
this.alwaysOnTopToolStripMenuItem.Text = "Always On &Top";
this.alwaysOnTopToolStripMenuItem.Click += new System.EventHandler(this.alwaysOnTopToolStripMenuItem_Click);
//
// toolsToolStripMenuItem
//
this.toolsToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.optionsToolStripMenuItem});
this.toolsToolStripMenuItem.Name = "toolsToolStripMenuItem";
this.toolsToolStripMenuItem.Size = new System.Drawing.Size(46, 20);
this.toolsToolStripMenuItem.Text = "&Tools";
//
// optionsToolStripMenuItem
//
this.optionsToolStripMenuItem.Image = global::BookmarkManager.UIResource.cog2;
this.optionsToolStripMenuItem.Name = "optionsToolStripMenuItem";
this.optionsToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.F12)));
this.optionsToolStripMenuItem.Size = new System.Drawing.Size(168, 22);
this.optionsToolStripMenuItem.Text = "&Options";
this.optionsToolStripMenuItem.Click += new System.EventHandler(this.optionsToolStripMenuItem_Click);
//
// helpToolStripMenuItem1
//
this.helpToolStripMenuItem1.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.viewHelpToolStripMenuItem1,
this.toolStripMenuItem16,
this.aboutToolStripMenuItem1});
this.helpToolStripMenuItem1.Name = "helpToolStripMenuItem1";
this.helpToolStripMenuItem1.Size = new System.Drawing.Size(44, 20);
this.helpToolStripMenuItem1.Text = "&Help";
//
// viewHelpToolStripMenuItem1
//
this.viewHelpToolStripMenuItem1.Image = global::BookmarkManager.UIResource.help2;
this.viewHelpToolStripMenuItem1.Name = "viewHelpToolStripMenuItem1";
this.viewHelpToolStripMenuItem1.ShortcutKeys = System.Windows.Forms.Keys.F1;
this.viewHelpToolStripMenuItem1.Size = new System.Drawing.Size(146, 22);
this.viewHelpToolStripMenuItem1.Text = "&View Help";
this.viewHelpToolStripMenuItem1.Click += new System.EventHandler(this.viewHelpToolStripMenuItem1_Click);
//
// toolStripMenuItem16
//
this.toolStripMenuItem16.Name = "toolStripMenuItem16";
this.toolStripMenuItem16.Size = new System.Drawing.Size(143, 6);
//
// aboutToolStripMenuItem1
//
this.aboutToolStripMenuItem1.Name = "aboutToolStripMenuItem1";
this.aboutToolStripMenuItem1.Size = new System.Drawing.Size(146, 22);
this.aboutToolStripMenuItem1.Text = "&About";
this.aboutToolStripMenuItem1.Click += new System.EventHandler(this.aboutToolStripMenuItem1_Click);
//
// treeView1
//
this.treeView1.BorderStyle = System.Windows.Forms.BorderStyle.None;
this.treeView1.Dock = System.Windows.Forms.DockStyle.Fill;
this.treeView1.Location = new System.Drawing.Point(0, 24);
this.treeView1.Name = "treeView1";
this.treeView1.Size = new System.Drawing.Size(300, 556);
this.treeView1.TabIndex = 3;
//
// openFileDialog1
//
this.openFileDialog1.DefaultExt = "jsnx";
this.openFileDialog1.Filter = "Bookmarks files (*.jsnx)|*.jsnx|Bookmarks files (*.ryz)|*.ryz";
this.openFileDialog1.Title = "Open bookmarks file";
//
// MainForm
//
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None;
this.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(250)))), ((int)(((byte)(250)))), ((int)(((byte)(250)))));
this.BackgroundImageLayout = System.Windows.Forms.ImageLayout.None;
this.ClientSize = new System.Drawing.Size(300, 580);
this.Controls.Add(this.treeView1);
this.Controls.Add(this.menuStrip1);
this.DoubleBuffered = true;
this.ForeColor = System.Drawing.SystemColors.ControlText;
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
this.MainMenuStrip = this.menuStrip1;
this.MaximizeBox = false;
this.MinimizeBox = false;
this.Name = "MainForm";
this.Text = "Bookmark Manager";
this.contextMenuStrip2.ResumeLayout(false);
this.menuStrip1.ResumeLayout(false);
this.menuStrip1.PerformLayout();
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.SaveFileDialog saveFileDialog1;
private System.Windows.Forms.ContextMenuStrip contextMenuStrip2;
private System.Windows.Forms.ToolStripMenuItem exitToolStripMenuItem1;
private System.Windows.Forms.MenuStrip menuStrip1;
private System.Windows.Forms.ToolStripMenuItem fileToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem viewToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem toolsToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem helpToolStripMenuItem1;
private System.Windows.Forms.ToolStripMenuItem newToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem openToolStripMenuItem;
private System.Windows.Forms.ToolStripSeparator toolStripMenuItem13;
private System.Windows.Forms.ToolStripMenuItem closeToolStripMenuItem;
private System.Windows.Forms.ToolStripSeparator toolStripMenuItem14;
private System.Windows.Forms.ToolStripMenuItem saveToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem saveAsToolStripMenuItem;
private System.Windows.Forms.ToolStripSeparator toolStripMenuItem15;
private System.Windows.Forms.ToolStripMenuItem exitToolStripMenuItem2;
private System.Windows.Forms.ToolStripMenuItem expandAllToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem collapseAllToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem alwaysOnTopToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem optionsToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem viewHelpToolStripMenuItem1;
private System.Windows.Forms.ToolStripSeparator toolStripMenuItem16;
private System.Windows.Forms.ToolStripMenuItem aboutToolStripMenuItem1;
private System.Windows.Forms.ToolStripMenuItem toolStripMenuItem1;
private System.Windows.Forms.ToolStripMenuItem findToolStripMenuItem;
private System.Windows.Forms.ToolStripSeparator toolStripSeparator1;
private RyzStudio.Windows.Forms.BookmarkTreeView treeView1;
private System.Windows.Forms.OpenFileDialog openFileDialog1;
}
}

959
MainForm.cs Normal file
View File

@ -0,0 +1,959 @@
using BookmarkManager;
using FizzyLauncher.Models;
using FizzyLauncher.Text.Json;
using RyzStudio.Windows.Forms;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Runtime.InteropServices;
using System.Text.Json;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace FizzyLauncher
{
public partial class MainForm : Form
{
//[DllImport("user32.dll")]
//protected static extern bool RegisterHotKey(IntPtr hWnd, int id, int fsModifiers, int vk);
//[DllImport("user32.dll")]
//protected static extern bool UnregisterHotKey(IntPtr hWnd, int id);
public enum AppMode
{
Clear = 0,
Open,
New
}
//public enum LoadFileType
//{
// None = 0,
// Jsnx,
// Ryz
//}
//protected BackgroundWorker loadFileThread = null;
//protected bool isBusy = false;
protected OptionsForm optionsForm = null;
protected AppMode appMode = AppMode.Clear;
protected string sessionFilename = null;
protected string sessionPassword = null;
protected bool isBusy = false;
//protected LoadFileType loadFileType = LoadFileType.None;
//protected bool usePassword = false;
//protected const int MOD_ALT = 0x1;
//protected const int MOD_CONTROL = 0x2;
//protected const int MOD_SHIFT = 0x4;
//protected const int MOD_WIN = 0x8;
//protected const int WM_HOTKEY = 0x312;
//protected const int WM_QUERYENDSESSION = 0x0011;
//protected string sessionFilename = null;
//protected bool requestExit = false;
public MainForm()
{
InitializeComponent();
//tileContainer1.OnColumnSizeChanged += tileContainer1_OnSizeChanged;
this.AutoScaleMode = AutoScaleMode.None;
this.StartPosition = FormStartPosition.WindowsDefaultLocation;
this.ClientSize = new System.Drawing.Size(300, 580);
//this.Visible = false;
ApplicationMode = AppMode.Clear;
}
protected override void OnLoad(EventArgs e)
{
base.OnLoad(e);
//ThreadControl.SetVisible(this, false);
ThreadControl.SetSize(this, 300, 580);
}
protected async override void OnShown(EventArgs e)
{
base.OnShown(e);
//ThreadControl.SetVisible(this, false);
//string jsonfigFilename = Path.ChangeExtension(Application.ExecutablePath, "jsonfig");
//if (File.Exists(jsonfigFilename))
//{
// await loadFile(jsonfigFilename);
//}
//else
//{
// this.CurrentSession = new LauncherSession();
// ThreadControl.SetVisible(this, true);
//}
}
protected override void OnClosing(CancelEventArgs e)
{
base.OnClosing(e);
// if (this.CurrentSession == null) this.CurrentSession = new LauncherSession();
// if (this.CurrentSession.HideOnClose && !requestExit)
// {
// this.Visible = !this.Visible;
// e.Cancel = true;
// return;
// }
// requestExit = false;
// if (string.IsNullOrWhiteSpace(sessionFilename))
// {
// // do nothing
// }
// else
// {
// if (this.CurrentSession.AutoSave == LauncherSession.AutoSaveOption.Prompt)
// {
// DialogResult dr = MessageBox.Show("Save existing session?", "Exit", MessageBoxButtons.YesNoCancel, MessageBoxIcon.Question);
// if (dr == DialogResult.Yes)
// {
// bool rv = saveFile(sessionFilename, false);
// if (!rv)
// {
// e.Cancel = true;
// }
// }
// else if (dr == DialogResult.No)
// {
// // do nothing
// }
// else if (dr == DialogResult.Cancel)
// {
// e.Cancel = true;
// }
// }
// else if (this.CurrentSession.AutoSave == LauncherSession.AutoSaveOption.Yes)
// {
// saveFile(sessionFilename, false);
// }
// }
// if (this.CurrentSession.HotKey != null)
// {
// if (this.CurrentSession.HotKey.KeyCode != Keys.None)
// {
//#if !DEBUG
// UnregisterHotKey((IntPtr)Handle, 1);
//#endif
// }
// }
}
public LauncherSession CurrentSession { get; set; } = null;
public bool IsBusy
{
get => isBusy;
set
{
treeView1.Enabled = !value;
}
}
protected AppMode ApplicationMode
{
get => appMode;
set
{
appMode = value;
switch (value)
{
case AppMode.Clear:
ThreadControl.SetText(this, AppResource.app_name);
ThreadControl.SetEnable(closeToolStripMenuItem, false);
ThreadControl.SetEnable(saveToolStripMenuItem, false);
ThreadControl.SetEnable(saveAsToolStripMenuItem, false);
ThreadControl.SetEnable(expandAllToolStripMenuItem, false);
ThreadControl.SetEnable(collapseAllToolStripMenuItem, false);
//ThreadControl.SetEnable(toolStrip1, closeFileMenuItem, false);
//this.AllowSave = false;
//ThreadControl.SetEnable(toolStrip1, saveAsFileMenuItem, false);
//ThreadControl.SetEnable(toolStrip1, findEditMenuItem, false);
//ThreadControl.SetEnable(toolStrip1, expandAllViewMenuItem, false);
//ThreadControl.SetEnable(toolStrip1, collapseAllViewMenuItem, false);
//ThreadControl.SetEnable(toolStrip1, optionsToolMenuItem, false);
break;
case AppMode.Open:
ThreadControl.SetEnable(closeToolStripMenuItem, true);
ThreadControl.SetEnable(saveToolStripMenuItem, true);
ThreadControl.SetEnable(saveAsToolStripMenuItem, true);
ThreadControl.SetEnable(expandAllToolStripMenuItem, true);
ThreadControl.SetEnable(collapseAllToolStripMenuItem, true);
//ThreadControl.SetEnable(toolStrip1, closeFileMenuItem, true);
//this.AllowSave = true;
//ThreadControl.SetEnable(toolStrip1, saveAsFileMenuItem, true);
//ThreadControl.SetEnable(toolStrip1, findEditMenuItem, true);
//ThreadControl.SetEnable(toolStrip1, expandAllViewMenuItem, true);
//ThreadControl.SetEnable(toolStrip1, collapseAllViewMenuItem, true);
//ThreadControl.SetEnable(toolStrip1, optionsToolMenuItem, true);
break;
case AppMode.New:
ThreadControl.SetText(this, AppResource.app_name);
ThreadControl.SetEnable(closeToolStripMenuItem, true);
ThreadControl.SetEnable(saveToolStripMenuItem, false);
ThreadControl.SetEnable(saveAsToolStripMenuItem, true);
ThreadControl.SetEnable(expandAllToolStripMenuItem, true);
ThreadControl.SetEnable(collapseAllToolStripMenuItem, true);
//ThreadControl.SetEnable(toolStrip1, closeFileMenuItem, true);
//this.AllowSave = true;
//ThreadControl.SetEnable(toolStrip1, saveAsFileMenuItem, true);
//ThreadControl.SetEnable(toolStrip1, findEditMenuItem, true);
//ThreadControl.SetEnable(toolStrip1, expandAllViewMenuItem, true);
//ThreadControl.SetEnable(toolStrip1, collapseAllViewMenuItem, true);
//ThreadControl.SetEnable(toolStrip1, optionsToolMenuItem, true);
break;
}
}
}
//public void Clear(int columnCount)
//{
// //tileContainer1.Clear();
// //tileContainer1.Add(columnCount);
// sessionFilename = null;
//}
//protected async Task collapseWindow(int width, int increment = 6)
//{
// await Task.Run(() =>
// {
// while (this.Width > width)
// {
// ThreadControl.SetWidth(this, (this.Width - increment));
// Application.DoEvents();
// }
// ThreadControl.SetWidth(this, width);
// });
//}
//protected async Task expandWindow(int width, int increment = 8)
//{
// await Task.Run(() =>
// {
// while (this.Width < width)
// {
// ThreadControl.SetWidth(this, (this.Width + increment));
// Application.DoEvents();
// }
// ThreadControl.SetWidth(this, width);
// });
//}
// protected void invalidateHotKey()
// {
//#if !DEBUG
// if (this.InvokeRequired)
// {
// this.Invoke(new MethodInvoker(() =>
// {
// UnregisterHotKey((IntPtr)Handle, 1);
// }));
// }
// else
// {
// UnregisterHotKey((IntPtr)Handle, 1);
// }
//#endif
// if (this.CurrentSession.HotKey != null)
// {
// if (this.CurrentSession.HotKey.KeyCode != Keys.None)
// {
//#if !DEBUG
// if (this.InvokeRequired)
// {
// this.Invoke(new MethodInvoker(() =>
// {
// RegisterHotKey((IntPtr)Handle, 1, this.CurrentSession.HotKey.ModifierCode, this.CurrentSession.HotKey.Key);
// }));
// }
// else
// {
// RegisterHotKey((IntPtr)Handle, 1, this.CurrentSession.HotKey.ModifierCode, this.CurrentSession.HotKey.Key);
// }
//#endif
// }
// }
// }
//protected void newSession()
//{
//NewForm form = new NewForm(this);
//form.ShowDialog();
//}
//protected async Task loadFile(string filename)
//{
// await Task.Run(() =>
// {
// if (isBusy)
// {
// return;
// }
// if (string.IsNullOrWhiteSpace(filename))
// {
// return;
// }
// if (!File.Exists(filename))
// {
// return;
// }
// string sourceCode = null;
// try
// {
// sessionFilename = filename;
// sourceCode = File.ReadAllText(sessionFilename);
// }
// catch (Exception exc)
// {
// MessageBox.Show(exc.Message, "Load session");
// return;
// }
// if (string.IsNullOrWhiteSpace(sourceCode))
// {
// return;
// }
// // load options
// var options = new JsonSerializerOptions();
// options.Converters.Add(new JsonPointConverter());
// options.Converters.Add(new JsonSizeConverter());
// try
// {
// this.CurrentSession = JsonSerializer.Deserialize<LauncherSession>(sourceCode, options);
// }
// catch (Exception exc)
// {
// MessageBox.Show("Unable to read session", "Load session");
// return;
// }
// if (this.CurrentSession == null)
// {
// this.CurrentSession = new LauncherSession();
// }
// // load tiles
// //tileContainer1.Load(this.CurrentSession.Groups);
// // reposition
// if (!this.CurrentSession.StartPosition.IsEmpty) ThreadControl.SetLocation(this, this.CurrentSession.StartPosition);
// //
// ThreadControl.SetTopMost(this, this.CurrentSession.AlwaysOnTop);
// ThreadControl.SetVisible(this, true);
// ThreadControl.SetChecked(collapseAllToolStripMenuItem, this.CurrentSession.EnableAnimation);
// ThreadControl.SetChecked(expandAllToolStripMenuItem, this.CurrentSession.EnableBigIconInFolder);
// //ThreadControl.SetClientHeight(this, this.CurrentSession.DefaultHeight);
// ThreadControl.SetFocus(this);
// // hotkey
// invalidateHotKey();
// });
//}
//protected bool saveFile(string filename, bool showNotices = true)
//{
//if (isBusy)
//{
// return false;
//}
//if (string.IsNullOrWhiteSpace(filename))
//{
// return false;
//}
//if (tileContainer1.GroupCount <= 0)
//{
// return true;
//}
//isBusy = true;
//// update session
//if (this.CurrentSession == null)
//{
// this.CurrentSession = new LauncherSession();
//}
//this.CurrentSession.DefaultHeight = this.Height;
//this.CurrentSession.AlwaysOnTop = this.TopMost;
//this.CurrentSession.StartPosition = this.Location;
//this.CurrentSession.Groups = tileContainer1.GroupModels?.ToList() ?? new List<TileGroupModel>();
//var options = new JsonSerializerOptions();
//options.Converters.Add(new JsonPointConverter());
//options.Converters.Add(new JsonSizeConverter());
//try
//{
// File.WriteAllText(filename, JsonSerializer.Serialize(this.CurrentSession, options));
// if (showNotices)
// {
// MessageBox.Show("Session saved!", "Save session", MessageBoxButtons.OK, MessageBoxIcon.Information);
// }
//}
//catch (Exception exc)
//{
// MessageBox.Show(exc.Message, "Save session");
// return false;
//}
//isBusy = false;
//return true;
//}
//protected bool saveAsFile()
//{
//if (isBusy)
//{
// return false;
//}
//if (saveFileDialog1.ShowDialog() == DialogResult.OK)
//{
// bool rv = saveFile(saveFileDialog1.FileName);
// if (rv)
// {
// sessionFilename = saveFileDialog1.FileName;
// }
// return rv;
//}
// return false;
//}
#region main menu
/// <summary>
/// New
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void newToolStripMenuItem_Click(object sender, EventArgs e)
{
if (this.IsBusy)
{
return;
}
this.IsBusy = true;
CloseFile();
sessionFilename = null;
sessionPassword = null;
treeView1.Clear("Untitled");
ApplicationMode = AppMode.New;
this.IsBusy = false;
}
/// <summary>
/// Open file
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private async void openToolStripMenuItem_Click(object sender, EventArgs e)
{
if (this.IsBusy)
{
return;
}
this.IsBusy = true;
CloseFile();
if (openFileDialog1.ShowDialog() == DialogResult.OK)
{
Result result = await LoadFile(openFileDialog1.FileName);
if (!result.IsSuccess)
{
MessageBox.Show(result.Message, "Open File", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
this.IsBusy = false;
}
/// <summary>
/// Close
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void closeToolStripMenuItem_Click(object sender, EventArgs e)
{
if (this.IsBusy)
{
return;
}
this.IsBusy = true;
CloseFile();
sessionFilename = null;
sessionPassword = null;
treeView1.Clear();
ApplicationMode = AppMode.Clear;
this.IsBusy = false;
}
/// <summary>
/// Save
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private async void saveToolStripMenuItem_Click(object sender, EventArgs e)
{
if (this.IsBusy)
{
return;
}
if (ApplicationMode == AppMode.Clear)
{
return;
}
this.IsBusy = true;
Result result = await SaveFile(sessionFilename, sessionPassword);
if (result.IsSuccess)
{
MessageBox.Show("File saved!", "Save File", MessageBoxButtons.OK, MessageBoxIcon.Information);
}
else
{
MessageBox.Show(result.Message, "Save File", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
this.IsBusy = false;
}
/// <summary>
/// Save As
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private async void saveAsToolStripMenuItem_Click(object sender, EventArgs e)
{
if (this.IsBusy)
{
return;
}
if (ApplicationMode == AppMode.Clear)
{
return;
}
this.IsBusy = true;
if (saveFileDialog1.ShowDialog() == DialogResult.OK)
{
Result result = await SaveAsFile(saveFileDialog1.FileName);
if (result.IsSuccess)
{
MessageBox.Show("File saved!", "Save As File", MessageBoxButtons.OK, MessageBoxIcon.Information);
}
else
{
MessageBox.Show(result.Message, "Save As File", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
this.IsBusy = false;
}
/// <summary>
/// Exit
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void exitToolStripMenuItem_Click(object sender, EventArgs e)
{
if (this.IsBusy)
{
return;
}
this.Close();
}
/// <summary>
/// Find
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void findToolStripMenuItem_Click(object sender, EventArgs e)
{
//tileContainer1.Add();
}
/// <summary>
/// Expand all
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void expandAllToolStripMenuItem_Click(object sender, EventArgs e)
{
if (this.IsBusy) return;
if (ApplicationMode == AppMode.Clear) return;
if (treeView1.SelectedNode == null)
{
treeView1.ExpandAll();
}
else
{
treeView1.SelectedNode.ExpandAll();
}
}
/// <summary>
/// Collapse all
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void collapseAllToolStripMenuItem_Click(object sender, EventArgs e)
{
if (this.IsBusy) return;
if (ApplicationMode == AppMode.Clear) return;
if (treeView1.SelectedNode == null)
{
treeView1.CollapseAll();
}
else
{
treeView1.SelectedNode.Collapse(false);
}
}
/// <summary>
/// Always on top
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void alwaysOnTopToolStripMenuItem_Click(object sender, EventArgs e)
{
this.TopMost = !this.TopMost;
alwaysOnTopToolStripMenuItem.Checked = this.TopMost;
}
/// <summary>
/// Options
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void optionsToolStripMenuItem_Click(object sender, EventArgs e)
{
if (this.IsBusy)
{
return;
}
if (optionsForm == null) optionsForm = new OptionsForm(this);
optionsForm.ShowDialog();
//invalidateHotKey();
}
/// <summary>
/// View help
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void viewHelpToolStripMenuItem1_Click(object sender, EventArgs e)
{
try
{
System.Diagnostics.Process.Start("https://www.hiimray.co.uk/software-bookmark-manager");
}
catch
{
// do nothing
}
}
/// <summary>
/// About
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void aboutToolStripMenuItem1_Click(object sender, EventArgs e)
{
MessageBox.Show(Application.ProductName + " v" + Application.ProductVersion, "About", MessageBoxButtons.OK, MessageBoxIcon.Information);
}
#endregion
protected async void CloseFile()
{
if (this.ApplicationMode == AppMode.Clear)
{
return;
}
if (!treeView1.HasChanged)
{
return;
}
if (this.ApplicationMode == AppMode.New)
{
DialogResult response = MessageBox.Show("Save bookmarks", "Save?", MessageBoxButtons.YesNoCancel, MessageBoxIcon.Question);
if (response == DialogResult.Yes)
{
Result result = await SaveAsFile(sessionFilename);
if (!result.IsSuccess)
{
MessageBox.Show(result.Message, "Save File", MessageBoxButtons.OK, MessageBoxIcon.Error);
return;
}
}
else if (response == DialogResult.Cancel)
{
return;
}
}
else if (this.ApplicationMode == AppMode.Open)
{
DialogResult response = MessageBox.Show("Save changes to open bookmarks", "Save?", MessageBoxButtons.YesNoCancel, MessageBoxIcon.Question);
if (response == DialogResult.Yes)
{
Result result = await SaveFile(sessionFilename, sessionPassword);
if (!result.IsSuccess)
{
MessageBox.Show(result.Message, "Save File", MessageBoxButtons.OK, MessageBoxIcon.Error);
return;
}
}
else if (response == DialogResult.Cancel)
{
return;
}
}
}
protected SupportedFileBase GetSupportedFileHandler(string filename)
{
SupportedFileBase rs = null;
List<Type> typeList = Assembly.GetExecutingAssembly().GetTypes().Where(x => x.IsSubclassOf(typeof(SupportedFileBase))).ToList();
foreach (Type t in typeList)
{
rs = (SupportedFileBase)Activator.CreateInstance(t);
if (rs == null)
{
continue;
}
if (rs.IsSupported(filename))
{
break;
}
rs = null;
}
return rs;
}
protected async Task<Result> LoadFile(string filename)
{
return await Task.Run(() =>
{
sessionFilename = null;
sessionPassword = null;
ApplicationMode = AppMode.Clear;
treeView1.Clear();
if (string.IsNullOrWhiteSpace(filename))
{
return Result.Create(false, "Filename is empty");
}
if (!File.Exists(filename))
{
return Result.Create(false, "File not found");
}
sessionFilename = filename;
SupportedFileBase fileHandler = GetSupportedFileHandler(sessionFilename);
if (fileHandler == null)
{
return Result.Create(false, "Handler not found for this file type");
}
if (fileHandler.IsEncrypted(sessionFilename))
{
PasswordForm passwordForm = new PasswordForm(this);
if (passwordForm.ShowDialog() == DialogResult.OK)
{
sessionPassword = passwordForm.Password;
}
}
Result result = fileHandler.Load(treeView1, sessionFilename, sessionPassword);
if (!result.IsSuccess)
{
return result;
}
if (treeView1.Nodes.Count > 0)
{
ThreadControl.Expand(treeView1.Nodes[0]);
}
ApplicationMode = AppMode.Open;
return result;
});
}
protected async Task<Result> SaveFile(string filename, string password = null)
{
return await Task.Run(() =>
{
if (string.IsNullOrWhiteSpace(filename))
{
return Result.Create(false, "Filename is empty");
}
SupportedFileBase fileHandler = GetSupportedFileHandler(filename);
if (fileHandler == null)
{
return Result.Create(false, "Handler not found for this file type");
}
Result result = fileHandler.Save(treeView1, filename, password);
if (result.IsSuccess)
{
treeView1.SetNoChanges();
}
return result;
});
}
protected async Task<Result> SaveAsFile(string filename)
{
return await Task.Run(() =>
{
if (string.IsNullOrWhiteSpace(filename))
{
return Result.Create(false, "Filename is empty");
}
SupportedFileBase fileHandler = GetSupportedFileHandler(filename);
if (fileHandler == null)
{
return Result.Create(false, "Handler not found for this file type");
}
string password = null;
if (fileHandler.IsEncryptionSupported)
{
PasswordForm passwordForm = new PasswordForm(this);
if (passwordForm.ShowDialog() == DialogResult.OK)
{
if (!string.IsNullOrWhiteSpace(passwordForm.Password))
{
password = passwordForm.Password;
}
}
}
Result result = fileHandler.Save(treeView1, filename, password);
if (result.IsSuccess)
{
treeView1.SetNoChanges();
}
return result;
});
}
}
}

209
MainForm.resx Normal file
View File

@ -0,0 +1,209 @@
<root>
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<metadata name="saveFileDialog1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>172, 17</value>
</metadata>
<metadata name="contextMenuStrip2.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>561, 17</value>
</metadata>
<metadata name="menuStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>716, 17</value>
</metadata>
<metadata name="openFileDialog1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="$this.Icon" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
AAABAAMAICAAAAEAIACoEAAANgAAABgYAAABACAAiAkAAN4QAAAQEAAAAQAgAGgEAABmGgAAKAAAACAA
AABAAAAAAQAgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAyMjJHMzg56TQ6PbAyMjJcMzMzFAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMjU1ZTg7PPlJlKb/Q4eY/zhRV/YzNDX9ND4/0jM1
NXkzMzMtAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAATU4OINDSEn5cb/T/1XX9/9S1vf/Utb3/1DJ
6P9IoLb/PWp29zQ5Ovo0OzzqNTg6njMzM1UrKysMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACsrKwY1OTupTFhc+HnN4v9s3Pj/Utb3/1LW
9/9S1vf/Utb3/1LW9/9S1vf/UtT1/0uwyf9Bfo37N0dL9DM2Nvo0PD3FMzMzbzc3NxwAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA5OTkSNzw9yVhtc/d71u3/feD5/1vY
9/9S1vf/Utb3/1LW9/9S1vf/Utb3/1LW9/9S1vf/Utb3/1LW9/9S1vf/TbzY/0SMnv86V1/2MzQ1/TU9
P9o0NjaENzc3HAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAANTU1Ijk9PuFhg4v5fdz0/33g
+f923/n/Utb3/1HS8v9S1vf/Utb3/1LW9/9S1vf/Utb3/1LW9/9S1vf/Utb3/1LW9/9S1vf/Utb3/1LW
9/9Qy+r/SJ60/zhQVvozNTWDAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADQ0NDY6Pj/vaZWf/H3f
+P994Pn/feD5/2jb+P9S1fb/OD5A/0qarf9S1vf/Utb3/1LW9/9S1vf/Utb3/1LW9/9S1vf/Utb3/1LW
9/9S1vf/Utb3/1LW9/9S1vf/Rpaq/zU9PskAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAzMzNQOz4/+Gyo
t/594Pn/feD5/33g+f994Pn/W9j3/1LW9/9HT1H/c3t9/0lwef9Rzu3/Utb3/1LW9/9S1vf/Utb3/1LW
9/9S1vf/UdPz/0qux/9R1PX/Utb3/1LW9/9Nvdn/MzU2+isrKwYAAAAAAAAAAAAAAAAAAAAANDY2cTxB
Qvlyucr/feD5/33g+f994Pn/feD5/3rf+f9T1vf/Utb3/0tVV///////sLO0/0ZVWf9MtdD/Utb3/1LW
9/9R0/P/Sai//0t0f/9HUlT/OT4//1HR8f9S1vf/Utb3/1LV9v82PT/3MjIyOAAAAAAAAAAAAAAAATQ4
OoRASEr3ecjb/37g+f994Pn/feD5/33g+f994Pn/bdz4/1LW9/9S1vf/SlVX////////////4eHh/1Nc
Xv9IhZX/SnR+/0dTVf9+h4r/zs7O/87Ozv9Lcnz/Utb3/1LW9/9S1vf/Utb3/zxkbfYzMzN0AAAAAAAA
AAA0Ojy0QFFV9nvR5v+A4fn/fuD5/33g+f994Pn/feD5/33g+f9i2vj/Utb3/1LW9/9KVVf/////////
////////+fn5/6Smp//Ozs7//f39////////////foaJ/0qov/9S1vf/Utb3/1LW9/9S1vf/RY6h/zQ7
PLsAAAAAAAAAADU8Pd1msML/g+L5/4Hh+f9/4fn/feD5/33g+f994Pn/feD5/1nY9/9S1vf/Utb3/0pV
V/////////////////////////////////////////////39/f9HU1X/UdLy/1LW9/9S1vf/Utb3/1LW
9/9Mtc//Mzg58wAAAAEAAAAANDc5mViLmPyD4vn/geH5/3/h+f994Pn/feD5/33g+f984Pn/U9b3/1LW
9/9Nu9b/SVJV////////////////////////////////////////////ycnJ/0t3gv9S1vf/Utb3/1LW
9/9S1vf/Utb3/1LU9P80ODn6MTExKgAAAAA0NDRZR1xh9IPi+f+B4fn/f+H5/33g+f994Pn/feD5/3ff
+f9S1fb/SY+h/09aXP/a2tr///////////////////////////////////////////93gIP/SqzF/1LW
9/9S1vf/Utb3/1LW9/9S1vf/Utb3/ztZYPQyMjJmAAAAAC8vLxs1Njb9gNvy/4Hh+f9/4fn/feD5/33g
+f994Pn/a8vi/0diaP+GjY//+fn5/////////////////////////////////////////////////4KK
jP9KkKH/Utb3/1LW9/9S1vf/Utb3/1LW9/9S1vf/Q4WW/jM5O6kAAAAAAAAAADU6O+lyvtD/geH5/3/h
+f994Pn/feD5/2aktP9NVlj/y8zM////////////////////////////////////////////////////
////////+fn5/1VdYP9Ms83/Utb3/1LW9/9S1vf/Utb3/1LW9/9Kq8P/NTo76QAAAAAAAAAANTk7qV+X
pf6B4fn/f+H5/33g+f930ej/Q05Q/19naP+wsbL/7+/v////////////////////////////////////
////////////////////////4+Pj/0dVWP9Qy+r/Utb3/1LW9/9S1vf/Utb3/1DP7v8zNDX9NTU1HQAA
AAA0NDRnSmdt9YHh+f+A4fn/fuD5/33g+f994Pn/ZsLZ/0iMnf9HXWP/VWFk/5ufoP/l5eX/////////
////////////////////////////////////////vL2+/0lnb/9S1fb/Utb3/1LW9/9S1vf/Utb3/zhO
VPM0NDRYAAAAADU1NSs3Ozv7geD3/4Dh+f9+4Pn/feD5/33g+f9z3vn/Utb3/1LW9/9PyOb/SJis/0pT
Vf/+/v7/////////////////8PDw/8nJyf/Jycn/ycnJ/8nJyf/Nzc3/aW5v/0qNnf9S1vf/Utb3/1LW
9/9S1vf/P3qI/TQ3OZgAAAAAAAAAATM4OfN0xtr/gOH5/37g+f994Pn/feD5/3rf+f9S1vf/Utb3/1LW
9/9S1vf/S294/9XV1f////////////39/f9bZGb/S3yJ/0yBj/9MgY//TIGP/0x7hv9OeIP/S4mZ/1LW
9/9S1vf/Utb3/1LW9/9IoLb/NTw93AAAAAAAAAAANDs8u2Gfr/+A4fn/f+H5/33g+f994Pn/feD5/1jX
9/9S1vf/Utb3/1LW9/9InrT/jZOV////////////lZqb/0uDkv9S1vf/Utb3/1LW9/9S1vf/Utb3/1LW
9/9S1vf/Utb3/1LW9/9S1vf/TsHe/zhKTvY0Ojy0AAAAAAAAAAAyMjJ1TXJ694Hh+f9/4fn/feD5/33g
+f994Pn/Ztv4/1LW9/9S1vf/Utb3/1DO7f9NWFr//////9XV1f9GW2D/UdLy/1LW9/9S1vf/Utb3/1LW
9/9S1vf/Utb3/1LW9/9S1vf/Utb3/0y40v82QEP3NDk7l1VVVQMAAAAAAAAAADExMTk5QUL4gOD4/3/h
+f994Pn/feD5/33g+f933/n/U9b3/1LW9/9S1vf/Utb3/0plbP/W1tb/TFdZ/06+2v9S1vf/Utb3/1LW
9/9S1vf/Utb3/1LW9/9S1vf/Utb3/1LW9/9JqMD/NDk6+TM1N4IAAAAAAAAAAAAAAAAAAAAAMzMzBTM2
Nvl2zeL/f+H5/33g+f994Pn/feD5/33g+f9i2vj/Utb3/1LW9/9S1vf/SJir/0BCQ/9Lm6//Utb3/1LW
9/9S1vf/Utb3/1LW9/9S1vf/Utb3/1LW9/9S1vf/Rpar/jQ3OPkyMjJXAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAANTw+y2OnuP9/4fn/feD5/33g+f994Pn/feD5/3vg+f9X1/f/Utb3/1LW9/9Qyun/RoaV/1LW
9/9S1vf/Utb3/1LW9/9S1vf/Utb3/1LW9/9S1vf/UtX2/0OElPw0NzjyMzMzPAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAzNTWDPlZb+mauwP961+//feD5/33g+f994Pn/feD5/3Xe+f9V1/f/Utb3/1LW
9/9S1vf/Utb3/1LW9/9S1vf/Utb3/1LW9/9S1vf/Utb3/1HQ8P88ZW/4NDk64DU1NSIAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAADc3NxwzNTWDNDo81zU2Nv1JY2nzYJ2t/nXL4f994Pn/feD5/3Xe
+f9X1/f/Utb3/1LW9/9S1vf/Utb3/1LW9/9S1vf/Utb3/1LW9/9PyOf/OlRb9zU7Pco5OTkSAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAALi4uFjQ0NF40PT60NDY39z9L
TfVWhI/7a7XI/3nc9P9i2vj/U9b3/1LW9/9S1vf/Utb3/1LW9/9S1vf/TsDc/zdGS/Y0OTuyOTk5CQAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AABAQEAINTU1RDM4OIw0OTzjNjk5+0tsdPhYn7H/WMjk/1TW9/9S1vf/Utb3/0uyzP81PT/4Mzc4lQAA
AAIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAzMzMtMzMzeDQ6Pc40NTX8O1JX80WImf5FkaT/NDg5+jU1
NWUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADMzMxQyMjJcNDo9sDM4
OekyMjJHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD//////+D////A
H///AAH//gAAP/wAAAf4AAAH8AAAB+AAAAPAAAADAAAAAwAAAAMAAAABAAAAAQAAAAEAAAABgAAAAYAA
AACAAAAAgAAAAIAAAADAAAAAwAAAAMAAAAPAAAAH4AAAD+AAAB/gAAA//AAAf/+AAP//+AP///8H/ygA
AAAYAAAAMAAAAAEAIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADY+Pl41PD7tNkRItTQ0
NFgtLS0RAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAANT9DeVBpcfBTzOr/TLXQ/0SHmfQ5UVbqNkFF3jU8PogyMjIzAAAAAQAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEBAQAQ5RUemYYaP83Lb
9f9S1vf/Utb3/1LW9/9S1vf/T8jn/0eZrv08YWnrNkNG5jdHS60zMzNVKysrDAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAMDAwEDxHSc1qoa73feD5/2La+P9S1vf/Utb3/1LW9/9S1vf/Utb3/1LW
9/9S1vf/UdHx/0qqwv9AdYPwNkVJ6zZERsgzMzMoAAAAAAAAAAAAAAAAAAAAAAAAAAA2NjYhQUpM4HK2
xvt94Pn/e+D5/1PV9v9Ljp//UdPz/1LW9/9S1vf/Utb3/1LW9/9S1vf/Utb3/1LW9/9S1vf/Utb3/0WT
pv42P0GFAAAAAAAAAAAAAAAAAAAAADQ0NDZETVDpdcLV/n3g+f994Pn/cN34/1LW9/9TXV//WXF3/0/A
3P9S1vf/Utb3/1LW9/9S1vf/UdT1/0y10P9S1fb/Utb3/07A3f83REfNAAAAAAAAAAAAAAAAMjg7VklX
W+95zuP/feD5/33g+f994Pn/Y9r4/1LW9/9rfID/8/Pz/29+gv9QnrH/UdT1/0yvyP9VgYv/ZnuA/0lV
WP9R1PX/Utb3/1LW9/82QkXsQEBABAAAAAA1P0F5S2Fo8X/X7v9+4Pn/feD5/33g+f994Pn/V9f3/1LW
9/9rfID///////////+nr7D/ZXd8/6ivsP/w8PD/7Ozs/1OAi/9S1vf/Utb3/1LW9/88YmvrMjIyMwAA
AAA1PkDrfdvy/4Hh+f9+4Pn/feD5/33g+f963/n/Utb3/1LW9/9qfID/////////////////////////
////////nqan/0yzzf9S1vf/Utb3/1LW9/9FkaX7Njo9dgAAAAA3RUe2c8TY/4Hh+f9/4fn/feD5/33g
+f9y3vj/Utb3/1CdsP+IlJf/////////////////////////////////YHV7/1LV9v9S1vf/Utb3/1LW
9/9NudT/N0RIwgAAAAAzNjZoYp2r+YHh+f9/4fn/feD5/33g+f9mzuj/VHZ//6yztP//////////////
///////////////////5+fn/UW1z/1LW9/9S1vf/Utb3/1LW9/9S1fb/NUBD6wAAAAEyMjIpT2tz7IHh
+f9/4fn/feD5/2yuvv9neHz/6enp////////////////////////////////////////////qLCx/1GZ
q/9S1vf/Utb3/1LW9/9S1vf/O1li6jMzMygAAAABO0VJ64Hg+P9/4fn/feD5/2eap/9geH7/foyQ/8rL
y//8/Pz//////////////////////////////////////3iFiP9PuNL/Utb3/1LW9/9S1vf/RIma+TQ2
NmcAAAAAN0RIw3fK3/9/4fn/feD5/33g+f9q3Pj/UMno/0+br/9Uc3r/v8TF/////////////////+jo
6P/k5OT/8fHx/+vr6/9YaW7/UMzq/1LW9/9S1vf/S7LM/zZERrUAAAAANjo9dmSjs/yA4fn/feD5/33g
+f9x3fj/Utb3/1LW9/9R0fH/a32B////////////sLe4/1F5hP9VjZv/UoOP/1KDj/9Tg4//TrjT/1LW
9/9S1vf/UM/u/zU+QOsAAAAAMTExNFFye+2A4fn/feD5/33g+f963/n/U9b3/1LW9/9S1vf/VXd///n5
+f/o6Oj/VHeA/1LW9/9S1vf/Utb3/1LW9/9S1vf/Utb3/1LW9/9Qy+r/OVZc8DZBQ4oAAAAAQEBABDxH
Su2A4fn/fuD5/33g+f994Pn/X9n4/1LW9/9S1vf/TZ+0/7y+v/9fcnf/UMrp/1LW9/9S1vf/Utb3/1LW
9/9S1vf/Utb3/07B3v83SU7uNj4+XgAAAAAAAAAAAAAAADZER852z+b/fuD5/33g+f994Pn/dd75/1PW
9/9S1vf/Uc7t/0BHSf9PsMj/Utb3/1LW9/9S1vf/Utb3/1LW9/9S1vf/S7PN/jZDR+syNjY9AAAAAAAA
AAAAAAAAAAAAADY9P4VforL+fuD5/33g+f994Pn/feD5/2nb+P9S1vf/Utb3/0282P9S1vf/Utb3/1LW
9/9S1vf/Utb3/1LW9/9IoLb7NkBD3zY2NiEAAAAAAAAAAAAAAAAAAAAAAAAAADMzMyg2REbIP01Q7FmH
kvJtu87/fNz0/33g+f9o2/j/Utb3/1LW9/9S1vf/Utb3/1LW9/9S1vf/Utb3/0SImvU1QELMMDAwEAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQEBACDU1NUQ2RUaYOUZI40tka+1ioLD8a83n/1nY
9/9S1vf/Utb3/1LW9/9S1PX/P3F+8TZCRa4rKysGAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAADU1NSI0Oz11NkJG0D5NUu1Hfo3yTKzE/1DM6v87W2PvNUBCiwAA
AAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAC0tLRE0NDRYNkRItTU8Pu02Pj5eAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAD///9B/wf/Qf4Af0H4AA9B8AADQeAAA0HAAANBgAABQQAAAUEAAAFBAAABQQAAAEEAAABBAAAAQYAA
AEGAAABBgAAAQYAAAUHAAANBwAAHQcAAD0HwAB9B/wA/Qf/g/0EoAAAAEAAAACAAAAABACAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA3TVF4O1tk1zlRWLA3RERPQEBACAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABBVlyOZqW18FPW9/9R0PD/SqrC+D9y
fts5VlzBNkhKdTU1NRgAAAAAAAAAAAAAAAAAAAAAAAAAAFVVVQNCV12tcbrL9mnb+P9S1vf/Utb3/1LW
9/9S1vf/UdT1/0uwyv0/doXjO1hgyDU1NSIAAAAAAAAAACQkJAdEWl+7dMLW+n3g+f9b2Pf/Um92/1DF
4/9S1vf/Utb3/1LW9/9S1vf/Utb3/0y71v85TFB5AAAAAC0tLRFEXGLKds3j/X3g+f963/n/U9b3/5Sl
qf+Po6j/Va7E/1GwyP9ol6P/V250/1HU9f9S1fb/O1ZctwAAAABCWWDQfNbs/33g+f994Pn/b934/1LW
9/+Vp6v//////8bNzv/T1tf//////2uYo/9S1vf/Utb3/z1kbtEAAAAASWpyy4Hh+f9+4Pn/feD5/2jb
+P9Tt9D/qba5/////////////////97g4f9UqsD/Utb3/1LW9/9Bf4/lMzMzGTlTWal/3PP/fuD5/3ze
9/9lnaz/sr7A///////////////////////Hzs//Va/G/1LW9/9S1vf/S6zG/TVARls3QkddccDT/X/h
+f9tqrn/fI2R/9bY2f///////////////////////////4iepP9Ryun/Utb3/1HQ8P85U1mmNTU1GGCV
oup/4fn/feD5/2PY9v9SrsX/ZoeP//39/f//////xczN/6y4uv+ns7X/WHd//1LW9/9S1vf/PGBpxwAA
AABRdH3Vf+H5/33g+f9s3Pj/Utb3/1C40v/Izc//zdPV/1eluP9Qy+r/T8jn/0/E4v9S1vf/UMjm/zlS
WM4AAAAAP1tiuX/g+P994Pn/eN/5/1PW9/9S1fb/g5ug/2eVoP9S1vf/Utb3/1LW9/9S1vf/TsHe/jlV
W80zMzMUAAAAADhMUHx0y+H/feD5/33g+f9k2vj/Utb3/1WYqf9Qzez/Utb3/1LW9/9S1vf/S7TO+jhR
Vr4zMzMKAAAAAAAAAAA1NTUiQV1kyVmIluZvwdX9e973/1/Z+P9S1vf/Utb3/1LW9/9S1vf/SKW89DhO
VKpVVVUDAAAAAAAAAAAAAAAAAAAAAAAAAAA5OTkSN0lLYkBdZLpSeYLfVaS591TP7f9S1vf/RZas7zdL
T5oAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQEBACDdERE86U1qwO1tk1zdN
UXgAAAAAAAAAAAAAAAAAAAAAAAAAAPg/rEHwB6xBwAGsQYABrEEAAaxBAAGsQQAArEEAAKxBAACsQQAA
rEGAAKxBgACsQYABrEGAA6xB4A+sQfwfrEE=
</value>
</data>
</root>

413
Models/BookmarkItemModel.cs Normal file
View File

@ -0,0 +1,413 @@
using bzit.bomg.Models;
using HtmlAgilityPack;
using RyzStudio.Net;
using System;
using System.Drawing;
using System.IO;
using System.Net;
using System.Text;
using HtmlDocument = HtmlAgilityPack.HtmlDocument;
namespace bzit.bomg
{
public class BookmarkItemModel : BookmarkItemViewModel
{
protected HttpWeb webClient = null;
public BookmarkItemModel()
{
this.Clear();
}
public void Clear()
{
this.SiteName = string.Empty;
this.SiteAddress = string.Empty;
this.SiteDescription = string.Empty;
this.FaviconAddress = string.Empty;
this.TreeviewPath = string.Empty;
}
public new string ToString()
{
StringBuilder sb = new StringBuilder();
sb.Append("Name = ");
sb.Append(this.SiteName ?? string.Empty);
sb.Append(Environment.NewLine);
sb.Append("Address = ");
sb.Append(this.SiteAddress ?? string.Empty);
sb.Append(Environment.NewLine);
sb.Append("Description = ");
sb.Append(this.SiteDescription ?? string.Empty);
sb.Append(Environment.NewLine);
return sb.ToString();
}
public BookmarkItemViewModel ToViewModel()
{
return new BookmarkItemViewModel()
{
SiteName = this.SiteName,
SiteAddress = this.SiteAddress,
SiteDescription = this.SiteDescription,
FaviconAddress = this.FaviconAddress,
TreeviewPath = this.TreeviewPath
};
}
public bool Update()
{
string sourceCode = retrieveSourceCode();
if (string.IsNullOrWhiteSpace(sourceCode))
{
return false;
}
HtmlDocument document = new HtmlDocument();
document.LoadHtml(sourceCode);
// title
this.SiteName = parseSiteTitle(document);
// description
this.SiteDescription = parseSiteDescription(document);
// favicon
this.FaviconAddress = parseSiteIcon(document);
// default infurred icon
if (string.IsNullOrWhiteSpace(this.FaviconAddress))
{
this.FaviconAddress = "/favicon.ico";
}
if (!string.IsNullOrWhiteSpace(this.FaviconAddress))
{
Uri iconAddressURI;
bool rv = Uri.TryCreate(new Uri(this.SiteAddress), this.FaviconAddress, out iconAddressURI);
if (rv)
{
this.FaviconAddress = iconAddressURI.ToString();
}
}
return true;
}
public bool UpdateFavicon()
{
string sourceCode = retrieveSourceCode();
if (string.IsNullOrWhiteSpace(sourceCode))
{
return false;
}
HtmlDocument document = new HtmlDocument();
document.LoadHtml(sourceCode);
// favicon
this.FaviconAddress = parseSiteIcon(document);
// default infurred icon
if (string.IsNullOrWhiteSpace(this.FaviconAddress))
{
this.FaviconAddress = "/favicon.ico";
}
if (!string.IsNullOrWhiteSpace(this.FaviconAddress))
{
Uri iconAddressURI;
bool rv = Uri.TryCreate(new Uri(this.SiteAddress), this.FaviconAddress, out iconAddressURI);
if (rv)
{
this.FaviconAddress = iconAddressURI.ToString();
}
}
return true;
}
public Bitmap RetrieveFavicon()
{
if (string.IsNullOrWhiteSpace(this.FaviconAddress))
{
return null;
}
byte[] iconData = null;
WebClient webClient = new WebClient();
webClient.CachePolicy = new System.Net.Cache.RequestCachePolicy(System.Net.Cache.RequestCacheLevel.NoCacheNoStore);
try
{
iconData = webClient.DownloadData(this.FaviconAddress);
if (!RyzStudio.IO.FileType.IsImage(iconData))
{
throw new Exception("Not a supported image");
}
Image img = Image.FromStream(new MemoryStream(iconData));
return new Bitmap(img, 16, 16);
}
catch
{
iconData = null;
this.FaviconAddress = null;
return null;
}
}
public Bitmap RetrieveFavicon(out byte[] rawData)
{
rawData = null;
if (string.IsNullOrWhiteSpace(this.FaviconAddress))
{
return null;
}
byte[] iconData = null;
WebClient webClient = new WebClient();
webClient.CachePolicy = new System.Net.Cache.RequestCachePolicy(System.Net.Cache.RequestCacheLevel.NoCacheNoStore);
try
{
iconData = webClient.DownloadData(this.FaviconAddress);
if (!RyzStudio.IO.FileType.IsImage(iconData))
{
throw new Exception("Not a supported image");
}
rawData = iconData;
Image img = Image.FromStream(new MemoryStream(iconData));
return new Bitmap(img, 16, 16);
}
catch
{
iconData = null;
this.FaviconAddress = null;
return null;
}
}
protected string retrieveSourceCode()
{
if (webClient == null)
{
webClient = new HttpWeb();
}
string sourceCode;
int statusCode = webClient.GetResponse(out sourceCode, this.SiteAddress);
if ((statusCode == 200) || (statusCode == 301) || (statusCode == 302))
{
return sourceCode;
}
return null;
//WebClient webClient = new WebClient();
//webClient.CachePolicy = new System.Net.Cache.RequestCachePolicy(System.Net.Cache.RequestCacheLevel.NoCacheNoStore);
//try
//{
// return webClient.DownloadString(this.SiteAddress);
//}
//catch (Exception exc)
//{
// return null;
//}
}
protected string parseTagValue(HtmlDocument doc, string xpath, string defaultValue = "")
{
HtmlNodeCollection hnc = doc.DocumentNode.SelectNodes(xpath);
if (hnc == null)
{
return defaultValue;
}
if (hnc.Count <= 0)
{
return defaultValue;
}
foreach (HtmlNode hn in hnc)
{
if (string.IsNullOrWhiteSpace(hn.InnerHtml))
{
continue;
}
string rs = WebUtility.HtmlDecode(hn.InnerHtml)?.Replace("\r", "")?.Replace("\n", " ")?.Trim();
if (string.IsNullOrWhiteSpace(rs))
{
continue;
}
return rs;
}
return defaultValue;
}
protected string parseTagValue_Attr(HtmlDocument doc, string xpath, string attr, string defaultValue = "")
{
HtmlNodeCollection hnc = doc.DocumentNode.SelectNodes(xpath);
if (hnc == null)
{
return defaultValue;
}
if (hnc.Count <= 0)
{
return defaultValue;
}
foreach (HtmlNode hn in hnc)
{
if (hn.Attributes[attr] == null)
{
continue;
}
if (string.IsNullOrWhiteSpace(hn.Attributes[attr].Value))
{
continue;
}
return System.Web.HttpUtility.HtmlDecode(hn.Attributes[attr].Value?.Trim());
}
return defaultValue;
}
protected string parseSiteTitle(HtmlDocument doc)
{
string rs = null;
if (string.IsNullOrWhiteSpace(rs))
{
rs = parseTagValue(doc, "//title", string.Empty);
}
if (string.IsNullOrWhiteSpace(rs))
{
rs = parseTagValue_Attr(doc, "//meta[@property='og:title']", "content", string.Empty);
}
if (string.IsNullOrWhiteSpace(rs))
{
rs = parseTagValue_Attr(doc, "//meta[@name='twitter:title']", "content", string.Empty);
}
if (string.IsNullOrWhiteSpace(rs))
{
rs = parseTagValue_Attr(doc, "//meta[@property='og:site_name']", "content", string.Empty);
}
if (string.IsNullOrWhiteSpace(rs))
{
rs = parseTagValue_Attr(doc, "//meta[@itemprop='name']", "content", string.Empty);
}
return rs?.Trim();
}
protected string parseSiteDescription(HtmlDocument doc)
{
string rs = null;
if (string.IsNullOrWhiteSpace(rs))
{
rs = parseTagValue_Attr(doc, "//meta[@name='description']", "content", string.Empty);
}
if (string.IsNullOrWhiteSpace(rs))
{
rs = parseTagValue_Attr(doc, "//meta[@property='og:description']", "content", string.Empty);
}
if (string.IsNullOrWhiteSpace(rs))
{
rs = parseTagValue_Attr(doc, "//meta[@name='twitter:description']", "content", string.Empty);
}
if (string.IsNullOrWhiteSpace(rs))
{
rs = parseTagValue_Attr(doc, "//meta[@property='og:description']", "content", string.Empty);
}
if (string.IsNullOrWhiteSpace(rs))
{
rs = parseTagValue_Attr(doc, "//meta[@itemprop='description']", "content", string.Empty);
}
return rs;
}
protected string parseSiteIcon(HtmlDocument doc)
{
string rs = null;
if (string.IsNullOrWhiteSpace(rs))
{
//rs = parseTagValue_Attr(doc, "//link[@rel='shortcut icon']", "href", string.Empty);
rs = parseTagValue_Attr(doc, "//link[translate(@rel, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', 'abcdefghijklmnopqrstuvwxyz') = 'shortcut icon']", "href", string.Empty);
}
if (string.IsNullOrWhiteSpace(rs))
{
//rs = parseTagValue_Attr(doc, "//link[@rel='icon']", "href", string.Empty);
rs = parseTagValue_Attr(doc, "//link[translate(@rel, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', 'abcdefghijklmnopqrstuvwxyz') = 'icon']", "href", string.Empty);
}
if (string.IsNullOrWhiteSpace(rs))
{
//rs = parseTagValue_Attr(doc, "//link[@rel='apple-touch-icon']", "href", string.Empty);
rs = parseTagValue_Attr(doc, "//link[translate(@rel, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', 'abcdefghijklmnopqrstuvwxyz') = 'apple-touch-icon']", "href", string.Empty);
}
if (string.IsNullOrWhiteSpace(rs))
{
//rs = parseTagValue_Attr(doc, "//link[@rel='apple-touch-icon-precomposed']", "href", string.Empty);
rs = parseTagValue_Attr(doc, "//link[translate(@rel, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', 'abcdefghijklmnopqrstuvwxyz') = 'apple-touch-icon-precomposed']", "href", string.Empty);
}
if (string.IsNullOrWhiteSpace(rs))
{
//rs = parseTagValue_Attr(doc, "//meta[@property='og:image']", "content", string.Empty);
rs = parseTagValue_Attr(doc, "//meta[translate(@property, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', 'abcdefghijklmnopqrstuvwxyz') = 'og:image']", "content", string.Empty);
}
if (string.IsNullOrWhiteSpace(rs))
{
//rs = parseTagValue_Attr(doc, "//meta[@name='twitter:image']", "content", string.Empty);
rs = parseTagValue_Attr(doc, "//meta[translate(@name, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', 'abcdefghijklmnopqrstuvwxyz') = 'twitter:image']", "content", string.Empty);
}
if (string.IsNullOrWhiteSpace(rs))
{
//rs = parseTagValue_Attr(doc, "//meta[@property='og:image']", "content", string.Empty);
rs = parseTagValue_Attr(doc, "//meta[translate(@property, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', 'abcdefghijklmnopqrstuvwxyz') = 'og:image']", "content", string.Empty);
}
if (string.IsNullOrWhiteSpace(rs))
{
//rs = parseTagValue_Attr(doc, "//meta[@itemprop='image']", "content", string.Empty);
rs = parseTagValue_Attr(doc, "//meta[translate(@itemprop, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', 'abcdefghijklmnopqrstuvwxyz') = 'image']", "content", string.Empty);
}
return rs;
}
}
}

View File

@ -0,0 +1,44 @@
using System;
using System.Text;
namespace bzit.bomg.Models
{
public class BookmarkItemViewModel
{
public string SiteName { get; set; }
public string SiteAddress { get; set; }
public string SiteDescription { get; set; }
public string FaviconAddress { get; set; }
public string TreeviewPath { get; set; }
public BookmarkItemModel ToModel()
{
return new BookmarkItemModel()
{
SiteName = this.SiteName,
SiteAddress = this.SiteAddress,
SiteDescription = this.SiteDescription,
FaviconAddress = this.FaviconAddress,
TreeviewPath = this.TreeviewPath
};
}
public new string ToString()
{
StringBuilder sb = new StringBuilder();
sb.Append("Name = ");
sb.Append(this.SiteName ?? string.Empty);
sb.Append(Environment.NewLine);
sb.Append("Address = ");
sb.Append(this.SiteAddress ?? string.Empty);
sb.Append(Environment.NewLine);
sb.Append("Description = ");
sb.Append(this.SiteDescription ?? string.Empty);
sb.Append(Environment.NewLine);
return sb.ToString();
}
}
}

42
Models/LauncherSession.cs Normal file
View File

@ -0,0 +1,42 @@
using System.Collections.Generic;
using System.Drawing;
namespace FizzyLauncher.Models
{
public class LauncherSession
{
public class HotKeyOptions
{
public bool IsCtrl { get; set; } = false;
public bool IsAlt { get; set; } = false;
public bool IsShift { get; set; } = false;
public int Key { get; set; } = (int)System.Windows.Forms.Keys.None;
public int ModifierCode => ((this.IsAlt ? 1 : 0) + (this.IsCtrl ? 2 : 0) + (this.IsShift ? 4 : 0));
public System.Windows.Forms.Keys KeyCode => (System.Windows.Forms.Keys)this.Key;
}
public enum AutoSaveOption
{
Prompt = 0,
Yes,
No
}
public int DefaultHeight { get; set; } = 280;
public HotKeyOptions HotKey { get; set; } = null;
public bool AlwaysOnTop { get; set; } = false;
public bool EnableAnimation { get; set; } = false;
public bool EnableBigIconInFolder { get; set; } = false;
public bool HideOnClose { get; set; } = false;
public bool HideOnClick { get; set; } = false;
public AutoSaveOption AutoSave { get; set; } = AutoSaveOption.Prompt;
//public List<TileGroupModel> Groups { get; set; } = new List<TileGroupModel>();
public Point StartPosition { get; set; } = Point.Empty;
}
}

21
Models/TileGroupModel.cs Normal file
View File

@ -0,0 +1,21 @@
using FizzyLauncher.Text.Json;
using System.Collections.Generic;
using System.Drawing;
using System.Text.Json.Serialization;
namespace FizzyLauncher.Models
{
public class TileGroupModel
{
public string Title { get; set; }
public bool IsExpanded { get; set; } = false;
public bool IsExclusive { get; set; } = false;
public List<TileModel> Items { get; set; } = new List<TileModel>();
[JsonConverter(typeof(JsonSizeConverter))]
public Size GridSize { get; set; } = new Size(0, 0);
}
}

110
Models/TileModel.cs Normal file
View File

@ -0,0 +1,110 @@
using FizzyLauncher.Text.Json;
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Drawing;
using System.Text.Json.Serialization;
namespace FizzyLauncher.Models
{
public class TileModel
{
public string Title { get; set; }
public string ProcessFilename { get; set; }
public string ProcessArgument { get; set; }
public string ProcessWorkingDirectory { get; set; }
public ProcessWindowStyle ProcessWindowStyle { get; set; } = ProcessWindowStyle.Normal;
public bool ProcessAsAdmin { get; set; } = false;
[JsonConverter(typeof(JsonPointConverter))]
public Point Position { get; set; }
public bool IsGroup { get; set; } = false;
public List<TileModel> Items { get; set; } = new List<TileModel>();
public override string ToString() => this.Title ?? string.Empty;
public string CleanProcessFilename => (string.IsNullOrWhiteSpace(this.ProcessFilename) ? string.Empty : resolvePath(this.ProcessFilename));
public string CleanProcessArgument => (string.IsNullOrWhiteSpace(this.ProcessArgument) ? string.Empty : resolvePath(this.ProcessArgument));
public string CleanProcessWorkingDirectory => (string.IsNullOrWhiteSpace(this.ProcessWorkingDirectory) ? string.Empty : resolvePath(this.ProcessWorkingDirectory));
protected string resolvePath(string value)
{
string rv = Environment.ExpandEnvironmentVariables(value);
rv = resolveFirstPath(rv);
rv = resolveLastPath(rv);
return rv;
}
protected string resolveFirstPath(string value)
{
const string last = "%FIRST%";
if (!value.Contains(last))
{
return value;
}
string head = value.Substring(0, value.IndexOf(last));
string tail = value.Substring(value.IndexOf(last) + last.Length);
string[] dirList = new string[0];
try
{
dirList = System.IO.Directory.GetDirectories(head, "*", System.IO.SearchOption.TopDirectoryOnly);
}
catch
{
// do nothing
}
if (dirList.Length <= 0)
{
return value;
}
return dirList[0] + tail;
}
protected string resolveLastPath(string value)
{
const string last = "%LAST%";
if (!value.Contains(last))
{
return value;
}
string head = value.Substring(0, value.IndexOf(last));
string tail = value.Substring(value.IndexOf(last) + last.Length);
string[] dirList = new string[0];
try
{
dirList = System.IO.Directory.GetDirectories(head, "*", System.IO.SearchOption.TopDirectoryOnly);
}
catch
{
// do nothing
}
if (dirList.Length <= 0)
{
return value;
}
return dirList[(dirList.Length - 1)] + tail;
}
}
}

126
NewForm.cs Normal file
View File

@ -0,0 +1,126 @@
using RyzStudio.Windows.ThemedForms;
using System;
namespace FizzyLauncher
{
public class NewForm : TDialogForm
{
private System.Windows.Forms.Label label1;
private TButton button1;
private TNumericBox numericBox1;
private RyzStudio.Windows.Forms.THorizontalSeparator tHorizontalSeparator1;
public NewForm(MainForm parent) : base()
{
InitializeComponent();
parentForm = parent;
numericBox1.InnerControl.Minimum = 4;
numericBox1.InnerControl.Maximum = 24;
numericBox1.InnerControl.Value = 6;
}
private void InitializeComponent()
{
this.label1 = new System.Windows.Forms.Label();
this.button1 = new RyzStudio.Windows.ThemedForms.TButton();
this.tHorizontalSeparator1 = new RyzStudio.Windows.Forms.THorizontalSeparator();
this.numericBox1 = new RyzStudio.Windows.ThemedForms.TNumericBox();
this.SuspendLayout();
//
// label1
//
this.label1.AutoSize = true;
this.label1.BackColor = System.Drawing.Color.Transparent;
this.label1.ForeColor = System.Drawing.SystemColors.ControlText;
this.label1.Location = new System.Drawing.Point(10, 21);
this.label1.Margin = new System.Windows.Forms.Padding(0);
this.label1.Name = "label1";
this.label1.Padding = new System.Windows.Forms.Padding(0, 9, 0, 10);
this.label1.Size = new System.Drawing.Size(137, 34);
this.label1.TabIndex = 153;
this.label1.Text = "Number of Tiles Per Row";
this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
//
// button1
//
this.button1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.button1.BackColor = System.Drawing.Color.Transparent;
this.button1.DefaultImage = null;
this.button1.DownImage = null;
this.button1.IsSelected = false;
this.button1.LabelText = "&Save";
this.button1.Location = new System.Drawing.Point(241, 109);
this.button1.Margin = new System.Windows.Forms.Padding(10);
this.button1.Name = "button1";
this.button1.OverImage = null;
this.button1.Padding = new System.Windows.Forms.Padding(4, 4, 3, 3);
this.button1.Size = new System.Drawing.Size(128, 32);
this.button1.TabIndex = 173;
this.button1.Click += new System.EventHandler(this.button1_Click);
//
// tHorizontalSeparator1
//
this.tHorizontalSeparator1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.tHorizontalSeparator1.AutoScrollMargin = new System.Drawing.Size(0, 0);
this.tHorizontalSeparator1.AutoScrollMinSize = new System.Drawing.Size(0, 0);
this.tHorizontalSeparator1.BackColor = System.Drawing.Color.Transparent;
this.tHorizontalSeparator1.Location = new System.Drawing.Point(10, 77);
this.tHorizontalSeparator1.Margin = new System.Windows.Forms.Padding(10, 0, 10, 0);
this.tHorizontalSeparator1.MaximumSize = new System.Drawing.Size(4920, 2);
this.tHorizontalSeparator1.MinimumSize = new System.Drawing.Size(0, 22);
this.tHorizontalSeparator1.Name = "tHorizontalSeparator1";
this.tHorizontalSeparator1.Padding = new System.Windows.Forms.Padding(0, 10, 0, 10);
this.tHorizontalSeparator1.Size = new System.Drawing.Size(364, 22);
this.tHorizontalSeparator1.TabIndex = 188;
//
// numericBox1
//
this.numericBox1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.numericBox1.BackColor = System.Drawing.Color.Transparent;
this.numericBox1.Font = new System.Drawing.Font("Segoe UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point);
this.numericBox1.Location = new System.Drawing.Point(285, 20);
this.numericBox1.Margin = new System.Windows.Forms.Padding(10, 6, 10, 6);
this.numericBox1.Name = "numericBox1";
this.numericBox1.Padding = new System.Windows.Forms.Padding(8, 8, 7, 7);
this.numericBox1.Size = new System.Drawing.Size(84, 34);
this.numericBox1.SubmitButton = null;
this.numericBox1.TabIndex = 189;
this.numericBox1.Value = 0;
//
// NewForm
//
this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(384, 161);
this.Controls.Add(this.numericBox1);
this.Controls.Add(this.tHorizontalSeparator1);
this.Controls.Add(this.button1);
this.Controls.Add(this.label1);
this.MinimumSize = new System.Drawing.Size(400, 200);
this.Name = "NewForm";
this.Text = "New";
this.ResumeLayout(false);
this.PerformLayout();
}
public MainForm parentForm { get; set; } = null;
private void button1_Click(object sender, EventArgs e)
{
if (parentForm != null)
{
parentForm.Clear(numericBox1.Value);
}
this.Close();
}
}
}

60
NewForm.resx Normal file
View File

@ -0,0 +1,60 @@
<root>
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>

182
OpenFileForm.cs Normal file
View File

@ -0,0 +1,182 @@
using RyzStudio.Windows.ThemedForms;
using System;
using System.ComponentModel;
namespace FizzyLauncher
{
public class OpenFileForm : TDialogForm
{
private System.Windows.Forms.Label label1;
private TButton button1;
private System.Windows.Forms.Label label8;
private RyzStudio.Windows.Forms.THorizontalSeparator tHorizontalSeparator1;
private TOpenFileTextBox textBox1;
private TTextBox textBox2;
private System.Windows.Forms.OpenFileDialog openFileDialog1;
public OpenFileForm(MainForm parent) : base()
{
InitializeComponent();
this.ParentForm = parent;
textBox2.InnerTextBox.MaxLength = 128;
}
private void InitializeComponent()
{
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(OpenFileForm));
this.label1 = new System.Windows.Forms.Label();
this.button1 = new RyzStudio.Windows.ThemedForms.TButton();
this.label8 = new System.Windows.Forms.Label();
this.tHorizontalSeparator1 = new RyzStudio.Windows.Forms.THorizontalSeparator();
this.textBox1 = new RyzStudio.Windows.ThemedForms.TOpenFileTextBox();
this.openFileDialog1 = new System.Windows.Forms.OpenFileDialog();
this.textBox2 = new RyzStudio.Windows.ThemedForms.TTextBox();
this.SuspendLayout();
//
// label1
//
this.label1.AutoSize = true;
this.label1.BackColor = System.Drawing.Color.Transparent;
this.label1.ForeColor = System.Drawing.SystemColors.ControlText;
this.label1.Location = new System.Drawing.Point(10, 21);
this.label1.Margin = new System.Windows.Forms.Padding(0);
this.label1.Name = "label1";
this.label1.Padding = new System.Windows.Forms.Padding(0, 9, 0, 10);
this.label1.Size = new System.Drawing.Size(55, 34);
this.label1.TabIndex = 153;
this.label1.Text = "Filename";
this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
//
// button1
//
this.button1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.button1.BackColor = System.Drawing.Color.Transparent;
this.button1.DefaultImage = null;
this.button1.DownImage = null;
this.button1.IsSelected = false;
this.button1.LabelText = "&OK";
this.button1.Location = new System.Drawing.Point(321, 149);
this.button1.Margin = new System.Windows.Forms.Padding(10);
this.button1.Name = "button1";
this.button1.OverImage = null;
this.button1.Padding = new System.Windows.Forms.Padding(4, 4, 3, 3);
this.button1.Size = new System.Drawing.Size(128, 32);
this.button1.TabIndex = 173;
this.button1.Click += new System.EventHandler(this.button1_Click);
//
// label8
//
this.label8.AutoSize = true;
this.label8.BackColor = System.Drawing.Color.Transparent;
this.label8.ForeColor = System.Drawing.SystemColors.ControlText;
this.label8.Location = new System.Drawing.Point(10, 62);
this.label8.Margin = new System.Windows.Forms.Padding(0);
this.label8.Name = "label8";
this.label8.Padding = new System.Windows.Forms.Padding(0, 9, 0, 10);
this.label8.Size = new System.Drawing.Size(134, 34);
this.label8.TabIndex = 186;
this.label8.Text = "Password (If Applicable)";
this.label8.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
//
// tHorizontalSeparator1
//
this.tHorizontalSeparator1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.tHorizontalSeparator1.AutoScrollMargin = new System.Drawing.Size(0, 0);
this.tHorizontalSeparator1.AutoScrollMinSize = new System.Drawing.Size(0, 0);
this.tHorizontalSeparator1.BackColor = System.Drawing.Color.Transparent;
this.tHorizontalSeparator1.Location = new System.Drawing.Point(10, 117);
this.tHorizontalSeparator1.Margin = new System.Windows.Forms.Padding(10, 0, 10, 0);
this.tHorizontalSeparator1.MaximumSize = new System.Drawing.Size(4920, 2);
this.tHorizontalSeparator1.MinimumSize = new System.Drawing.Size(0, 22);
this.tHorizontalSeparator1.Name = "tHorizontalSeparator1";
this.tHorizontalSeparator1.Padding = new System.Windows.Forms.Padding(0, 10, 0, 10);
this.tHorizontalSeparator1.Size = new System.Drawing.Size(444, 22);
this.tHorizontalSeparator1.TabIndex = 188;
//
// textBox1
//
this.textBox1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.textBox1.BackColor = System.Drawing.Color.Transparent;
this.textBox1.FileDialog = this.openFileDialog1;
this.textBox1.Font = new System.Drawing.Font("Segoe UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point);
this.textBox1.HighlightImage = ((System.Drawing.Image)(resources.GetObject("textBox1.HighlightImage")));
this.textBox1.Location = new System.Drawing.Point(192, 20);
this.textBox1.Margin = new System.Windows.Forms.Padding(10, 3, 3, 3);
this.textBox1.Name = "textBox1";
this.textBox1.NormalImage = ((System.Drawing.Image)(resources.GetObject("textBox1.NormalImage")));
this.textBox1.Padding = new System.Windows.Forms.Padding(10, 10, 9, 9);
this.textBox1.Size = new System.Drawing.Size(257, 35);
this.textBox1.SubmitButton = null;
this.textBox1.TabIndex = 190;
this.textBox1.UseSystemPasswordChar = false;
//
// openFileDialog1
//
this.openFileDialog1.DefaultExt = "jsnx";
this.openFileDialog1.Filter = "Bookmarks files (*.jsnx)|*.jsnx|Bookmarks files (*.ryz)|*.ryz";
this.openFileDialog1.Title = "Open bookmarks file";
//
// textBox2
//
this.textBox2.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.textBox2.BackColor = System.Drawing.Color.Transparent;
this.textBox2.Font = new System.Drawing.Font("Segoe UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point);
this.textBox2.Location = new System.Drawing.Point(231, 62);
this.textBox2.Margin = new System.Windows.Forms.Padding(10, 6, 10, 6);
this.textBox2.Name = "textBox2";
this.textBox2.Padding = new System.Windows.Forms.Padding(10, 10, 9, 9);
this.textBox2.Size = new System.Drawing.Size(218, 35);
this.textBox2.SubmitButton = null;
this.textBox2.TabIndex = 191;
this.textBox2.UseSystemPasswordChar = true;
//
// OpenFileForm
//
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None;
this.ClientSize = new System.Drawing.Size(464, 201);
this.Controls.Add(this.textBox2);
this.Controls.Add(this.textBox1);
this.Controls.Add(this.tHorizontalSeparator1);
this.Controls.Add(this.label8);
this.Controls.Add(this.button1);
this.Controls.Add(this.label1);
this.MinimumSize = new System.Drawing.Size(400, 240);
this.Name = "OpenFileForm";
this.Text = "Open File";
this.ResumeLayout(false);
this.PerformLayout();
}
protected override void OnShown(EventArgs e)
{
base.OnShown(e);
this.DialogResult = System.Windows.Forms.DialogResult.None;
}
[Browsable(false), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public MainForm ParentForm { get; protected set; } = null;
[Browsable(false)]
public string FileName => textBox1.Text;
[Browsable(false)]
public string Password => textBox2.Text;
private void button1_Click(object sender, EventArgs e)
{
this.DialogResult = System.Windows.Forms.DialogResult.OK;
this.Close();
}
}
}

82
OpenFileForm.resx Normal file
View File

@ -0,0 +1,82 @@
<root>
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<metadata name="openFileDialog1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="textBox1.HighlightImage" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAO
vQAADr0BR/uQrQAAAK9JREFUOE/t0zsKwkAURuGp1BWJK3EhIrgAV+EOLLWwtRQLwQdiIbbiIkwynj+O
IVwnyhR2XvjyInNIkXHee8f0cEQBPbDOaKEarSvXhsAJO4wirlB4jipiA3phoIvIrLFChhnKiA3o8Ckw
RR93LNBODVwwwRL62kNKYIxNzQ1FSsDOEHk08HrYJMw/8KtA06/cCef6KJDZgDbTFrHNZO3x9idqOyui
m2+07bvPgHcPXOhtG3D6cUIAAAAASUVORK5CYII=
</value>
</data>
<data name="textBox1.NormalImage" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAO
vQAADr0BR/uQrQAAAMZJREFUOE/tk7sNwjAQQF3BRohJGAQhMQBTsAElFLSUiAKJTxIXhBZlCILNuyRG
iXEQKeg46fmsO/slhU9Za5XWehiXYcD6JElygZ6qhdwTioVDGo4wDXDjsohXdYkvMDTHVa8R9Hb0tpCz
XzqJL5Df/CRYRFE0Yn8nr9M07XcSwBXmXN6QDfncRTCjt6+Rgfla4Adfn3D+ERS4Yht/wY8FxVN2xTac
gLP5qyYLAhmmA4SGyeeEoPkSq3EWydsoB4gRDEqBVU/p15ajstHKCgAAAABJRU5ErkJggg==
</value>
</data>
</root>

279
OptionsForm.cs Normal file
View File

@ -0,0 +1,279 @@
using FizzyLauncher.Models;
using RyzStudio.Windows.ThemedForms;
using System;
namespace FizzyLauncher
{
public class OptionsForm : TDialogForm
{
private System.Windows.Forms.Label label1;
private TButton button1;
private TYesNoPickerBox pickerBox2;
private System.Windows.Forms.Label label6;
private TYesNoPickerBox pickerBox3;
private System.Windows.Forms.Label label7;
private System.Windows.Forms.Label label8;
private TPickerBox pickerBox1;
private RyzStudio.Windows.Forms.THorizontalSeparator tHorizontalSeparator1;
private TKeyCodeTextBox textBox1;
public OptionsForm(MainForm parent) : base()
{
InitializeComponent();
parentForm = parent;
pickerBox1.ComboBox.Items.Clear();
foreach (string item in Enum.GetNames(typeof(LauncherSession.AutoSaveOption)))
{
pickerBox1.ComboBox.Items.Add(item);
}
if (pickerBox1.ComboBox.Items.Count > 0) pickerBox1.ComboBox.SelectedIndex = 0;
}
private void InitializeComponent()
{
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(OptionsForm));
RyzStudio.Windows.ThemedForms.TKeyCodeTextBox.Results results1 = new RyzStudio.Windows.ThemedForms.TKeyCodeTextBox.Results();
this.label1 = new System.Windows.Forms.Label();
this.button1 = new RyzStudio.Windows.ThemedForms.TButton();
this.pickerBox2 = new RyzStudio.Windows.ThemedForms.TYesNoPickerBox();
this.label6 = new System.Windows.Forms.Label();
this.pickerBox3 = new RyzStudio.Windows.ThemedForms.TYesNoPickerBox();
this.label7 = new System.Windows.Forms.Label();
this.label8 = new System.Windows.Forms.Label();
this.pickerBox1 = new RyzStudio.Windows.ThemedForms.TPickerBox();
this.tHorizontalSeparator1 = new RyzStudio.Windows.Forms.THorizontalSeparator();
this.textBox1 = new RyzStudio.Windows.ThemedForms.TKeyCodeTextBox();
this.SuspendLayout();
//
// label1
//
this.label1.AutoSize = true;
this.label1.BackColor = System.Drawing.Color.Transparent;
this.label1.ForeColor = System.Drawing.SystemColors.ControlText;
this.label1.Location = new System.Drawing.Point(10, 21);
this.label1.Margin = new System.Windows.Forms.Padding(0);
this.label1.Name = "label1";
this.label1.Padding = new System.Windows.Forms.Padding(0, 9, 0, 10);
this.label1.Size = new System.Drawing.Size(107, 34);
this.label1.TabIndex = 153;
this.label1.Text = "Show/Hide Hotkey";
this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
//
// button1
//
this.button1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.button1.BackColor = System.Drawing.Color.Transparent;
this.button1.DefaultImage = null;
this.button1.DownImage = null;
this.button1.IsSelected = false;
this.button1.LabelText = "&Save";
this.button1.Location = new System.Drawing.Point(241, 469);
this.button1.Margin = new System.Windows.Forms.Padding(10);
this.button1.Name = "button1";
this.button1.OverImage = null;
this.button1.Padding = new System.Windows.Forms.Padding(4, 4, 3, 3);
this.button1.Size = new System.Drawing.Size(128, 32);
this.button1.TabIndex = 173;
this.button1.Click += new System.EventHandler(this.button1_Click);
//
// pickerBox2
//
this.pickerBox2.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.pickerBox2.BackColor = System.Drawing.Color.Transparent;
this.pickerBox2.Font = new System.Drawing.Font("Segoe UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point);
this.pickerBox2.Location = new System.Drawing.Point(285, 103);
this.pickerBox2.Margin = new System.Windows.Forms.Padding(10, 4, 10, 4);
this.pickerBox2.Name = "pickerBox2";
this.pickerBox2.Padding = new System.Windows.Forms.Padding(10, 6, 7, 5);
this.pickerBox2.Size = new System.Drawing.Size(84, 34);
this.pickerBox2.SubmitButton = null;
this.pickerBox2.TabIndex = 183;
this.pickerBox2.Value = true;
//
// label6
//
this.label6.AutoSize = true;
this.label6.BackColor = System.Drawing.Color.Transparent;
this.label6.ForeColor = System.Drawing.SystemColors.ControlText;
this.label6.Location = new System.Drawing.Point(10, 103);
this.label6.Margin = new System.Windows.Forms.Padding(0);
this.label6.Name = "label6";
this.label6.Padding = new System.Windows.Forms.Padding(0, 9, 0, 10);
this.label6.Size = new System.Drawing.Size(83, 34);
this.label6.TabIndex = 182;
this.label6.Text = "Hide On Close";
this.label6.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
//
// pickerBox3
//
this.pickerBox3.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.pickerBox3.BackColor = System.Drawing.Color.Transparent;
this.pickerBox3.Font = new System.Drawing.Font("Segoe UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point);
this.pickerBox3.Location = new System.Drawing.Point(285, 144);
this.pickerBox3.Margin = new System.Windows.Forms.Padding(10, 4, 10, 4);
this.pickerBox3.Name = "pickerBox3";
this.pickerBox3.Padding = new System.Windows.Forms.Padding(10, 6, 7, 5);
this.pickerBox3.Size = new System.Drawing.Size(84, 34);
this.pickerBox3.SubmitButton = null;
this.pickerBox3.TabIndex = 185;
this.pickerBox3.Value = true;
//
// label7
//
this.label7.AutoSize = true;
this.label7.BackColor = System.Drawing.Color.Transparent;
this.label7.ForeColor = System.Drawing.SystemColors.ControlText;
this.label7.Location = new System.Drawing.Point(10, 144);
this.label7.Margin = new System.Windows.Forms.Padding(0);
this.label7.Name = "label7";
this.label7.Padding = new System.Windows.Forms.Padding(0, 9, 0, 10);
this.label7.Size = new System.Drawing.Size(95, 34);
this.label7.TabIndex = 184;
this.label7.Text = "Hide On Execute";
this.label7.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
//
// label8
//
this.label8.AutoSize = true;
this.label8.BackColor = System.Drawing.Color.Transparent;
this.label8.ForeColor = System.Drawing.SystemColors.ControlText;
this.label8.Location = new System.Drawing.Point(10, 62);
this.label8.Margin = new System.Windows.Forms.Padding(0);
this.label8.Name = "label8";
this.label8.Padding = new System.Windows.Forms.Padding(0, 9, 0, 10);
this.label8.Size = new System.Drawing.Size(60, 34);
this.label8.TabIndex = 186;
this.label8.Text = "Auto Save";
this.label8.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
//
// pickerBox1
//
this.pickerBox1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.pickerBox1.BackColor = System.Drawing.Color.Transparent;
this.pickerBox1.Font = new System.Drawing.Font("Segoe UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point);
this.pickerBox1.Location = new System.Drawing.Point(285, 62);
this.pickerBox1.Margin = new System.Windows.Forms.Padding(10, 4, 10, 4);
this.pickerBox1.Name = "pickerBox1";
this.pickerBox1.Padding = new System.Windows.Forms.Padding(10, 6, 7, 5);
this.pickerBox1.Size = new System.Drawing.Size(84, 34);
this.pickerBox1.SubmitButton = null;
this.pickerBox1.TabIndex = 187;
//
// tHorizontalSeparator1
//
this.tHorizontalSeparator1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.tHorizontalSeparator1.AutoScrollMargin = new System.Drawing.Size(0, 0);
this.tHorizontalSeparator1.AutoScrollMinSize = new System.Drawing.Size(0, 0);
this.tHorizontalSeparator1.BackColor = System.Drawing.Color.Transparent;
this.tHorizontalSeparator1.Location = new System.Drawing.Point(10, 437);
this.tHorizontalSeparator1.Margin = new System.Windows.Forms.Padding(10, 0, 10, 0);
this.tHorizontalSeparator1.MaximumSize = new System.Drawing.Size(4920, 2);
this.tHorizontalSeparator1.MinimumSize = new System.Drawing.Size(0, 22);
this.tHorizontalSeparator1.Name = "tHorizontalSeparator1";
this.tHorizontalSeparator1.Padding = new System.Windows.Forms.Padding(0, 10, 0, 10);
this.tHorizontalSeparator1.Size = new System.Drawing.Size(364, 22);
this.tHorizontalSeparator1.TabIndex = 188;
//
// textBox1
//
this.textBox1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.textBox1.BackColor = System.Drawing.Color.Transparent;
this.textBox1.Font = new System.Drawing.Font("Segoe UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point);
this.textBox1.HighlightImage = ((System.Drawing.Image)(resources.GetObject("textBox1.HighlightImage")));
results1.IsAlt = false;
results1.IsCtrl = false;
results1.IsShift = false;
results1.Key = System.Windows.Forms.Keys.None;
this.textBox1.KeyCodeResults = results1;
this.textBox1.Location = new System.Drawing.Point(192, 20);
this.textBox1.Margin = new System.Windows.Forms.Padding(10, 3, 3, 3);
this.textBox1.Name = "textBox1";
this.textBox1.NormalImage = ((System.Drawing.Image)(resources.GetObject("textBox1.NormalImage")));
this.textBox1.Padding = new System.Windows.Forms.Padding(10, 10, 9, 9);
this.textBox1.Size = new System.Drawing.Size(177, 35);
this.textBox1.SubmitButton = null;
this.textBox1.TabIndex = 189;
this.textBox1.UseSystemPasswordChar = false;
//
// OptionsForm
//
this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(384, 521);
this.Controls.Add(this.textBox1);
this.Controls.Add(this.tHorizontalSeparator1);
this.Controls.Add(this.pickerBox1);
this.Controls.Add(this.label8);
this.Controls.Add(this.pickerBox3);
this.Controls.Add(this.label7);
this.Controls.Add(this.pickerBox2);
this.Controls.Add(this.label6);
this.Controls.Add(this.button1);
this.Controls.Add(this.label1);
this.MinimumSize = new System.Drawing.Size(400, 560);
this.Name = "OptionsForm";
this.Text = "Options";
this.ResumeLayout(false);
this.PerformLayout();
}
protected override void OnShown(EventArgs e)
{
base.OnShown(e);
if (parentForm == null)
{
return;
}
if (parentForm.CurrentSession == null)
{
return;
}
// hotkey
if (parentForm.CurrentSession.HotKey != null)
{
textBox1.UpdateKeyCode(parentForm.CurrentSession.HotKey.IsCtrl, parentForm.CurrentSession.HotKey.IsAlt, parentForm.CurrentSession.HotKey.IsShift, parentForm.CurrentSession.HotKey.KeyCode);
}
pickerBox1.ComboBox.SelectedIndex = (int)parentForm.CurrentSession.AutoSave;
pickerBox2.Value = parentForm.CurrentSession.HideOnClose;
pickerBox3.Value = parentForm.CurrentSession.HideOnClick;
}
public MainForm parentForm { get; set; } = null;
private void button1_Click(object sender, EventArgs e)
{
if (parentForm != null)
{
if (parentForm.CurrentSession == null) parentForm.CurrentSession = new LauncherSession();
if (parentForm.CurrentSession.HotKey == null) parentForm.CurrentSession.HotKey = new LauncherSession.HotKeyOptions();
parentForm.CurrentSession.HotKey.IsCtrl = textBox1.KeyCodeResults.IsCtrl;
parentForm.CurrentSession.HotKey.IsAlt = textBox1.KeyCodeResults.IsAlt;
parentForm.CurrentSession.HotKey.IsShift = textBox1.KeyCodeResults.IsShift;
parentForm.CurrentSession.HotKey.Key = textBox1.KeyCodeResults.KeyCode;
parentForm.CurrentSession.AutoSave = (LauncherSession.AutoSaveOption)pickerBox1.ComboBox.SelectedIndex;
parentForm.CurrentSession.HideOnClose = pickerBox2.Value;
parentForm.CurrentSession.HideOnClick = pickerBox3.Value;
}
this.Close();
}
}
}

80
OptionsForm.resx Normal file
View File

@ -0,0 +1,80 @@
<root>
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="textBox1.HighlightImage" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAAA4AAAAQCAYAAAAmlE46AAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAO
vAAADrwBlbxySQAAABl0RVh0U29mdHdhcmUAd3d3Lmlua3NjYXBlLm9yZ5vuPBoAAAClSURBVDhP7dI/
DgFBGIbxSVTKjcRx3MLqXYCOjkocQcMF3MAZOIKaE5AthOexf2QnbJQKb/JLJvO9XzLFhCgtbHDBveB5
DWcfM8ANC0wKnr1LUUsbHXSxxBlJxDtnduy6E04on/Utd0IPOxwxxBT9iHfO7Nh155kV9vmxMXbsVvkv
vvIji4f82Bg7tcUxrpih/NyxOeyMUMVPu0WGd39TzuzQDeEB5/ZKvTSyulEAAAAASUVORK5CYII=
</value>
</data>
<data name="textBox1.NormalImage" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAAA4AAAAQCAYAAAAmlE46AAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAO
vAAADrwBlbxySQAAABl0RVh0U29mdHdhcmUAd3d3Lmlua3NjYXBlLm9yZ5vuPBoAAADTSURBVDhP7ZI7
CsJQEEUfWFmK4HLchdpnA9ppp5W4BBtdQNyBC0ilRf6VdVyBwUL03JdXxC/YWThwmDcz94YJjKmH7/uN
OI7XaZqekiS5Cr1hpZmTPQemAeILeU4eC/dWr+9kVQRB0MzzvB2GYQfBAsExiqJWHfU0k0ZaeQyNAuxa
X1CYLMu6/MOW4kD2YAK9B9TznGYrj12XVZY0drb4ENJI68q/sR4/YoS9K9+GNHdGLmIEJV+cku1xP4Jh
Ri7JQ2erDp3mBs7w6jaFZht74MaYGwmLbkeRGexGAAAAAElFTkSuQmCC
</value>
</data>
</root>

151
PasswordForm.cs Normal file
View File

@ -0,0 +1,151 @@
using RyzStudio.Windows.ThemedForms;
using System;
using System.ComponentModel;
using System.Windows.Forms;
namespace FizzyLauncher
{
public class PasswordForm : TDialogForm
{
private System.Windows.Forms.Label label1;
private TButton button1;
private RyzStudio.Windows.Forms.THorizontalSeparator tHorizontalSeparator1;
private TTextBox textBox1;
public PasswordForm(MainForm parent)
{
InitializeComponent();
this.ParentForm = parent;
this.StartPosition = FormStartPosition.WindowsDefaultLocation;
textBox1.InnerTextBox.MaxLength = 255;
textBox1.InnerTextBox.PreviewKeyDown += textBox1_PreviewKeyDown;
}
private void InitializeComponent()
{
this.label1 = new System.Windows.Forms.Label();
this.button1 = new RyzStudio.Windows.ThemedForms.TButton();
this.tHorizontalSeparator1 = new RyzStudio.Windows.Forms.THorizontalSeparator();
this.textBox1 = new RyzStudio.Windows.ThemedForms.TTextBox();
this.SuspendLayout();
//
// label1
//
this.label1.AutoSize = true;
this.label1.BackColor = System.Drawing.Color.Transparent;
this.label1.ForeColor = System.Drawing.SystemColors.ControlText;
this.label1.Location = new System.Drawing.Point(10, 21);
this.label1.Margin = new System.Windows.Forms.Padding(0);
this.label1.Name = "label1";
this.label1.Padding = new System.Windows.Forms.Padding(0, 9, 0, 10);
this.label1.Size = new System.Drawing.Size(57, 34);
this.label1.TabIndex = 153;
this.label1.Text = "Password";
this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
//
// button1
//
this.button1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.button1.BackColor = System.Drawing.Color.Transparent;
this.button1.DefaultImage = null;
this.button1.DownImage = null;
this.button1.IsSelected = false;
this.button1.LabelText = "&OK";
this.button1.Location = new System.Drawing.Point(321, 99);
this.button1.Margin = new System.Windows.Forms.Padding(10);
this.button1.Name = "button1";
this.button1.OverImage = null;
this.button1.Padding = new System.Windows.Forms.Padding(4, 4, 3, 3);
this.button1.Size = new System.Drawing.Size(128, 32);
this.button1.TabIndex = 173;
this.button1.Click += new System.EventHandler(this.button1_Click);
//
// tHorizontalSeparator1
//
this.tHorizontalSeparator1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.tHorizontalSeparator1.AutoScrollMargin = new System.Drawing.Size(0, 0);
this.tHorizontalSeparator1.AutoScrollMinSize = new System.Drawing.Size(0, 0);
this.tHorizontalSeparator1.BackColor = System.Drawing.Color.Transparent;
this.tHorizontalSeparator1.Location = new System.Drawing.Point(10, 67);
this.tHorizontalSeparator1.Margin = new System.Windows.Forms.Padding(10, 0, 10, 0);
this.tHorizontalSeparator1.MaximumSize = new System.Drawing.Size(4920, 2);
this.tHorizontalSeparator1.MinimumSize = new System.Drawing.Size(0, 22);
this.tHorizontalSeparator1.Name = "tHorizontalSeparator1";
this.tHorizontalSeparator1.Padding = new System.Windows.Forms.Padding(0, 10, 0, 10);
this.tHorizontalSeparator1.Size = new System.Drawing.Size(444, 22);
this.tHorizontalSeparator1.TabIndex = 188;
//
// textBox1
//
this.textBox1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.textBox1.BackColor = System.Drawing.Color.Transparent;
this.textBox1.Font = new System.Drawing.Font("Segoe UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point);
this.textBox1.Location = new System.Drawing.Point(121, 20);
this.textBox1.Margin = new System.Windows.Forms.Padding(10, 6, 10, 6);
this.textBox1.Name = "textBox1";
this.textBox1.Padding = new System.Windows.Forms.Padding(10, 10, 9, 9);
this.textBox1.Size = new System.Drawing.Size(328, 35);
this.textBox1.SubmitButton = null;
this.textBox1.TabIndex = 191;
this.textBox1.UseSystemPasswordChar = true;
//
// PasswordForm
//
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None;
this.ClientSize = new System.Drawing.Size(464, 151);
this.Controls.Add(this.textBox1);
this.Controls.Add(this.tHorizontalSeparator1);
this.Controls.Add(this.button1);
this.Controls.Add(this.label1);
this.MinimumSize = new System.Drawing.Size(480, 190);
this.Name = "PasswordForm";
this.Text = "Password";
this.ResumeLayout(false);
this.PerformLayout();
}
protected override void OnShown(EventArgs e)
{
base.OnShown(e);
this.DialogResult = System.Windows.Forms.DialogResult.None;
textBox1.InnerTextBox.Focus();
}
[Browsable(false), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public MainForm ParentForm { get; protected set; } = null;
[Browsable(false)]
public string Password => textBox1.Text;
private void textBox1_PreviewKeyDown(object sender, PreviewKeyDownEventArgs e)
{
switch (e.KeyCode)
{
case Keys.Enter:
button1_Click(null, null);
break;
case Keys.Escape:
this.Close();
break;
default: break;
}
}
private void button1_Click(object sender, EventArgs e)
{
this.DialogResult = System.Windows.Forms.DialogResult.OK;
this.Close();
}
}
}

60
PasswordForm.resx Normal file
View File

@ -0,0 +1,60 @@
<root>
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>

23
Program.cs Normal file
View File

@ -0,0 +1,23 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace FizzyLauncher
{
static class Program
{
/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
static void Main()
{
Application.SetHighDpiMode(HighDpiMode.SystemAware);
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new MainForm());
}
}
}

View File

@ -0,0 +1,17 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
https://go.microsoft.com/fwlink/?LinkID=208121.
-->
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration>Release</Configuration>
<Platform>Any CPU</Platform>
<PublishDir>bin\Release\64\</PublishDir>
<PublishProtocol>FileSystem</PublishProtocol>
<TargetFramework>net5.0-windows</TargetFramework>
<RuntimeIdentifier>win-x64</RuntimeIdentifier>
<SelfContained>false</SelfContained>
<PublishSingleFile>True</PublishSingleFile>
<PublishReadyToRun>False</PublishReadyToRun>
</PropertyGroup>
</Project>

View File

@ -0,0 +1,17 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
https://go.microsoft.com/fwlink/?LinkID=208121.
-->
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration>Release</Configuration>
<Platform>Any CPU</Platform>
<PublishDir>bin\Release\86\</PublishDir>
<PublishProtocol>FileSystem</PublishProtocol>
<TargetFramework>net5.0-windows</TargetFramework>
<RuntimeIdentifier>win-x86</RuntimeIdentifier>
<SelfContained>false</SelfContained>
<PublishSingleFile>True</PublishSingleFile>
<PublishReadyToRun>False</PublishReadyToRun>
</PropertyGroup>
</Project>

BIN
Resources/UI/arrow_down.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 601 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 417 B

BIN
Resources/UI/arrow_up.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 590 B

BIN
Resources/UI/arrow_up2.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 410 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 597 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 421 B

BIN
Resources/UI/close.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 367 B

BIN
Resources/UI/close2.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 468 B

BIN
Resources/UI/cog.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 713 B

BIN
Resources/UI/cog2.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 467 B

BIN
Resources/UI/disk.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 439 B

BIN
Resources/UI/disk2.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 347 B

BIN
Resources/UI/edit.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 612 B

BIN
Resources/UI/edit2.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 419 B

BIN
Resources/UI/file.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 372 B

BIN
Resources/UI/file2.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 323 B

BIN
Resources/UI/folder.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 352 B

BIN
Resources/UI/folder2.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 288 B

BIN
Resources/UI/help.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 670 B

BIN
Resources/UI/help2.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 436 B

603
Resources/UI/icons.svg Normal file
View File

@ -0,0 +1,603 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
inkscape:version="1.0 (4035a4fb49, 2020-05-01)"
sodipodi:docname="icons.svg"
id="svg8"
version="1.1"
class="feather feather-save"
stroke-linejoin="round"
stroke-linecap="round"
stroke-width="2"
stroke="currentColor"
fill="none"
viewBox="0 0 169.84447 96.385719"
height="96.385719"
width="169.84447">
<metadata
id="metadata14">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title></dc:title>
</cc:Work>
</rdf:RDF>
</metadata>
<defs
id="defs12" />
<sodipodi:namedview
inkscape:current-layer="svg8"
inkscape:window-maximized="1"
inkscape:window-y="845"
inkscape:window-x="1072"
inkscape:cy="82.547694"
inkscape:cx="114.18197"
inkscape:zoom="6.2608413"
showgrid="false"
id="namedview10"
inkscape:window-height="1017"
inkscape:window-width="1920"
inkscape:pageshadow="2"
inkscape:pageopacity="0"
guidetolerance="10"
gridtolerance="10"
objecttolerance="10"
borderopacity="1"
bordercolor="#666666"
pagecolor="#ffffff"
inkscape:document-rotation="0"
fit-margin-top="0"
fit-margin-left="0"
fit-margin-right="0"
fit-margin-bottom="0" />
<g
inkscape:export-ydpi="96"
inkscape:export-xdpi="96"
transform="matrix(0.80171614,0,0,0.7982539,18.396568,-1.5965078)"
id="g842">
<path
d="M 19,21 H 5 A 2,2 0 0 1 3,19 V 5 A 2,2 0 0 1 5,3 h 11 l 5,5 v 11 a 2,2 0 0 1 -2,2 z"
id="path2" />
<polyline
points="17 21 17 13 7 13 7 21"
id="polyline4" />
<polyline
points="7 3 7 8 15 8"
id="polyline6" />
</g>
<g
inkscape:export-ydpi="96"
inkscape:export-xdpi="96"
transform="matrix(0.65647058,0,0,0.65647058,4e-8,20)"
id="g894"
style="fill:none;stroke:#d4d4d4;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-opacity:1">
<circle
style="stroke:#d4d4d4;stroke-opacity:1"
cx="12"
cy="12"
r="3"
id="circle880" />
<path
style="stroke:#d4d4d4;stroke-opacity:1"
d="m 19.4,15 a 1.65,1.65 0 0 0 0.33,1.82 l 0.06,0.06 a 2,2 0 0 1 0,2.83 2,2 0 0 1 -2.83,0 L 16.9,19.65 a 1.65,1.65 0 0 0 -1.82,-0.33 1.65,1.65 0 0 0 -1,1.51 V 21 a 2,2 0 0 1 -2,2 2,2 0 0 1 -2,-2 V 20.91 A 1.65,1.65 0 0 0 9,19.4 1.65,1.65 0 0 0 7.18,19.73 l -0.06,0.06 a 2,2 0 0 1 -2.83,0 2,2 0 0 1 0,-2.83 L 4.35,16.9 a 1.65,1.65 0 0 0 0.33,-1.82 1.65,1.65 0 0 0 -1.51,-1 H 3 a 2,2 0 0 1 -2,-2 2,2 0 0 1 2,-2 H 3.09 A 1.65,1.65 0 0 0 4.6,9 1.65,1.65 0 0 0 4.27,7.18 L 4.21,7.12 a 2,2 0 0 1 0,-2.83 2,2 0 0 1 2.83,0 L 7.1,4.35 A 1.65,1.65 0 0 0 8.92,4.68 H 9 A 1.65,1.65 0 0 0 10,3.17 V 3 a 2,2 0 0 1 2,-2 2,2 0 0 1 2,2 v 0.09 a 1.65,1.65 0 0 0 1,1.51 1.65,1.65 0 0 0 1.82,-0.33 l 0.06,-0.06 a 2,2 0 0 1 2.83,0 2,2 0 0 1 0,2.83 L 19.65,7.1 A 1.65,1.65 0 0 0 19.32,8.92 V 9 a 1.65,1.65 0 0 0 1.51,1 H 21 a 2,2 0 0 1 2,2 2,2 0 0 1 -2,2 h -0.09 a 1.65,1.65 0 0 0 -1.51,1 z"
id="path882" />
</g>
<g
inkscape:export-ydpi="96"
inkscape:export-xdpi="96"
style="stroke:#d4d4d4;stroke-opacity:1"
id="g842-8"
transform="matrix(0.80171614,0,0,0.7982539,-1.6034323,-1.5965078)">
<path
style="stroke:#d4d4d4;stroke-opacity:1"
id="path2-6"
d="M 19,21 H 5 A 2,2 0 0 1 3,19 V 5 A 2,2 0 0 1 5,3 h 11 l 5,5 v 11 a 2,2 0 0 1 -2,2 z" />
<polyline
style="stroke:#d4d4d4;stroke-opacity:1"
id="polyline4-7"
points="17 21 17 13 7 13 7 21" />
<polyline
style="stroke:#d4d4d4;stroke-opacity:1"
id="polyline6-7"
points="7 3 7 8 15 8" />
</g>
<g
inkscape:export-ydpi="96"
inkscape:export-xdpi="96"
style="fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round"
id="g894-2"
transform="matrix(0.65647058,0,0,0.65647058,20,20)">
<circle
id="circle880-3"
r="3"
cy="12"
cx="12" />
<path
id="path882-5"
d="m 19.4,15 a 1.65,1.65 0 0 0 0.33,1.82 l 0.06,0.06 a 2,2 0 0 1 0,2.83 2,2 0 0 1 -2.83,0 L 16.9,19.65 a 1.65,1.65 0 0 0 -1.82,-0.33 1.65,1.65 0 0 0 -1,1.51 V 21 a 2,2 0 0 1 -2,2 2,2 0 0 1 -2,-2 V 20.91 A 1.65,1.65 0 0 0 9,19.4 1.65,1.65 0 0 0 7.18,19.73 l -0.06,0.06 a 2,2 0 0 1 -2.83,0 2,2 0 0 1 0,-2.83 L 4.35,16.9 a 1.65,1.65 0 0 0 0.33,-1.82 1.65,1.65 0 0 0 -1.51,-1 H 3 a 2,2 0 0 1 -2,-2 2,2 0 0 1 2,-2 H 3.09 A 1.65,1.65 0 0 0 4.6,9 1.65,1.65 0 0 0 4.27,7.18 L 4.21,7.12 a 2,2 0 0 1 0,-2.83 2,2 0 0 1 2.83,0 L 7.1,4.35 A 1.65,1.65 0 0 0 8.92,4.68 H 9 A 1.65,1.65 0 0 0 10,3.17 V 3 a 2,2 0 0 1 2,-2 2,2 0 0 1 2,2 v 0.09 a 1.65,1.65 0 0 0 1,1.51 1.65,1.65 0 0 0 1.82,-0.33 l 0.06,-0.06 a 2,2 0 0 1 2.83,0 2,2 0 0 1 0,2.83 L 19.65,7.1 A 1.65,1.65 0 0 0 19.32,8.92 V 9 a 1.65,1.65 0 0 0 1.51,1 H 21 a 2,2 0 0 1 2,2 2,2 0 0 1 -2,2 h -0.09 a 1.65,1.65 0 0 0 -1.51,1 z" />
</g>
<g
inkscape:export-ydpi="96"
inkscape:export-xdpi="96"
transform="matrix(0.7484492,0,0,0.7484492,-0.74844916,39.251551)"
id="g958"
style="fill:none;stroke:#d4d4d4;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-opacity:1">
<circle
style="stroke:#d4d4d4;stroke-opacity:1"
cx="12"
cy="12"
r="10"
id="circle941" />
<path
style="stroke:#d4d4d4;stroke-opacity:1"
d="m 9.09,9 a 3,3 0 0 1 5.83,1 c 0,2 -3,3 -3,3"
id="path943" />
<line
style="stroke:#d4d4d4;stroke-opacity:1"
x1="12"
y1="17"
x2="12.01"
y2="17"
id="line945" />
</g>
<g
inkscape:export-ydpi="96"
inkscape:export-xdpi="96"
style="fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round"
id="g958-4"
transform="matrix(0.7484492,0,0,0.7484492,19.251551,39.251551)">
<circle
id="circle941-9"
r="10"
cy="12"
cx="12" />
<path
id="path943-1"
d="m 9.09,9 a 3,3 0 0 1 5.83,1 c 0,2 -3,3 -3,3" />
<line
id="line945-3"
y2="17"
x2="12.01"
y1="17"
x1="12" />
</g>
<g
style="fill:none;stroke:#d4d4d4;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-opacity:1"
id="g1510"
transform="translate(36,-4)">
<line
id="line1496"
y2="19"
x2="12"
y1="5"
x1="12"
style="stroke:#d4d4d4;stroke-opacity:1" />
<line
id="line1498"
y2="12"
x2="19"
y1="12"
x1="5"
style="stroke:#d4d4d4;stroke-opacity:1" />
</g>
<g
transform="translate(56,-4)"
id="g1510-0"
style="fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round">
<line
x1="12"
y1="5"
x2="12"
y2="19"
id="line1496-5" />
<line
x1="5"
y1="12"
x2="19"
y2="12"
id="line1498-1" />
</g>
<g
style="fill:none;stroke:#d4d4d4;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-opacity:1"
id="g1560"
transform="matrix(0.81929378,0,0,0.81929378,38.361382,18.491799)"
inkscape:export-xdpi="96"
inkscape:export-ydpi="96">
<path
id="path1546"
d="m 12,20 h 9"
style="stroke:#d4d4d4;stroke-opacity:1" />
<path
id="path1548"
d="m 16.5,3.5 a 2.1213203,2.1213203 0 0 1 3,3 L 7,19 3,20 4,16 Z"
style="stroke:#d4d4d4;stroke-opacity:1" />
</g>
<g
transform="matrix(0.81929378,0,0,0.81929378,58.361382,18.491799)"
id="g1560-8"
style="fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round"
inkscape:export-xdpi="96"
inkscape:export-ydpi="96">
<path
d="m 12,20 h 9"
id="path1546-2" />
<path
d="m 16.5,3.5 a 2.1213203,2.1213203 0 0 1 3,3 L 7,19 3,20 4,16 Z"
id="path1548-4" />
</g>
<line
id="line1498-7"
y2="48"
x2="55"
y1="48"
x1="41"
style="fill:none;stroke:#d4d4d4;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-opacity:1" />
<line
style="fill:none;stroke:#000000;stroke-width:2;stroke-linecap:round;stroke-linejoin:round"
x1="61"
y1="48"
x2="75"
y2="48"
id="line1498-1-9" />
<g
style="fill:none;stroke:#d4d4d4;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-opacity:1"
id="g1631"
transform="matrix(0.88705882,0,0,0.88705882,36.451765,57.338728)"
inkscape:export-xdpi="96"
inkscape:export-ydpi="96">
<polygon
id="polygon1617"
points="19,4 19,20 9,12 "
style="stroke:#d4d4d4;stroke-opacity:1" />
<line
id="line1619"
y2="5"
x2="5"
y1="19"
x1="5"
style="stroke:#d4d4d4;stroke-opacity:1" />
</g>
<g
transform="matrix(0.88705882,0,0,0.88705882,56.451765,57.338728)"
id="g1631-1"
style="fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round"
inkscape:export-xdpi="96"
inkscape:export-ydpi="96">
<polygon
points="9,12 19,4 19,20 "
id="polygon1617-1" />
<line
x1="5"
y1="19"
x2="5"
y2="5"
id="line1619-8" />
</g>
<g
style="fill:none;stroke:#d4d4d4;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-opacity:1"
id="g1706"
transform="matrix(0.712,0,0,0.712,-0.12988241,63.506823)">
<polyline
id="polyline1686"
points="3 6 5 6 21 6"
style="stroke:#d4d4d4;stroke-opacity:1" />
<path
id="path1688"
d="m 19,6 v 14 a 2,2 0 0 1 -2,2 H 7 A 2,2 0 0 1 5,20 V 6 M 8,6 V 4 a 2,2 0 0 1 2,-2 h 4 a 2,2 0 0 1 2,2 v 2"
style="stroke:#d4d4d4;stroke-opacity:1" />
<line
id="line1690"
y2="17"
x2="10"
y1="11"
x1="10"
style="stroke:#d4d4d4;stroke-opacity:1" />
<line
id="line1692"
y2="17"
x2="14"
y1="11"
x1="14"
style="stroke:#d4d4d4;stroke-opacity:1" />
</g>
<g
transform="matrix(0.712,0,0,0.712,19.691294,63.39953)"
id="g1706-5"
style="fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round">
<polyline
points="3 6 5 6 21 6"
id="polyline1686-0" />
<path
d="m 19,6 v 14 a 2,2 0 0 1 -2,2 H 7 A 2,2 0 0 1 5,20 V 6 M 8,6 V 4 a 2,2 0 0 1 2,-2 h 4 a 2,2 0 0 1 2,2 v 2"
id="path1688-2" />
<line
x1="10"
y1="11"
x2="10"
y2="17"
id="line1690-1" />
<line
x1="14"
y1="11"
x2="14"
y2="17"
id="line1692-7" />
</g>
<g
style="fill:none;stroke:#d4d4d4;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-opacity:1"
id="g1746"
transform="matrix(0.88297886,0,0,0.81929262,37.468085,78.361347)"
inkscape:export-xdpi="96"
inkscape:export-ydpi="96">
<polygon
id="polygon1735"
points="5,21 5,3 19,12 "
style="stroke:#d4d4d4;stroke-opacity:1" />
</g>
<g
transform="matrix(0.88297886,0,0,0.81929262,57.468085,78.361347)"
id="g1746-7"
style="fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round"
inkscape:export-xdpi="96"
inkscape:export-ydpi="96">
<polygon
points="19,12 5,21 5,3 "
id="polygon1735-2" />
</g>
<g
style="fill:none;stroke:#d4d4d4;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-opacity:1"
id="g1783"
transform="matrix(0.80034632,0,0,0.80034632,78.399307,-1.6006926)"
inkscape:export-xdpi="96"
inkscape:export-ydpi="96">
<rect
id="rect1766"
ry="2"
rx="2"
height="18"
width="18"
y="3"
x="3"
style="stroke:#d4d4d4;stroke-opacity:1" />
<line
id="line1768"
y2="16"
x2="12"
y1="8"
x1="12"
style="stroke:#d4d4d4;stroke-opacity:1" />
<line
id="line1770"
y2="12"
x2="16"
y1="12"
x1="8"
style="stroke:#d4d4d4;stroke-opacity:1" />
</g>
<g
transform="matrix(0.80034632,0,0,0.80034632,98.399307,-1.6006926)"
id="g1783-8"
style="fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round"
inkscape:export-xdpi="96"
inkscape:export-ydpi="96">
<rect
x="3"
y="3"
width="18"
height="18"
rx="2"
ry="2"
id="rect1766-0" />
<line
x1="12"
y1="8"
x2="12"
y2="16"
id="line1768-6" />
<line
x1="8"
y1="12"
x2="16"
y2="12"
id="line1770-7" />
</g>
<g
style="fill:none;stroke:#d4d4d4;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-opacity:1"
id="g1823"
transform="matrix(0.80034632,0,0,0.80034632,78.399307,18.399307)"
inkscape:export-xdpi="96"
inkscape:export-ydpi="96">
<rect
id="rect1809"
ry="2"
rx="2"
height="18"
width="18"
y="3"
x="3"
style="stroke:#d4d4d4;stroke-opacity:1" />
<line
id="line1811"
y2="12"
x2="16"
y1="12"
x1="8"
style="stroke:#d4d4d4;stroke-opacity:1" />
</g>
<g
transform="matrix(0.80034632,0,0,0.80034632,98.399307,18.399307)"
id="g1823-1"
style="fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round"
inkscape:export-xdpi="96"
inkscape:export-ydpi="96">
<rect
x="3"
y="3"
width="18"
height="18"
rx="2"
ry="2"
id="rect1809-3" />
<line
x1="8"
y1="12"
x2="16"
y2="12"
id="line1811-8" />
</g>
<g
style="fill:none;stroke:#d4d4d4;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-opacity:1"
id="g1863"
transform="matrix(0.81745949,0,0,0.81745949,81.164106,40.822659)"
inkscape:export-xdpi="96"
inkscape:export-ydpi="96">
<line
id="line1846"
y2="12"
x2="21"
y1="12"
x1="3"
style="stroke:#d4d4d4;stroke-opacity:1" />
<line
id="line1848"
y2="6"
x2="21"
y1="6"
x1="3"
style="stroke:#d4d4d4;stroke-opacity:1" />
<line
id="line1850"
y2="18"
x2="21"
y1="18"
x1="3"
style="stroke:#d4d4d4;stroke-opacity:1" />
</g>
<g
transform="matrix(0.81745949,0,0,0.81745949,101.35765,40.982382)"
id="g1863-1"
style="fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round"
inkscape:export-xdpi="96"
inkscape:export-ydpi="96">
<line
x1="3"
y1="12"
x2="21"
y2="12"
id="line1846-4" />
<line
x1="3"
y1="6"
x2="21"
y2="6"
id="line1848-6" />
<line
x1="3"
y1="18"
x2="21"
y2="18"
id="line1850-4" />
</g>
<g
transform="matrix(0.74589532,0,0,0.74589532,96.546258,74.664217)"
id="g929"
style="fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round">
<circle
cx="12"
cy="12"
r="10"
id="circle915" />
<rect
x="9"
y="9"
width="6"
height="6"
id="rect917" />
</g>
<g
inkscape:export-ydpi="96"
inkscape:export-xdpi="96"
style="stroke:#d4d4d4;stroke-opacity:1"
id="g983">
<circle
style="fill:none;stroke:#d4d4d4;stroke-width:1.49179;stroke-linecap:round;stroke-linejoin:round;stroke-opacity:1"
id="circle915-1"
r="7.4589534"
cy="71.717644"
cx="139.14354" />
<g
transform="matrix(0.3092242,0,0,0.3092242,135.44162,67.965769)"
id="g1863-1-2"
style="fill:none;stroke:#d4d4d4;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-opacity:1"
inkscape:export-xdpi="96"
inkscape:export-ydpi="96">
<line
style="stroke:#d4d4d4;stroke-opacity:1"
x1="3"
y1="12"
x2="21"
y2="12"
id="line1846-4-8" />
<line
style="stroke:#d4d4d4;stroke-opacity:1"
x1="3"
y1="6"
x2="21"
y2="6"
id="line1848-6-9" />
<line
style="stroke:#d4d4d4;stroke-opacity:1"
x1="3"
y1="18"
x2="21"
y2="18"
id="line1850-4-1" />
</g>
</g>
<g
inkscape:export-ydpi="96"
inkscape:export-xdpi="96"
transform="translate(22.49608,0.1576808)"
id="g983-2">
<circle
cx="139.14354"
cy="71.717644"
r="7.4589534"
id="circle915-1-5"
style="fill:none;stroke:#000000;stroke-width:1.49179;stroke-linecap:round;stroke-linejoin:round" />
<g
inkscape:export-ydpi="96"
inkscape:export-xdpi="96"
style="fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round"
id="g1863-1-2-2"
transform="matrix(0.3092242,0,0,0.3092242,135.44162,67.965769)">
<line
id="line1846-4-8-9"
y2="12"
x2="21"
y1="12"
x1="3" />
<line
id="line1848-6-9-2"
y2="6"
x2="21"
y1="6"
x1="3" />
<line
id="line1850-4-1-6"
y2="18"
x2="21"
y1="18"
x1="3" />
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 18 KiB

BIN
Resources/UI/menu.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 212 B

BIN
Resources/UI/menu2.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 187 B

BIN
Resources/UI/minus.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 532 B

BIN
Resources/UI/minus2.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 380 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 630 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 394 B

BIN
Resources/UI/plus.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 559 B

BIN
Resources/UI/plus2.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 398 B

BIN
Resources/UI/trash.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 382 B

BIN
Resources/UI/trash2.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 289 B

BIN
Resources/file-text.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 352 B

BIN
Resources/folder.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 303 B

BIN
Resources/folder_32.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 601 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 322 B

BIN
Resources/hexagon.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 313 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 506 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 502 B

View File

@ -0,0 +1,444 @@
using System;
using System.ComponentModel;
using System.Data;
using System.IO;
namespace RyzStudio.Data.SQLite
{
public class SQLiteDatabase
{
#region static methods
public static string escapeSQL(string query)
{
return query.Replace("'", "''").Trim();
}
public static string escapeValue(string text)
{
return text.Replace("\"", "\\\"").Replace("\t", "\\t").Replace("\r", " \\r").Replace("\n", "\\n");
}
public static string PrepareQuery(string query, params string[] arguments)
{
string rv = query;
if (string.IsNullOrEmpty(rv))
{
return string.Empty;
}
for (int i = 0; i < arguments.Length; i++)
{
rv = rv.Replace("[^" + (i + 1).ToString() + "]", escapeSQL(arguments[i]));
}
return rv;
}
#endregion
protected SQLiteWrapper.SQLiteBase database = null;
protected string databaseLocation = ":memory:";
protected string lastError = "";
protected string[] requiredTableList = new string[0];
protected const string tableNameConfig = "ryz_app_xxxx_config";
#region public properties
[Browsable(false)]
public SQLiteWrapper.SQLiteBase Database
{
get { return database; }
set { database = value; }
}
[Browsable(false)]
public string DatabaseLocation
{
get { return databaseLocation; }
set { databaseLocation = value; }
}
[Browsable(false)]
public string LastError
{
get { return lastError; }
}
[Browsable(false)]
public int LastInsertID
{
get
{
if (database == null)
{
return 0;
}
DataTable dt = this.DoQuery("SELECT last_insert_rowid() AS ccc;");
if (dt == null)
{
return 0;
}
if (dt.Rows.Count <= 0)
{
return 0;
}
return int.Parse(dt.Rows[0]["ccc"].ToString());
}
}
#endregion
#region public methods
public bool Create(bool use_memory = true)
{
lastError = string.Empty;
if (string.IsNullOrEmpty(databaseLocation))
{
return false;
}
try
{
if (database != null)
{
database.CloseDatabase();
}
database = new SQLiteWrapper.SQLiteBase(((use_memory) ? ":memory:" : databaseLocation));
}
catch (Exception exc)
{
lastError = exc.Message;
return false;
}
bool rv = Prepare();
if (!rv)
{
return false;
}
return CheckRequiredTables();
}
public bool Create(string filename, bool override_file = false)
{
lastError = string.Empty;
databaseLocation = filename;
if (string.IsNullOrEmpty(databaseLocation))
{
return false;
}
if (File.Exists(databaseLocation) && override_file)
{
try
{
File.Delete(databaseLocation);
}
catch (Exception xc)
{
lastError = xc.Message;
return false;
}
}
try
{
if (database != null)
{
database.CloseDatabase();
}
database = new SQLiteWrapper.SQLiteBase(databaseLocation);
}
catch (Exception exc)
{
lastError = exc.Message;
return false;
}
bool rv = CheckRequiredTables();
if (!rv)
{
Prepare();
}
return CheckRequiredTables();
}
public bool Load(string filename)
{
if (!File.Exists(filename))
{
return false;
}
lastError = string.Empty;
databaseLocation = filename;
try
{
if (database != null)
{
database.CloseDatabase();
}
database = new SQLiteWrapper.SQLiteBase(databaseLocation);
}
catch (Exception exc)
{
lastError = exc.Message;
return false;
}
return CheckRequiredTables();
}
public void Close()
{
if (database != null)
{
database.CloseDatabase();
}
}
public DataTable DoQuery(string query)
{
lastError = string.Empty;
if (database == null)
{
return null;
}
try
{
return database.ExecuteQuery(query);
}
catch (Exception exc)
{
lastError = exc.Message;
return null;
}
}
public DataTable DoQuery(string query, params string[] args)
{
string sql = SQLiteDatabase.PrepareQuery(query, args);
return DoQuery(sql);
}
public bool DoNonQuery(string query)
{
lastError = string.Empty;
if (database == null)
{
return false;
}
try
{
database.ExecuteNonQuery(query);
return true;
}
catch (Exception exc)
{
lastError = exc.Message;
return false;
}
}
public bool DoNonQuery(string query, params string[] args)
{
string sql = SQLiteDatabase.PrepareQuery(query, args);
return DoNonQuery(sql);
}
public string DoQuerySingle(string query)
{
lastError = string.Empty;
if (database == null)
{
return string.Empty;
}
DataTable tbl = DoQuery(query);
if (tbl == null)
{
return string.Empty;
}
if (tbl.Columns.Count <= 0)
{
return string.Empty;
}
if (tbl.Rows.Count <= 0)
{
return string.Empty;
}
return tbl.Rows[0][0].ToString();
}
public string DoQuerySingle(string query, params string[] args)
{
string sql = SQLiteDatabase.PrepareQuery(query, args);
return DoQuerySingle(sql);
}
public int DoQueryCount(string query)
{
if (database == null)
{
return -1;
}
DataTable tbl = DoQuery(query);
if (tbl == null)
{
return -1;
}
if (tbl.Rows.Count <= 0)
{
return 0;
}
return tbl.Rows.Count;
}
public int DoQueryCount(string query, params string[] args)
{
string sql = SQLiteDatabase.PrepareQuery(query, args);
return DoQueryCount(sql);
}
public bool DoQueryExist(string query)
{
int rv = DoQueryCount(query);
return (rv > 0);
}
public bool DoQueryExist(string query, params string[] args)
{
string sql = SQLiteDatabase.PrepareQuery(query, args);
return DoQueryExist(sql);
}
public bool HasTable(string table_name)
{
lastError = string.Empty;
if (database == null)
{
return false;
}
int rv = this.DoQueryCount("SELECT 1 FROM sqlite_master WHERE type='table' AND name='" + escapeSQL(table_name) + "'");
return (rv > 0);
}
public bool CheckRequiredTables()
{
bool rv = true;
foreach (string tbl in requiredTableList)
{
if (string.IsNullOrEmpty(tbl))
{
continue;
}
if (!this.HasTable(tbl))
{
rv = false;
break;
}
}
return rv;
}
protected bool PrepareConfig()
{
if (HasTable(tableNameConfig))
{
return true;
}
bool rv = this.DoNonQuery(@"
BEGIN TRANSACTION;
CREATE TABLE " + tableNameConfig + @" (cfg_name TEXT, cfg_value TEXT);
COMMIT;
");
return rv;
}
public bool SetConfig(string name, string value)
{
if (!PrepareConfig())
{
return false;
}
string sql = string.Empty;
int rv = this.DoQueryCount("SELECT 1 FROM " + tableNameConfig + " WHERE cfg_name='" + escapeSQL(name) + "'");
if (rv <= 0)
{
sql = "INSERT INTO " + tableNameConfig + " (cfg_name, cfg_value) VALUES ('[^1]', '[^2]');";
}
else
{
sql = "UPDATE " + tableNameConfig + " SET cfg_value='[^2]' WHERE cfg_name='[^1]';";
}
sql = PrepareQuery(sql, new string[] { name, value });
return this.DoNonQuery(sql);
}
public string GetConfig(string name, string default_value = "")
{
if (!PrepareConfig())
{
return default_value;
}
bool rv = this.DoQueryExist("SELECT 1 FROM " + tableNameConfig + " WHERE cfg_name='" + escapeSQL(name) + "'");
if (!rv)
{
return default_value;
}
return this.DoQuerySingle("SELECT cfg_value FROM " + tableNameConfig + " WHERE cfg_name='" + escapeSQL(name) + "'");
}
#endregion
protected virtual bool Prepare()
{
return true;
}
}
}

View File

@ -0,0 +1,124 @@
using System.Drawing;
using System.Drawing.Drawing2D;
namespace RyzStudio.Drawing
{
public struct Rectangoid
{
private int X;
private int Y;
private int Width;
private int Height;
private int Radius;
public Rectangoid(Rectangle rect, int radius)
{
X = rect.X;
Y = rect.Y;
Width = rect.Width;
Height = rect.Height;
Radius = radius;
}
public Rectangoid(Rectangle rect, int radius, int borderWidth)
{
rect.Inflate((-1 * borderWidth), (-1 * borderWidth));
X = rect.X;
Y = rect.Y;
Width = rect.Width;
Height = rect.Height;
Radius = radius;
}
public Rectangoid(int x, int y, int width, int height, int radius)
{
X = x;
Y = y;
Width = width;
Height = height;
Radius = radius;
}
public Rectangoid(int x, int y, int width, int height)
{
X = x;
Y = y;
Width = width;
Height = height;
Radius = 0;
}
public Rectangoid(int width, int height, int radius)
{
X = 0;
Y = 0;
Width = width;
Height = height;
Radius = radius;
}
public Rectangoid(int width, int height)
{
X = 0;
Y = 0;
Width = width;
Height = height;
Radius = 0;
}
public Rectangoid(int width)
{
X = 0;
Y = 0;
Width = width;
Height = width;
Radius = 0;
}
public GraphicsPath ToGraphicsPath()
{
GraphicsPath rv = new GraphicsPath();
rv.AddLine(X + this.Radius, Y, X + Width - (this.Radius * 2), Y);
if (this.Radius > 0)
{
rv.AddArc(X + Width - (this.Radius * 2), Y, this.Radius * 2, this.Radius * 2, 270, 90);
}
rv.AddLine(X + Width, Y + this.Radius, X + Width, Y + Height - (this.Radius * 2));
if (this.Radius > 0)
{
rv.AddArc(X + Width - (this.Radius * 2), Y + Height - (this.Radius * 2), this.Radius * 2, this.Radius * 2, 0, 90);
}
rv.AddLine(X + Width - (this.Radius * 2), Y + Height, X + this.Radius, Y + Height);
if (this.Radius > 0)
{
rv.AddArc(X, Y + Height - (this.Radius * 2), this.Radius * 2, this.Radius * 2, 90, 90);
}
rv.AddLine(X, Y + Height - (this.Radius * 2), X, Y + this.Radius);
if (this.Radius > 0)
{
rv.AddArc(X, Y, this.Radius * 2, this.Radius * 2, 180, 90);
}
rv.CloseFigure();
return rv;
}
public PointF GetOrigin()
{
PointF rv = new PointF();
rv.X = ((float)Width / 2) + X;
rv.Y = ((float)Height / 2) + Y;
return rv;
}
}
}

56
RyzStudio/IO/FileType.cs Normal file
View File

@ -0,0 +1,56 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace RyzStudio.IO
{
public class FileType
{
protected static readonly byte[] BMP = { 66, 77 };
protected static readonly byte[] GIF = { 71, 73, 70, 56 };
protected static readonly byte[] ICO = { 0, 0, 1, 0 };
protected static readonly byte[] JPG = { 255, 216, 255 };
protected static readonly byte[] PNG = { 137, 80, 78, 71, 13, 10, 26, 10, 0, 0, 0, 13, 73, 72, 68, 82 };
public static bool IsImage(byte[] byteArray)
{
if (byteArray == null)
{
return false;
}
if (byteArray.Length <= 0)
{
return false;
}
if (byteArray.Take(2).SequenceEqual(BMP))
{
return true;
}
if (byteArray.Take(4).SequenceEqual(GIF))
{
return true;
}
if (byteArray.Take(4).SequenceEqual(ICO))
{
return true;
}
if (byteArray.Take(3).SequenceEqual(JPG))
{
return true;
}
if (byteArray.Take(16).SequenceEqual(PNG))
{
return true;
}
return false;
}
}
}

View File

@ -0,0 +1,290 @@
using System;
using System.IO;
using System.Text;
using System.Xml;
using System.Windows.Forms;
using ICSharpCode.SharpZipLib.Zip;
namespace RyzStudio.IO
{
public abstract class SessionFileFormatBase
{
protected string CONST_KEYPASS = "";
protected string CONST_PRODUCT = "";
protected string CONST_STREAM_FILE_NAME = "";
protected bool enableErrorReporting = false;
protected string lastUsedFileName = "";
#region public properties
public string passkey
{
get { return CONST_KEYPASS; }
set { CONST_KEYPASS = value; }
}
/*public string LastFilename
{
get { return lastUsedFileName; }
set { lastUsedFileName = value; }
}*/
#endregion
#region public methods
/* public bool loadFromRyz()
{
return loadFromRyz(lastUsedFileName);
}*/
public bool loadFromRyz(string file_name)
{
lastUsedFileName = file_name;
if (!File.Exists(file_name))
{
return false;
}
bool rv = false;
try
{
ZipInputStream zipIn = new ZipInputStream(File.OpenRead(file_name));
zipIn.Password = CONST_KEYPASS;
ZipEntry theEntry = null;
while ((theEntry = zipIn.GetNextEntry()) != null)
{
string streamFileName = Path.GetFileName(theEntry.Name);
if (streamFileName.Equals(CONST_STREAM_FILE_NAME))
{
MemoryStream oxStream = new MemoryStream();
StreamWriter streamWriter = new StreamWriter(oxStream);
int size = 2048;
byte[] data = new byte[size];
while (true)
{
size = zipIn.Read(data, 0, data.Length);
if (size <= 0) break;
streamWriter.BaseStream.Write(data, 0, size);
}
oxStream.Position = 0;
StreamReader sr2 = new StreamReader(oxStream, Encoding.UTF8);
XmlDocument xDoc = new XmlDocument();
xDoc.LoadXml(sr2.ReadToEnd());
loadFromXmlDocument(ref xDoc);
}
}
zipIn.Close();
rv = true;
}
catch (Exception exc)
{
if (enableErrorReporting)
{
MessageBox.Show(exc.Message);
}
}
return rv;
}
public bool loadFromXml()
{
return loadFromXml(lastUsedFileName);
}
public bool loadFromXml(string file_name)
{
lastUsedFileName = file_name;
if (!File.Exists(file_name))
{
return false;
}
bool rv = false;
try
{
StreamReader sr2 = new StreamReader(file_name, Encoding.UTF8);
XmlDocument xDoc = new XmlDocument();
xDoc.LoadXml(sr2.ReadToEnd());
loadFromXmlDocument(ref xDoc);
sr2.Close();
rv = true;
}
catch (Exception exc)
{
if (enableErrorReporting)
{
MessageBox.Show(exc.Message);
}
}
return rv;
}
/* public bool saveToRyz()
{
return saveToRyz(lastUsedFileName);
}
*/
public bool saveToRyz(string file_name)
{
bool rv = false;
lastUsedFileName = file_name;
byte[] buffer = new byte[4096];
try
{
File.Delete(file_name);
FileInfo fileinfo1 = new FileInfo(file_name);
if (!Directory.Exists(fileinfo1.DirectoryName))
{
Directory.CreateDirectory(fileinfo1.DirectoryName);
}
}
catch (Exception exc)
{
if (enableErrorReporting)
{
MessageBox.Show(exc.Message);
}
}
try
{
ZipOutputStream zipOutStream1 = new ZipOutputStream(File.Create(file_name));
zipOutStream1.SetLevel(9);
zipOutStream1.Password = CONST_KEYPASS;
MemoryStream oxIndexStream = new MemoryStream();
XmlTextWriter oxTW = new XmlTextWriter(oxIndexStream, Encoding.UTF8);
saveToXmlTextWriter(ref oxTW);
oxTW.Flush();
// write to file
zipOutStream1.PutNextEntry(new ZipEntry(CONST_STREAM_FILE_NAME));
oxIndexStream.Position = 0;
StreamReader sr2 = new StreamReader(oxIndexStream, Encoding.UTF8);
int sourceBytes;
do
{
sourceBytes = sr2.BaseStream.Read(buffer, 0, buffer.Length);
zipOutStream1.Write(buffer, 0, sourceBytes);
}
while (sourceBytes > 0);
sr2.Close();
oxTW.Close();
zipOutStream1.Finish();
zipOutStream1.Close();
rv = true;
}
catch (Exception exc)
{
if (enableErrorReporting)
{
MessageBox.Show(exc.Message);
}
}
return rv;
}
public bool saveToXml()
{
return saveToXml(lastUsedFileName);
}
public bool saveToXml(string file_name)
{
bool rv = false;
lastUsedFileName = file_name;
try
{
File.Delete(file_name);
FileInfo fileinfo1 = new FileInfo(file_name);
if (!Directory.Exists(fileinfo1.DirectoryName))
{
Directory.CreateDirectory(fileinfo1.DirectoryName);
}
}
catch (Exception exc)
{
if (enableErrorReporting)
{
MessageBox.Show(exc.Message);
}
}
try
{
XmlTextWriter oxTW = new XmlTextWriter(file_name, Encoding.UTF8);
saveToXmlTextWriter(ref oxTW);
oxTW.Flush();
oxTW.Close();
rv = true;
}
catch (Exception exc)
{
if (enableErrorReporting)
{
MessageBox.Show(exc.Message);
}
}
return rv;
}
#endregion
protected virtual void loadFromXmlDocument(ref XmlDocument xml_doc) { }
protected virtual void saveToXmlTextWriter(ref XmlTextWriter writer) { }
#region public methods (conversions)
public int[] convIntArrayString(string s1, char c)
{
string[] sarr = s1.Split(c);
int[] iarr = new int[sarr.Length];
for (int i = 0; i < sarr.Length; i++)
{
iarr[i] = Int32.Parse(sarr[i]);
}
return iarr;
}
public string convStringIntArray(int[] r, char s)
{
string t = null;
for (int i = 0; i < r.Length; i++)
{
if (i != 0)
{
t += s.ToString();
}
t += r[i].ToString();
}
return t;
}
#endregion
}
}

241
RyzStudio/IO/SharpZipLib.cs Normal file
View File

@ -0,0 +1,241 @@
using System;
using System.IO;
using ICSharpCode.SharpZipLib.Zip;
namespace RyzStudio.IO
{
public class SharpZipLib
{
public static bool IsZipEncrypted(string filename)
{
bool rv = false;
try
{
ZipInputStream readStream = new ZipInputStream(System.IO.File.OpenRead(filename));
ZipEntry theEntry = null;
while ((theEntry = readStream.GetNextEntry()) != null)
{
if (theEntry.IsCrypted)
{
rv = true;
}
break;
}
readStream.Close();
readStream.Dispose();
readStream = null;
}
catch
{
// do nothing
}
return rv;
}
//public static void AddFile(ZipOutputStream zipStream, string filename, string prefixPath = null)
//{
// byte[] buffer = new byte[4096];
// string f1 = "";
// if (prefixPath != null)
// {
// f1 = Path.GetDirectoryName(filename).TrimEnd('\\') + "\\";
// f1 = f1.Replace(prefixPath, "").TrimEnd('\\') + "\\";
// f1 = f1 + Path.GetFileName(filename);
// f1 = f1.TrimStart('\\');
// }
// ZipEntry entry = new ZipEntry(f1);
// entry.DateTime = DateTime.Now;
// zipStream.PutNextEntry(entry);
// FileStream fs = File.OpenRead(filename);
// int sourceBytes;
// do
// {
// sourceBytes = fs.Read(buffer, 0, buffer.Length);
// zipStream.Write(buffer, 0, sourceBytes);
// }
// while (sourceBytes > 0);
//}
//public static void AddFolder(ZipOutputStream zipstream, string folderpath, string prefixpath = null)
//{
// foreach (string fn in Directory.GetFiles(folderpath, "*.*", System.IO.SearchOption.AllDirectories))
// {
// AddFile(zipstream, fn, prefixpath);
// }
//}
public static string ReadSingle(string filename, string password, string entryFilename)
{
string rv = null;
int size = 2048;
byte[] buffer = new byte[size];
int bufferSize = 0;
ZipEntry readEntry = null;
try
{
ZipInputStream readStream = new ZipInputStream(File.OpenRead(filename));
readStream.Password = password;
while (true)
{
readEntry = readStream.GetNextEntry();
if (readEntry == null)
{
break;
}
if (string.IsNullOrWhiteSpace(readEntry.Name))
{
continue;
}
if (!readEntry.IsFile)
{
continue;
}
if (!readEntry.Name.Equals(entryFilename))
{
continue;
}
MemoryStream ms = new MemoryStream();
buffer = new byte[size];
bufferSize = 0;
do
{
bufferSize = readStream.Read(buffer, 0, buffer.Length);
ms.Write(buffer, 0, bufferSize);
}
while (bufferSize > 0);
ms.Position = 0;
StreamReader sr = new StreamReader(ms);
rv = sr.ReadToEnd();
break;
}
readStream.Flush();
readStream.Close();
readStream.Dispose();
readStream = null;
}
catch (Exception)
{
return rv;
}
return rv;
}
public static bool TestArchive(string filename, string password = null)
{
if (string.IsNullOrWhiteSpace(filename))
{
return false;
}
if (!File.Exists(filename))
{
return false;
}
ZipEntry readEntry = null;
try
{
ZipInputStream readStream = new ZipInputStream(System.IO.File.OpenRead(filename));
readStream.Password = password;
while (true)
{
readEntry = readStream.GetNextEntry();
if (readEntry == null)
{
break;
}
//break;
}
readStream.Close();
readStream.Dispose();
readStream = null;
}
catch (Exception)
{
return false;
}
return true;
}
public static bool CreateSingle(string filename, string password, string entryFilename, string content)
{
int size = 2048;
byte[] buffer = new byte[size];
int bufferSize = 0;
try
{
ZipOutputStream zipStream = new ZipOutputStream(File.Create(filename));
zipStream.SetLevel(9);
zipStream.Password = password;
// stream
MemoryStream ms = new MemoryStream(System.Text.Encoding.UTF8.GetBytes(content));
ms.Position = 0;
// write file entry
zipStream.PutNextEntry(new ZipEntry(entryFilename));
buffer = new byte[size];
bufferSize = 0;
do
{
bufferSize = ms.Read(buffer, 0, buffer.Length);
zipStream.Write(buffer, 0, bufferSize);
}
while (bufferSize > 0);
ms.Flush();
ms.Close();
ms.Dispose();
ms = null;
zipStream.Finish();
zipStream.Flush();
zipStream.Close();
zipStream.Dispose();
zipStream = null;
}
catch (Exception)
{
return false;
}
return true;
}
}
}

168
RyzStudio/Net/HttpWeb.cs Normal file
View File

@ -0,0 +1,168 @@
using System;
using System.IO;
using System.Net;
using System.Text;
using System.Windows.Forms;
namespace RyzStudio.Net
{
public class HttpWeb
{
public string defaultUserAgent = "Momozilla/5.0 (" + Environment.OSVersion.Platform.ToString() + " ; " + Environment.OSVersion.VersionString + "; " + Application.CurrentCulture.TwoLetterISOLanguageName + ")";
public int defaultTimeout = 6000;
public int defaultMaxRedirect = 8;
public bool defaultAllowRedirect = true;
public CookieContainer defaultCookierContainer = null;
public HttpWeb()
{
}
public HttpWebRequest CreateRequest(string url)
{
return this.CreateRequest(url, url);
}
public HttpWebRequest CreateRequest(string url, string referrerURL)
{
if (defaultCookierContainer == null)
{
defaultCookierContainer = new CookieContainer();
}
HttpWebRequest webRequest = (HttpWebRequest)WebRequest.Create(url);
webRequest.CachePolicy = new System.Net.Cache.RequestCachePolicy(System.Net.Cache.RequestCacheLevel.NoCacheNoStore);
webRequest.MaximumAutomaticRedirections = defaultMaxRedirect;
webRequest.CookieContainer = defaultCookierContainer;
webRequest.UserAgent = defaultUserAgent;
webRequest.AllowAutoRedirect = defaultAllowRedirect;
webRequest.Timeout = defaultTimeout;
return webRequest;
}
public int GetResponse(out string sourceCode, string url, string referrerURL = "")
{
HttpWebRequest webRequest = this.CreateRequest(url, referrerURL);
return GetResponse(out sourceCode, webRequest);
}
public int GetResponse(out string sourceCode, HttpWebRequest webRequest)
{
sourceCode = string.Empty;
int rv = 0;
try
{
HttpWebResponse webResponse = (HttpWebResponse)webRequest.GetResponse();
rv = (int)webResponse.StatusCode;
StreamReader readContent = new StreamReader(webResponse.GetResponseStream());
sourceCode = readContent.ReadToEnd();
webResponse.Close();
webResponse = null;
}
catch (WebException xc)
{
if (xc.Response is HttpWebResponse)
{
HttpWebResponse rs = xc.Response as HttpWebResponse;
StreamReader readContent = new StreamReader(rs.GetResponseStream());
if (readContent != null)
{
sourceCode = readContent.ReadToEnd();
}
rv = (int)rs.StatusCode;
}
else
{
rv = (int)xc.Status;
sourceCode = xc.Message;
}
}
catch (Exception xc)
{
sourceCode = xc.Message;
}
return rv;
}
public static HttpWebRequest AddBasicAuthentication(HttpWebRequest webRequest, string username, string password)
{
webRequest.Headers["Authorization"] = "Basic " + Convert.ToBase64String(Encoding.Default.GetBytes(string.Concat(username, ":", password)));
webRequest.PreAuthenticate = true;
return webRequest;
}
public int GetPOSTResponse(out string sourceCode, HttpWebRequest webRequest, string postData)
{
sourceCode = "";
int rv = 0;
byte[] buffer = Encoding.UTF8.GetBytes(postData);
webRequest.ContentLength = buffer.Length;
try
{
Stream dataStream = webRequest.GetRequestStream();
dataStream.Write(buffer, 0, buffer.Length);
dataStream.Close();
}
catch (Exception xc)
{
sourceCode = xc.Message;
return rv;
}
return this.GetResponse(out sourceCode, webRequest);
}
public int GetHeader(out WebHeaderCollection headerCollection, string url, string referrerURL = "")
{
headerCollection = null;
int rv = 0;
HttpWebRequest webRequest = this.CreateRequest(url, referrerURL);
webRequest.Method = "HEAD";
try
{
HttpWebResponse webResponse = (HttpWebResponse)webRequest.GetResponse();
headerCollection = webResponse.Headers;
rv = (int)webResponse.StatusCode;
webResponse.Close();
webResponse = null;
}
catch (WebException xc)
{
if (xc.Response is HttpWebResponse)
{
HttpWebResponse rs = xc.Response as HttpWebResponse;
rv = (int)rs.StatusCode;
}
else
{
rv = (int)xc.Status;
}
}
catch
{
// do nothing
}
return rv;
}
}
}

View File

@ -0,0 +1,69 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace RyzStudio.Windows.Forms
{
public class StackLayoutPanel : FlowLayoutPanel
{
public StackLayoutPanel() : base()
{
this.AutoScroll = true;
this.FlowDirection = FlowDirection.TopDown;
this.WrapContents = false;
}
protected override void OnResize(EventArgs eventargs)
{
base.OnResize(eventargs);
//int w = this.ClientRectangle.Width - SystemInformation.VerticalScrollBarWidth;
int w = this.ClientRectangle.Width - 1;
foreach (Control item in this.Controls)
{
if (item.Width != w)
{
item.Width = w;
}
}
}
protected override void OnControlAdded(ControlEventArgs e)
{
base.OnControlAdded(e);
OnResize(null);
}
protected override void OnControlRemoved(ControlEventArgs e)
{
base.OnControlRemoved(e);
OnResize(null);
}
public void AddControl(Control value)
{
if (this.InvokeRequired)
{
this.Invoke(new MethodInvoker(() =>
{
value.Margin = new Padding(0, 3, 0, 3);
this.Controls.Add(value);
}));
}
else
{
value.Margin = new Padding(0, 3, 0, 3);
this.Controls.Add(value);
}
}
}
}

View File

@ -0,0 +1,115 @@
using System.Drawing;
using System.Windows.Forms;
namespace RyzStudio.Windows.Forms
{
public class TFlatButton : Label
{
public class ButtonStyle
{
public Color BackColour { get; set; } = Color.Transparent;
public Color PenColour { get; set; } = Color.Transparent;
}
public enum FlatButtonState
{
Idle = 0,
Hover,
Down
}
protected FlatButtonState controlState = FlatButtonState.Idle;
public TFlatButton() : base()
{
this.AutoSize = false;
this.ImageAlign = ContentAlignment.MiddleCenter;
this.TextAlign = ContentAlignment.MiddleCenter;
// customise
this.StyleOver = new ButtonStyle()
{
BackColour = Color.FromArgb(51, 51, 51),
PenColour = Color.White
};
this.StyleDown = new ButtonStyle()
{
BackColour = Color.FromArgb(179, 179, 179),
PenColour = Color.Black
};
this.StyleDefault = new ButtonStyle()
{
BackColour = Color.White,
PenColour = Color.Black
};
this.VisualState = FlatButtonState.Idle;
this.Click += delegate { this.OnClick(null); };
this.MouseEnter += delegate { this.VisualState = FlatButtonState.Hover; };
this.MouseLeave += delegate { this.VisualState = FlatButtonState.Idle; };
this.MouseDown += delegate { this.VisualState = FlatButtonState.Down; };
this.MouseUp += delegate { this.VisualState = FlatButtonState.Idle; };
}
protected FlatButtonState VisualState
{
get { return controlState; }
set
{
switch (value)
{
case FlatButtonState.Idle:
if (this.VisualState == FlatButtonState.Down)
{
updateButton(StyleOver);
}
else
{
updateButton(StyleDefault);
}
break;
case FlatButtonState.Hover:
updateButton(StyleOver);
break;
case FlatButtonState.Down:
updateButton(StyleDown);
break;
default:
updateButton(StyleDefault);
break;
}
controlState = value;
}
}
protected void updateButton(ButtonStyle style)
{
this.ForeColor = style.PenColour;
this.BackColor = style.BackColour;
}
protected ButtonStyle StyleOver { get; set; } = new ButtonStyle();
protected ButtonStyle StyleDown { get; set; } = new ButtonStyle();
protected ButtonStyle StyleDefault { get; set; } = new ButtonStyle();
public void PerformClick()
{
if (this.InvokeRequired)
{
this.Invoke(new MethodInvoker(() => {
this.OnClick(null);
}));
}
else
{
this.OnClick(null);
}
}
}
}

View File

@ -0,0 +1,434 @@
using System;
using System.ComponentModel;
using System.Drawing;
using System.Windows.Forms;
//using Resources = AppLauncher.Properties.Resources;
namespace RyzStudio.Windows.Forms
{
public class TForm : Form
{
//protected readonly Color borderColour = Color.FromArgb(200, 200, 200);
//protected readonly int borderWidth = 1;
//protected readonly int resizeBorderWidth = 4;
protected readonly Color backColour = Color.FromArgb(250, 250, 250);
//protected readonly Color titleBackColour = Color.FromArgb(235, 234, 233);
//protected readonly Color titleBorderColour = Color.FromArgb(200, 198, 196);
//protected readonly Color titleColour = Color.FromArgb(102, 102, 102);
//protected readonly int titleBarHeight = 33;
//protected readonly bool showTitleBarLine = true;
//protected Font titleFont = null;
//protected int titleFontTop = 0;
//protected readonly Size titleBarIconSize = new Size(48, 32);
//protected readonly int titleBarIconMargin = 0;
//protected readonly int titleBarIconMarginRight = 0;
//protected Image appIcon = null;
//protected const int appIconLeft = 12;
//protected const int appIconRight = 6;
//protected int appIconTop = 0;
protected bool isDragging = false;
protected Point startPosition = new Point();
//protected Point startWindowSize = new Point();
//protected bool enableMinimise { get; set; } = true;
//protected bool enableMaximise { get; set; } = true;
//protected bool enableClose { get; set; } = true;
//protected bool closeOnMinimise { get; set; } = false;
protected bool isBusy = false;
private IContainer components;
public TForm() : base()
{
InitializeComponent();
//if (!this.DesignMode)
//{
// this.FormBorderStyle = FormBorderStyle.None;
// this.StartPosition = FormStartPosition.Manual;
//}
this.AutoScaleMode = AutoScaleMode.Font;
this.BackColor = backColour;
this.FormBorderStyle = FormBorderStyle.Sizable;
this.Padding = new Padding(0);
this.DoubleBuffered = true;
this.MouseDown += new MouseEventHandler(form_MouseDown);
this.MouseMove += new MouseEventHandler(form_MouseMove);
this.MouseUp += new MouseEventHandler(form_MouseUp);
this.PreviewKeyDown += new PreviewKeyDownEventHandler(form_PreviewKeyDown);
}
protected override void OnLoad(EventArgs e)
{
base.OnLoad(e);
this.Text = Application.ProductName;
//initialiseLoadComponent();
//if (appIcon != null) appIconTop = (int)Math.Floor((decimal)(titleBarHeight - appIcon.Height) / 2) + borderWidth;
//titleFont = new Font(this.Font.FontFamily, 10F);
//titleFontTop = (int)Math.Floor((decimal)(titleBarHeight - TextRenderer.MeasureText("#", titleFont).Height) / 2) + borderWidth;
}
//protected override void OnMouseClick(MouseEventArgs e)
//{
// base.OnMouseClick(e);
// bool isLabel = ((e.Location.X >= 0) && (e.Location.X <= this.Width) && (e.Location.Y >= 0) && (e.Location.Y <= titleBarHeight));
// if (e.Button == MouseButtons.Left)
// {
// if (isLabel)
// {
// // do nothing
// }
// else
// {
// // do nothing
// }
// }
// else if (e.Button == MouseButtons.Right)
// {
// if (isLabel)
// {
// if (this.TitleContextMenuStrip != null)
// {
// this.TitleContextMenuStrip.Show(this, e.Location);
// }
// }
// else
// {
// // do nothing
// }
// }
//}
//protected override void OnPaint(PaintEventArgs e)
//{
// base.OnPaint(e);
// Graphics g = e.Graphics;
// Rectangle area = new Rectangle(this.DisplayRectangle.X, this.DisplayRectangle.Y, (this.DisplayRectangle.Width - borderWidth), (this.DisplayRectangle.Height - borderWidth));
// // border
// g.DrawRectangle(new Pen(borderColour, borderWidth), area);
// area.Inflate((-1 * borderWidth), (-1 * borderWidth));
//g.FillRectangle(new SolidBrush(titleBackColour), area.X, area.Y, (area.Width + area.X), titleBarHeight);
//if (showTitleBarLine) g.DrawLine(new Pen(titleBorderColour, 1), area.X, titleBarHeight, (area.Width + area.X), titleBarHeight);
//if (!DesignMode)
//{
// if (appIcon != null) g.DrawImageUnscaled(appIcon, appIconLeft, appIconTop);
// int iconPosX = borderWidth + appIconLeft + appIconRight + ((appIcon == null) ? 0 : appIcon.Width);
// TextRenderer.DrawText(g, this.Text, titleFont, new Point(iconPosX, titleFontTop), titleColour);
//}
//}
protected override void OnResize(EventArgs e)
{
base.OnResize(e);
this.Invalidate();
}
[Browsable(false), EditorBrowsable(EditorBrowsableState.Never)]
public override Color BackColor { get => base.BackColor; set => base.BackColor = backColour; }
[Browsable(false), EditorBrowsable(EditorBrowsableState.Never)]
public new FormBorderStyle FormBorderStyle { get => base.FormBorderStyle; set => base.FormBorderStyle = value; }
[Browsable(false), EditorBrowsable(EditorBrowsableState.Never)]
public new Padding Padding { get => base.Padding; set => base.Padding = value; }
[Category("Appearance")]
public ContextMenuStrip TitleContextMenuStrip { get; set; } = null;
//[Browsable(false)]
//public Image AppIcon { get; set; } = null;
//[Browsable(false)]
//public bool IsMaximiseEnabled { get; set; } = false;
//protected Point DefaultLocation
//{
// get
// {
// Point newPosition = new Point(Cursor.Position.X, Cursor.Position.Y);
// newPosition.X -= (this.Width / 2);
// newPosition.Y -= (this.Height / 2);
// newPosition.X = Math.Max(newPosition.X, Screen.PrimaryScreen.WorkingArea.Left);
// newPosition.Y = Math.Max(newPosition.Y, Screen.PrimaryScreen.WorkingArea.Top);
// return newPosition;
// }
//}
private void InitializeComponent()
{
this.components = new System.ComponentModel.Container();
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(TForm));
this.SuspendLayout();
//
// AForm
//
this.Name = "AForm";
this.ResumeLayout(false);
}
private void form_MouseDown(object sender, MouseEventArgs e)
{
if (e.Button == MouseButtons.Left)
{
isDragging = true;
startPosition = e.Location;
//startWindowSize = new Point(this.Width, this.Height);
}
}
private void form_MouseMove(object sender, MouseEventArgs e)
{
if (isDragging)
{
int x = (this.Location.X + (e.Location.X - startPosition.X));
int y = (this.Location.Y + (e.Location.Y - startPosition.Y));
//this.Location = validateFormLocation(x, y);
this.Location = new Point(x, y);
}
}
private void form_MouseUp(object sender, MouseEventArgs e)
{
isDragging = false;
}
private void form_PreviewKeyDown(object sender, PreviewKeyDownEventArgs e)
{
if (e.KeyCode == Keys.Escape)
{
Application.Exit();
}
}
//protected virtual void initialiseLoadComponent()
//{
// if (DesignMode) return;
// // close
// TImageBox closeBox = generateToolbarImageBox();
// closeBox.Image = closeBox.ImageNormal = (enableClose) ? Resources.titlebar_close : Resources.titlebar_blank;
// closeBox.ImageHover = (enableClose) ? Resources.titlebar_close3 : Resources.titlebar_blank;
// closeBox.ImageSelected = Resources.titlebar_close3;
// closeBox.MouseClick += delegate (object sender, MouseEventArgs e)
// {
// if (e.Button == MouseButtons.Left)
// {
// if (enableClose)
// {
// this.Close();
// }
// }
// };
// closeBox.Left = this.DisplayRectangle.Width - closeBox.Width - (titleBarIconMarginRight + borderWidth);
// this.Controls.Add(closeBox);
// // maximise
// TImageBox maximiseBox = generateToolbarImageBox();
// maximiseBox.Image = maximiseBox.ImageNormal = (enableMaximise) ? Resources.titlebar_maximise : Resources.titlebar_blank;
// maximiseBox.ImageHover = (enableMaximise) ? Resources.titlebar_maximise5 : Resources.titlebar_blank;
// maximiseBox.ImageSelected = Resources.titlebar_maximise3;
// maximiseBox.MouseClick += delegate (object sender, MouseEventArgs e)
// {
// if (!(sender is TImageBox)) return;
// TImageBox imageBox2 = (sender as TImageBox);
// if (imageBox2 == null) return;
// if (e.Button == MouseButtons.Left)
// {
// if (enableMaximise)
// {
// if (this.WindowState == FormWindowState.Maximized)
// {
// this.WindowState = FormWindowState.Normal;
// imageBox2.Image = imageBox2.ImageNormal = Resources.titlebar_maximise;
// }
// else
// {
// this.WindowState = FormWindowState.Maximized;
// imageBox2.Image = imageBox2.ImageNormal = Resources.titlebar_maximise5;
// }
// }
// }
// else if (e.Button == MouseButtons.Right)
// {
// this.TopMost = !this.TopMost;
// if (this.TopMost)
// {
// imageBox2.Image = imageBox2.ImageNormal = Resources.titlebar_maximise3;
// imageBox2.ImageHover = (enableMaximise) ? Resources.titlebar_maximise5 : Resources.titlebar_maximise3;
// }
// else
// {
// imageBox2.Image = imageBox2.ImageNormal = (enableMaximise) ? Resources.titlebar_maximise : Resources.titlebar_blank;
// imageBox2.ImageHover = (enableMaximise) ? Resources.titlebar_maximise5 : Resources.titlebar_blank;
// }
// }
// };
// maximiseBox.Left = closeBox.Left - maximiseBox.Width - titleBarIconMargin;
// this.Controls.Add(maximiseBox);
// // minimise
// TImageBox minimiseBox = generateToolbarImageBox();
// minimiseBox.Image = minimiseBox.ImageNormal = (enableMinimise) ? Resources.titlebar_minimise : Resources.titlebar_blank;
// minimiseBox.ImageHover = (enableMinimise) ? Resources.titlebar_minimise5 : Resources.titlebar_blank;
// //minimiseBox.ImageSelected = null;
// minimiseBox.MouseClick += delegate (object sender, MouseEventArgs e)
// {
// if (!enableMinimise) return;
// if (e.Button != MouseButtons.Left) return;
// if (closeOnMinimise)
// {
// this.Close();
// }
// else
// {
// this.WindowState = FormWindowState.Minimized;
// }
// };
// minimiseBox.Left = maximiseBox.Left - minimiseBox.Width - titleBarIconMargin;
// this.Controls.Add(minimiseBox);
// // resize
// UserControl uc1 = new UserControl()
// {
// Anchor = (AnchorStyles.Left | AnchorStyles.Bottom | AnchorStyles.Right),
// Height = resizeBorderWidth,
// Width = this.DisplayRectangle.Width - resizeBorderWidth,
// Left = 0,
// Top = this.DisplayRectangle.Height - resizeBorderWidth,
// BackColor = Color.Transparent,
// Cursor = Cursors.SizeNS
// };
// uc1.MouseDown += form_MouseDown;
// uc1.MouseUp += form_MouseUp;
// uc1.MouseMove += delegate (object sender, MouseEventArgs e)
// {
// if (isDragging)
// {
// this.Size = new Size(startWindowSize.X, e.Y - startPosition.Y + this.Height);
// }
// };
// uc1.BringToFront();
// this.Controls.Add(uc1);
// UserControl uc2 = new UserControl()
// {
// Anchor = (AnchorStyles.Top | AnchorStyles.Right | AnchorStyles.Bottom),
// Height = this.DisplayRectangle.Height - resizeBorderWidth,
// Width = resizeBorderWidth,
// Left = this.DisplayRectangle.Width - resizeBorderWidth,
// Top = 0,
// BackColor = Color.Transparent,
// Cursor = Cursors.SizeWE
// };
// uc2.MouseDown += form_MouseDown;
// uc2.MouseUp += form_MouseUp;
// uc2.MouseMove += delegate (object sender, MouseEventArgs e)
// {
// if (isDragging)
// {
// this.Size = new Size(e.X - startPosition.X + this.Width, startWindowSize.Y);
// }
// };
// uc2.BringToFront();
// this.Controls.Add(uc2);
// UserControl uc3 = new UserControl()
// {
// Anchor = (AnchorStyles.Bottom | AnchorStyles.Right),
// Height = resizeBorderWidth,
// Width = resizeBorderWidth,
// Left = this.DisplayRectangle.Width - resizeBorderWidth,
// Top = this.DisplayRectangle.Height - resizeBorderWidth,
// BackColor = Color.Transparent,
// Cursor = Cursors.SizeNWSE
// };
// uc3.MouseDown += form_MouseDown;
// uc3.MouseUp += form_MouseUp;
// uc3.MouseMove += delegate (object sender, MouseEventArgs e)
// {
// if (isDragging)
// {
// this.Size = new Size((e.X - startPosition.X + this.Width), (e.Y - startPosition.Y + this.Height));
// }
// };
// uc3.BringToFront();
// this.Controls.Add(uc3);
//}
//protected TImageBox generateToolbarImageBox()
//{
// TImageBox imageBox = new TImageBox();
// //imageBox.BackColor = Color.Transparent;
// imageBox.BackColorHover = imageBox.BackColorSelected = Color.FromArgb(220, 220, 220);
// imageBox.BackgroundImageLayout = ImageLayout.Center;
// imageBox.ErrorImage = null;
// //imageBox.Image = Resources.close;
// //imageBox.ImageHover = Resources.close2;
// //imageBox.ImageNormal = Resources.close;
// imageBox.ImageSelected = null;
// imageBox.IsSelected = false;
// //closeBox.Location = new System.Drawing.Point(169, 12);
// imageBox.Size = titleBarIconSize;
// imageBox.SizeMode = PictureBoxSizeMode.CenterImage;
// //imageBox.MouseClick += new MouseEventHandler(closeBox_MouseClick);
// //imageBox.Left = this.DisplayRectangle.Width - imageBox.Width - 17;
// imageBox.Top = (int)Math.Floor((decimal) (titleBarHeight - titleBarIconSize.Height) / 2) + borderWidth;
// imageBox.Anchor = (AnchorStyles.Top | AnchorStyles.Right);
// imageBox.Padding = new Padding(0);
// return imageBox;
//}
//private void exitToolStripMenuItem_Click(object sender, EventArgs e) => this.Close();
//private void notifyIcon1_MouseClick(object sender, MouseEventArgs e)
//{
// if (e.Button == MouseButtons.Left)
// {
// this.Visible = !this.Visible;
// }
// //notifyIcon1.Visible = !this.Visible;
//}
}
}

View File

@ -0,0 +1,424 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<metadata name="notifyIcon1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
<metadata name="contextMenuStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>130, 17</value>
</metadata>
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="notifyIcon1.Icon" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
AAABAAQAMDAAAAEAIACoJQAARgAAACAgAAABACAAqBAAAO4lAAAYGAAAAQAgAIgJAACWNgAAEBAAAAEA
IABoBAAAHkAAACgAAAAwAAAAYAAAAAEAIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAGxc
VU5rW1Tna1tU22paU5BsXVVCgEBABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAaltTZWtbVPxrW1T/a1tU/2tbVP9rW1T/a1tU7mtbU6VrXFNWbVtbDgAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAABqWlR/a1tU/2tbVP9rW1T/a1tU/2tbVP9rW1T/a1tU/2tbVP9rW1T/a1tU+Wta
VLprW1Nrb15VHgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAVVVVA2tbVJhrW1T/a1tU/2tbVP+NgXz/2NPR/6+mov+Bc23/a1tU/2tb
VP9rW1T/a1tU/2tbVP9rW1T/a1tU/2tbVc1sXFSAa1xSMgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABtSUkHa1xUqmtbVP9rW1T/a1tU/5iNiP/6+fn/////////
////////6+no/7+4tf+Sh4L/bV5X/2tbVP9rW1T/a1tU/2tbVP9rW1T/a1tU/2tbVOFrXFOZallTTW1J
SQcAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAGlaWhFqW1TCa1tU/2tbVP9rW1T/o5mV//38
/P//////////////////////////////////////9PPy/8jDwP+cko3/c2Nd/2tbVP9rW1T/a1tU/2tb
VP9rW1T/a1tU/2tbVPVrW1SzalxUXmlaWhEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAalhYHWtbVNRrW1T/a1tU/2tb
VP+1rar/////////////////////////////////////////////////////////////////+vn5/9LN
y/+lm5f/eGpj/2tbVP9rW1T/a1tU/2tbVP9rW1T/a1tU/2tbVPtrWlS9bFxVb2xdVSEAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABrWVMra1tU42tb
VP9rW1T/bV1W/8S9u///////////////////////////////////////////////////////////////
/////////////////////////v7+/97a2f+xqKT/g3Zw/2tbVP9rW1T/a1tU/2tbVP9rW1T/a1tU/2tb
VP5qW1V4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAGpZ
VTxrW1Tua1tU/2tbVP9wYVr/0czK////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////+ro5/+8tbL/j4N+/21d
Vv9rW1T/a1tU/2tbVP9rW1TpAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAbFxTUGtbVPZrW1T/a1tU/3VnYP/d2df/////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
//////////////Tz8v/Iw8D/dmdh/2tbVP9rW1T/blpTJQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAABsXFRha1tU+2tbVP9rW1T/emxl/+Th4P//////////////////////////////
////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////m5CL/2tbVP9rW1T/a1tTXwAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAGtaVHdrW1T/a1tU/2tbVP+DdnD/7uzs/////////////Pvw//z6
7v/8+u7//Pru//z67v/8+u7//Pru//z67v/9/PT///////////////////////z4+f/79fX/+/X1//v1
9f/79fX/+/X1//v19f/79fX//Pb2////////////////////////////vLWy/2tbVP9rW1T/a1xTmQAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABVVVUDa1tUmGtbVP9rW1T/a1tU/4t/ev/08/L/////////
///cyT7/0bcA/9G3AP/RtwD/0bcA/9G3AP/RtwD/0bcA/9G3AP/RtwD/6Nt+////////////4bG1/8Rl
bP/EZWz/xGVs/8RlbP/EZWz/xGVs/8RlbP/EZWz/xGVs/9KKkP//////////////////////3tvZ/2tb
VP9rW1T/a1tU1AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAG1JSQdrW1Sra1tU/2tbVP9rW1T/mY6J//r5
+f////////////389f/RtwD/0bcA/9G3AP/RtwD/0bcA/9G3AP/RtwD/0bcA/9G3AP/RtwD/28Y1////
////////0IWL/8RlbP/EZWz/xGVs/8RlbP/EZWz/xGVs/8RlbP/EZWz/xGVs/8RlbP/9+fn/////////
/////////Pz8/3BhWv9rW1T/a1tU/nFVVRIAAAAAAAAAAAAAAAAAAAAAaVpaEWtcVMNrW1T/a1tU/2tb
VP+kmpb//fz8//////////////////389P/RtwD/0bcA/+TVbP/w56r/8Oeq//Dnqv/w56r/8Oeq/93K
Qv/RtwD/28Y1////////////0IWL/8RlbP/TjZL/68zO/+vMzv/rzM7/68zO/+vMzv/dpqr/xGVs/8Rl
bP/8+Pn//////////////////////46CfP9rW1T/a1tU/2xbVEkAAAAAAAAAAAAAAABsWFgaa1xU0Wtb
VP9rW1T/a1tU/7CopP////////////////////////////389P/RtwD/0bcA/+7lov//////////////
/////////////+PTY//RtwD/28Y1////////////0IWL/8RlbP/boaX/////////////////////////
///px8n/xGVs/8RlbP/8+Pn//////////////////////7CopP9rW1T/a1tU/2tbVIMAAAAAAAAAAAAA
AABqXFTOa1tU/2tbVP9tXlf/xr+9//////////////////////////////////389P/RtwD/0bcA/+7l
ov///////////////////////////+PTY//RtwD/28Y1////////////0IWL/8RlbP/boaX/////////
///////////////////px8n/xGVs/8RlbP/8+Pn//////////////////////9LNy/9rW1T/a1tU/2tb
VL8AAAAAAAAAAAAAAABrW1Tva1tU/2tbVP/KxML///////////////////////////////////////38
9P/RtwD/0bcA/+7lov///////////////////////////+PTY//RtwD/28Y1////////////0IWL/8Rl
bP/boaX////////////////////////////px8n/xGVs/8RlbP/8+Pn///////////////////////Py
8v9sXFX/a1tU/2tbVPRmZmYFAAAAAAAAAABrW1W4a1tU/2tbVP/Oycf/////////////////////////
//////////////389P/RtwD/0bcA/+7lov///////////////////////////+PTY//RtwD/28Y1////
////////0IWL/8RlbP/boaX////////////////////////////px8n/xGVs/8RlbP/8+Pn/////////
//////////////////+CdG7/a1tU/2tbVP9sXVM0AAAAAAAAAABqWlR/a1tU/2tbVP+tpKD/////////
//////////////////////////////389P/RtwD/0bcA/+7lov///////////////////////////+PT
Y//RtwD/28Y1////////////0IWL/8RlbP/boaX////////////////////////////px8n/xGVs/8Rl
bP/8+Pn///////////////////////////+jmZX/a1tU/2tbVP9rWlNuAAAAAAAAAABtWlNEa1tU/2tb
VP+Lfnn///////////////////////////////////////389P/RtwD/0bcA/93JQf/j1Gb/49Rm/+PU
Zv/j1Gb/49Rm/9jCJ//RtwD/28Y1////////////0IWL/8RlbP/NfYL/3KOn/9yjp//co6f/3KOn/9yj
p//TjJH/xGVs/8RlbP/8+Pn////////////////////////////Fv7z/a1tU/2tbVP9qW1OoAAAAAAAA
AABqVVUMa1tU+2tbVP9uXlf/+fn4//////////////////////////////////389P/RtwD/0bcA/9G3
AP/RtwD/0bcA/9G3AP/RtwD/0bcA/9G3AP/RtwD/28c5////////////0IWL/8RlbP/EZWz/xGVs/8Rl
bP/EZWz/xGVs/8RlbP/EZWz/xGVs/8Rmbf/9+vr////////////////////////////n5eT/a1tU/2tb
VP9rW1TkAAAAAAAAAAAAAAAAa1tUz2tbVP9rW1T/3NjW//////////////////////////////////38
9v/axTP/2sUz/9rFM//axTP/2sUz/9rFM//axTP/2sUz/9rFM//bxzj/8Ois////////////2p2i/9CE
if/QhIn/0ISJ/9CEif/QhIn/0ISJ/9CEif/QhIn/0ISJ/+GwtP//////////////////////////////
///+/v7/dWdg/2tbVP9rW1T/alhYHQAAAAAAAAAAa1tUlGtbVP9rW1T/ubKv////////////////////
////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
////////////////////////l4uG/2tbVP9rW1T/a1pUWAAAAAAAAAAAbFtVWmtbVP9rW1T/mI2I////
////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////uLGt/2tbVP9rW1T/a1tUkgAAAAAAAAAAa1pSH2tb
VP9rW1T/dmdh//7+/v////////////////////////////////+rnPH/fGTp/3xk6f98ZOn/fGTp/3xk
6f98ZOn/fGTp/3xk6f9/aOr/ysD2////////////rOH9/zi4+v8ztvr/M7b6/zO2+v8ztvr/M7b6/zO2
+v8ztvr/M7b6/33R/P//////////////////////////////////////2tbV/2tbVP9rW1T/a1tVzQAA
AAAAAAAAAAAAAGtbVONrW1T/a1tU/+jm5f////////////////////////////r5/v9cPuT/Wz3k/1s9
5P9bPeT/Wz3k/1s95P9bPeT/Wz3k/1s95P9bPeT/gGjq////////////Obj6/wCk+f8ApPn/AKT5/wCk
+f8ApPn/AKT5/wCk+f8ApPn/AKT5/wGk+f/3/P//////////////////////////////////+vn5/25f
WP9rW1T/a1tU/GpVVQwAAAAAAAAAAGtcVKprW1T/a1tU/8bAvf////////////////////////////j3
/v9bPeT/Wz3k/4Vu6/+di+//nYvv/52L7/+di+//nYvv/3Rb6P9bPeT/fWXq////////////Nbf6/wCk
+f8nsvr/Zsj7/2bI+/9myPv/Zsj7/2bI+/9Bu/v/AKT5/wCk+f/0+///////////////////////////
/////////////4p9eP9rW1T/a1tU/2xdVUIAAAAAAAAAAGtbVHBrW1T/a1tU/6Sblv//////////////
//////////////j3/v9bPeT/Wz3k/8O49f///////////////////////////5uI7v9bPeT/fWXq////
////////Nbf6/wCk+f9jx/v///////////////////////////+i3v3/AKT5/wCk+f/0+///////////
/////////////////////////////6yjn/9rW1T/a1tU/2pcVH0AAAAAAAAAAGxdUzRrW1T/a1tU/4J0
bv////////////////////////////j3/v9bPeT/Wz3k/8O49f///////////////////////////5uI
7v9bPeT/fWXq////////////Nbf6/wCk+f9jx/v///////////////////////////+i3v3/AKT5/wCk
+f/0+////////////////////////////////////////87Jx/9rW1T/a1tU/2tbVbgAAAAAAAAAAGZm
ZgVrW1T0a1tU/2xcVf/z8vL///////////////////////j3/v9bPeT/Wz3k/8O49f//////////////
/////////////5uI7v9bPeT/fWXq////////////Nbf6/wCk+f9jx/v/////////////////////////
//+i3v3/AKT5/wCk+f/0+////////////////////////////////////////8rEwv9rW1T/a1tU/2tb
VO8AAAAAAAAAAAAAAABrW1S/a1tU/2tbVP/Szcv///////////////////////j3/v9bPeT/Wz3k/8O4
9f///////////////////////////5uI7v9bPeT/fWXq////////////Nbf6/wCk+f9jx/v/////////
//////////////////+i3v3/AKT5/wCk+f/0+///////////////////////////////////xr+9/21e
V/9rW1T/a1tU/2pcVM4AAAAAAAAAAAAAAABrWlSFa1tU/2tbVP+xqaX///////////////////////j3
/v9bPeT/Wz3k/8O49f///////////////////////////5uI7v9bPeT/fWXq////////////Nbf6/wCk
+f9jx/v///////////////////////////+i3v3/AKT5/wCk+f/0+///////////////////////////
//+6sq//bFxV/2tbVP9rW1T/a1tT1m9eVR4AAAAAAAAAAAAAAABpXFVLa1tU/2tbVP+Pg37/////////
//////////////j3/v9bPeT/Wz3k/6CP7//Ivvb/yL72/8i+9v/Ivvb/yL72/4Vv6/9bPeT/fWXq////
////////Nbf6/wCk+f9CvPv/quH9/6rh/f+q4f3/quH9/6rh/f9sy/z/AKT5/wCk+f/0+///////////
/////////f39/6ifmv9rW1T/a1tU/2tbVP9rW1TIZllZFAAAAAAAAAAAAAAAAAAAAABpWloRa1tU/Wtb
VP9wYVr//Pv7//////////////////j3/v9bPeT/Wz3k/1s95P9bPeT/Wz3k/1s95P9bPeT/Wz3k/1s9
5P9bPeT/fWXq////////////Nbf6/wCk+f8ApPn/AKT5/wCk+f8ApPn/AKT5/wCk+f8ApPn/AKT5/wCk
+f/1+//////////////7+vr/nZKO/2tbVP9rW1T/a1tU/2tcVbJmZk0KAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAa1tT1mtbVP9rW1T/4Nzb//////////////////j3/v9bPeT/Wz3k/1s95P9bPeT/Wz3k/1s9
5P9bPeT/Wz3k/1s95P9bPeT/rJ3x////////////Nbf6/wCk+f8ApPn/AKT5/wCk+f8ApPn/AKT5/wCk
+f8ApPn/AKT5/z66+v////////////b19P+Pg37/a1tU/2tbVP9rW1T/a1tTn4BAQAQAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAa1pUm2tbVP9rW1T/vbaz//////////////////7+///08v3/9PL9//Ty
/f/08v3/9PL9//Ty/f/08v3/9PL9//Ty/f/49/7/////////////////8vr//+75///u+f//7vn//+75
///u+f//7vn//+75///u+f//8Pr/////////////8O/u/4Z5dP9rW1T/a1tU/2tbVP9rXFSIAAAAAQAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAbFxUYWtbVP9rW1T/nJGM////////////////////
////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////n5eT/fG5o/2tbVP9rW1T/a1tU/Gta
VWkAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAblpTJWtbVP9rW1T/dmdh/8jD
wP/08/L/////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////93Z1/91Z2D/a1tU/2tb
VP9rW1T2bFxTUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAWtb
VOlrW1T/a1tU/2tbVP9tXVb/j4N+/7y1sv/q6Of/////////////////////////////////////////
////////////////////////////////////////////////////////////////////////0czK/3Bh
Wv9rW1T/a1tU/2tbVO5qWVU8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAGpbVXhrW1T+a1tU/2tbVP9rW1T/a1tU/2tbVP9rW1T/g3Zw/7GopP/e2tn//v7+////
////////////////////////////////////////////////////////////////////////////////
///Evbv/bV1W/2tbVP9rW1T/a1tU42tZUysAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABsXVUhbFxVb2taVL1rW1T7a1tU/2tbVP9rW1T/a1tU/2tb
VP9rW1T/eGpj/6Wbl//Szcv/+vn5////////////////////////////////////////////////////
/////////////7Wtqv9rW1T/a1tU/2tbVP9rW1TUalhYHQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABpWloRbFpUVWtb
U6JrW1Twa1tU/2tbVP9rW1T/a1tU/2tbVP9rW1T/cGFa/5KHgv+/uLX/8O/u////////////////////
///////////////////9/f3/p56a/2tbVP9rW1T/a1tU/2pbVcdmWVkUAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAABVVVUDallVPGtbVJFrW1Pia1tU/2tbVP9rW1T/a1tU/2tbVP9rW1T/bFxV/4l8
dv+1ran/4d7d//////////////////v6+v+cko3/a1tU/2tbVP9rW1T/a1tUsXFVVQkAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAa1xSMmxcVIBrW1XNa1tU/2tb
VP9rW1T/a1tU/2tbVP9rW1T/a1tU/4Fzbf+vpqL/2NPR/42BfP9rW1T/a1tU/2tbVP9rW1SYVVVVAwAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAb15VHmtbU2trWlS6a1tU+WtbVP9rW1T/a1tU/2tbVP9rW1T/a1tU/2tbVP9rW1T/a1tU/2pa
VH8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAbVtbDmtcU1ZrW1Ola1tU7mtbVP9rW1T/a1tU/2tb
VP9rW1T8altTZQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgEBABGxd
VUJqWlOQa1tU22tbVOdsXFVOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD//4H///+sEP//AD///6wQ//4AB///rBD/+AAA//+sEP/w
AAAP/6wQ/+AAAAH/rBD/wAAAAD+sEP+AAAAAH6wQ/wAAAAAPrBD+AAAAAA+sEPwAAAAAD6wQ+AAAAAAP
rBDgAAAAAA+sEMAAAAAAB6wQgAAAAAAHrBAAAAAAAAesEAAAAAAAB6wQAAAAAAADrBAAAAAAAAOsEAAA
AAAAA6wQAAAAAAADrBAAAAAAAAOsEIAAAAAAAawQgAAAAAABrBCAAAAAAAGsEIAAAAAAAawQwAAAAAAA
rBDAAAAAAACsEMAAAAAAAKwQwAAAAAAArBDAAAAAAACsEOAAAAAAAKwQ4AAAAAAArBDgAAAAAAGsEOAA
AAAAA6wQ8AAAAAAHrBDwAAAAAA+sEPAAAAAAP6wQ8AAAAAB/rBDwAAAAAP+sEPgAAAAB/6wQ/AAAAAP/
rBD/gAAAB/+sEP/wAAAP/6wQ//8AAB//rBD//+AAf/+sEP///AD//6wQ////gf//rBAoAAAAIAAAAEAA
AAABACAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAABsXFRha1tU7GtbVcFqW1RzalxVJAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAbFtVe2tbVP5rW1T/a1tU/2tbVP9rW1T/a1tT1mtcVIhrWVU5gICAAgAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAVVVVA2xbVJVrW1T/bV5X/8K7uf/RzMr/pJqW/3hpY/9rW1T/a1tU/2tb
VP9rW1TpalxTnGxcVU5mZk0KAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAG1JSQdrW1Spa1tU/29fWf/Oycf//////////////////v7+/+He
3f+1ran/iXx2/2tbVP9rW1T/a1tU/2tbVPZqW1W7bFxVb2xYWBoAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABwYFAQbFxUwGtbVP91ZmD+3trZ////////////////////
////////////////////////6efm/7y0sf+Ogn3/bV1W/2tbVP9rW1T/a1tU/WtbVMZrWlR3ZlVVDwAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAaF5VG2tbVNJrW1T/fW9p/+fl5P//////////////
///////////////////////////////////////////////////z8vL/x8G//5uQi/9xYlv/a1tU/2tb
VP9rW1SPAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAGpdVylrW1Tha1tU/4V4cv/w7u7/////////
//////////////////////////////////////////////////////////////////////////////r6
+v/Evbv/a1tU/2xbVMwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABrXVM3a1tU62tbVP+MgHr/9PPy////
////////////////////////////////////////////////////////////////////////////////
//////////////v6+v9vX1n/a1tU+2pVVQwAAAAAAAAAAAAAAAAAAAAAallTTWtbVPVrW1T/mY6K//r5
+f///v3/1r8d/9G3AP/RtwD/0bcA/9G3AP/RtwD/07oL//r34//57u//x2xy/8RlbP/EZWz/xGVs/8Rl
bP/EZWz/y3d9///+/v///////////4yAev9rW1T/alpSQQAAAAAAAAAAAAAAAGpaVWBrW1T7a1tU/6mg
nP/+/v7///////799//RtwD/2cMr/+PUZv/j1Gb/49Rm/9zIPP/RtwD/9vHM//Pg4v/EZWz/0omP/9yj
p//co6f/3KOn/85/hf/EZWz//fr6////////////rqai/2tbVP9sW1V7AAAAAAAAAABrW1R5a1tU/2xc
Vf+4sa3//////////////////v33/9G3AP/k1Wz/////////////////7OGW/9G3AP/28cz/8+Di/8Rl
bP/nwML/////////////////3aaq/8RlbP/9+vr////////////RzMn/a1tU/2pbVLYAAAAAAAAAAGtb
VO5rW1T/w726///////////////////////+/ff/0bcA/+TVbP/////////////////s4Zb/0bcA//bx
zP/z4OL/xGVs/+fAwv/////////////////dpqr/xGVs//36+v////////////Lw8P9rW1T/a1tU74CA
gAIAAAAAa1tUxWtbVP/Z1dP///////////////////////799//RtwD/5NVs/////////////////+zh
lv/RtwD/9vHM//Pg4v/EZWz/58DC/////////////////92mqv/EZWz//fr6/////////////////4By
bP9rW1T/aF1RLAAAAABqXFSLa1tU/7iwrf///////////////////////v33/9G3AP/dyUH/7eKZ/+3i
mf/t4pn/4dBa/9G3AP/28cz/8+Di/8RlbP/Zm6D/58HE/+fBxP/nwcT/04yR/8RlbP/9+vr/////////
////////opeT/2tbVP9qW1NlAAAAAGtbVVFrW1T/louG///////////////////////+/ff/0bcA/9G3
AP/RtwD/0bcA/9G3AP/RtwD/0bcB//n12//z4OL/xGVs/8RlbP/EZWz/xGVs/8RlbP/EZWz/x2xy//79
/f/////////////////Dvbr/a1tU/2tbU58AAAAAaF1RFmtbVP90ZV///v7+///////////////////+
/f/28cz/9vHM//bxzP/28cz/9vHM//bxzP/49dr///////35+f/z4OL/8+Di//Pg4v/z4OL/8+Di//Pg
4v/47e7//////////////////////+Xi4f9rW1T/altU2gAAAAAAAAAAa1xT3GtbVP/m4+L/////////
/////////////+zp/P/e2Pr/3tj6/97Y+v/e2Pr/3tj6/+fj+////////////9ry/v/M7f7/zO3+/8zt
/v/M7f7/zO3+/+L1/v///////////////////////v7+/3VmX/9rW1T+aF1RFgAAAABsWlSha1tU/8S+
u//////////////////8/P//YkXl/1s95P9bPeT/Wz3k/1s95P9bPeT/XD7k/+jk+//b8v7/AaT5/wCk
+f8ApPn/AKT5/wCk+f8ApPn/C6j5//v+////////////////////////lYmE/2tbVP9rWlRPAAAAAGpc
VGdrW1T/o5mU//////////////////r5/v9bPeT/hW7r/72x9P+9sfT/vbH0/5WB7v9bPeT/3tj6/8zt
/v8ApPn/WsT7/5nb/f+Z2/3/mdv9/0G7+/8ApPn/9/z///////////////////////+2r6v/a1tU/2pb
VIkAAAAAaF1RLGtbVP+Acmz/////////////////+vn+/1s95P+gj+//////////////////u6/0/1s9
5P/e2Pr/zO3+/wCk+f+W2v3/////////////////bMv8/wCk+f/3/P///////////////////////9nV
0/9rW1T/a1tUxQAAAACAgIACa1tU72tbVP/y8PD////////////6+f7/Wz3k/6CP7///////////////
//+7r/T/Wz3k/97Y+v/M7f7/AKT5/5ba/f////////////////9sy/z/AKT5//f8////////////////
////////w726/2tbVP9rW1TuAAAAAAAAAABqW1S2a1tU/9HMyf////////////r5/v9bPeT/oI/v////
/////////////7uv9P9bPeT/3tj6/8zt/v8ApPn/ltr9/////////////////2zL/P8ApPn/9/z/////
/////////////7ixrf9sXFX/a1tU/2tbVHkAAAAAAAAAAGpcVH1rW1T/r6ej////////////+vn+/1s9
5P93Xun/nYvv/52L7/+di+//gmvq/1s95P/e2Pr/zO3+/wCk+f88ufr/Zsj7/2bI+/9myPv/K7P6/wCk
+f/3/P////////7+/v+upaH/a1tU/2tbVPxqXFRnAAAAAAAAAAAAAAAAa1tUQ2tbVP+NgXz/////////
///6+f7/Wz3k/1s95P9bPeT/Wz3k/1s95P9bPeT/YkXl/+3q/P/M7f7/AKT5/wCk+f8ApPn/AKT5/wCk
+f8ApPn/Ha76//3+///7+vr/nZOO/2tbVP9rWlT4altVVAAAAAAAAAAAAAAAAAAAAAB0XV0La1tU+29f
Wf/7+vr/////////////////////////////////////////////////////////////////////////
////////////////////////9vX0/5CEfv9rW1T/bFxU72pZVTwAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AABsW1TMa1tU/8S9u//6+vr/////////////////////////////////////////////////////////
//////////////////////////////Du7v+FeHL/a1tU/2tbVOFqXVcpAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAGtbVI9rW1T/a1tU/3FiW/+bkIv/x8G///Py8v//////////////////////////////
///////////////////////////////////n5eT/fW9p/2tbVP9rW1TSaF5VGwAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAZlVVD2taVHdrW1TGa1tU/WtbVP9rW1T/bV1W/46Cff+8tLH/6efm////
////////////////////////////////////////3trZ/3ZnYf9rW1T/bFxUwHBgUBAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABmWVkUalxUXmtcVKprW1Tya1tU/2tb
VP9rW1T/f3Fr/6uinv/Y09H//fz8/////////////////9LNy/9xYVv/a1tU/2paVa9xVVUJAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAGZm
TQpsXFVOalxTnGtbVOlrW1T/a1tU/2tbVP94aWP/pJqW/9HMyv/Cu7n/bV5X/2tbVP9sW1SVVVVVAwAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAgICAAmtZVTlrXFSIa1tT1mtbVP9rW1T/a1tU/2tbVP9rW1T+bFtVewAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAalxVJGpbVHNrW1XBa1tU7Gxc
VGEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP/g////wA///wAB//4A
AD/8AAAH+AAAB/AAAAfgAAADwAAAA4AAAAMAAAADAAAAAQAAAAEAAAABAAAAAQAAAAGAAAAAgAAAAIAA
AACAAAAAgAAAAMAAAADAAAABwAAAA8AAAAfgAAAP4AAAH+AAAD/8AAB//4AA///wA////wf/KAAAABgA
AAAwAAAAAQAgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAa1tTa2xcVfBsXFW1bFpVZmZcUhkAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFrWlSFa1tU/4+Dfv+AcWv8a1tU/2tb
VP5tXlbMa1xUemxbVS0AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAVVVVA2xbVJprW1T/qqCc//7+/v//////6+no/7+4tf+RhoH9bF1W/mtbVP9tXlbia1xTmWpZ
U02AVVUGAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAB0XV0LbFxVtWxcVf+5sq//////////
////////////////////////8/Hx/8bAvf+Zjor/cGBa/WtbVP9tXVbxaltUo2heVRsAAAAAAAAAAAAA
AAAAAAAAAAAAAGZZWRRtXFbKbV1W/sjCv///////////////////////////////////////////////
////////+vn5/9LNy/+mnJj/bV1W/WtbVIMAAAAAAAAAAAAAAAAAAAAAaFhYIG1eV9pvYFn808/N////
////////////////////////////////////////////////////////////////////////in55/W1d
Vr4AAAAAAAAAAAAAAABoXVEsbV5X53NlXvzd2tj//v78/9S8EP/RtwD/0bcA/9G3AP/RtwD/8Oit/+zN
0P/EZWz/xGVs/8RlbP/EZWz/yG91//79/f//////raSg/2xcVfaAQEAEAAAAAGxcVEBtXVbzfG5n++jm
5f///////v35/9G3AP/v5qf/9vHM//bxzP/Ywij/7eKZ/+fBxP/NfYP/8+Di//Pg4v/rysz/xGVs//77
/P//////z8rH/2tbVP9rXFIyAAAAAG1dVe2CdW/98O/u/////////////v35/9G3AP/38tH/////////
///axTL/7eKZ/+fBxP/Qg4n////////////04+T/xGVs//77/P//////8fDv/2tbVP9sW1RtAAAAAG5e
Vs+ViYT+/////////////////v35/9G3AP/38tH////////////axTL/7eKZ/+fBxP/Qg4n/////////
///04+T/xGVs//77/P///////////31waftqW1OoAAAAAGxaU5NyY138/v7+/////////////v35/9G3
AP/Zwyr/2sUz/9rFM//Tugr/7eOb/+fBxP/Ga3L/0ISJ/9CEif/OfoT/xGVs//78/P///////////6CW
kv9tXlflAAAAAGpcU1lrW1T/5ePh//////////////79/+3imf/t4pn/7eKZ/+3imf/t4pr/+/nr//bm
5//nwcT/58HE/+fBxP/nwcT/7M3P/////////////////8K7uf9rW1T/alhYHW9eVR5rW1T/w726////
/////////////8rA9v+9sfT/vbH0/72x9P++svT/8vD9/+v4//+a2/3/mdv9/5nb/f+Z2/3/rOH9////
/////////////+Th4P9rW1T/bFtVVwAAAABtXlfnopeT/////////////Pv+/1s95P92Xej/fGTp/3xk
6f9hReX/v7P0/5vb/f8KqPn/M7b6/zO2+v8qs/r/AKT5//r9//////////////7+/v9yY1z8a1tUkQAA
AABqW1OofXBp+///////////+/r+/1s95P/h3Pr///////////97Y+n/vbH0/5nb/f8ytvr/////////
///R7/7/AKT5//n9//////////////////+ViYT+bl5WzwAAAABsW1Rta1tU//Hw7///////+/r+/1s9
5P/h3Pr///////////97Y+n/vbH0/5nb/f8ytvr////////////R7/7/AKT5//n9//////////////Dv
7v+CdW/9bV1V7QAAAABsXVM0a1tU/9DLyf//////+/r+/1s95P/GvPb/3tj6/97Y+v91W+j/vbH0/5nb
/f8osvr/zO3+/8zt/v+n4P3/AKT5//n9////////6+no/35wavxsXVX1altURgAAAACAQEAEbV1W9q6m
ov//////+/r+/1s95P9bPeT/Wz3k/1s95P9bPeT/ysH2/5nb/f8ApPn/AKT5/wCk+f8ApPn/EKr5//z+
///g3dv/dmdh/G1dVuptWFMxAAAAAAAAAAAAAAAAbFxVv4x/ev3/////////////////////////////
/////////////////////////////////////////////9jT0f9xYVv8bV5W32pcVSQAAAAAAAAAAAAA
AAAAAAAAa1tUg21dVv2mnJj/0s3L//r5+f//////////////////////////////////////////////
////////yMK//21dVv5tXFbKZllZFAAAAAAAAAAAAAAAAAAAAAAAAAAAaF5VG2pbVKNsXFXwa1tU/3Bg
Wv2Zjor+xsC9//Px8f////////////////////////////////+5sq//bFxV/2xcVbV0XV0LAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABVVVUDallVPGtcVIhtXVbba1tU/2tbVP6Ie3X9ta2p/+He
3f///////v7+/66mov9rW1T/bFpUoWZmZgUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAbFtVLWtcVHpsXVXLa1tU/mtbVP9/cWv7j4N+/2tbVP9rWlSFAAAAAQAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAZlxSGWxaVWZsXFW1bFxV8GtbU2sAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP8H
/0H8AP9B+AAPQfAAA0HgAANBwAADQYAAAUEAAAFBAAABQQAAAUEAAAFBAAAAQQAAAEGAAABBgAAAQYAA
AEGAAABBgAABQcAAA0HAAAdBwAAPQfAAH0H/AD9B/+D/QSgAAAAQAAAAIAAAAAEAIAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHJhW3tvYFn0dWZgsmxbVVdmVVUPAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgICAAnFiW5eCdG705OHg/8a/vf+UiYT0cWFa+Xdo
YcptXFVsb15VHgAAAAAAAAAAAAAAAAAAAAAAAAAAbUlJB3NkXbKMgHr09/b2//////////////////r5
+f/Szcv/oJeS9XNlXfZzZV7baVxVJwAAAAAAAAAAbVtbDnNjXciZj4n1+/r6////////////////////
///////////////////+/v7/pJqW+WxdVnYAAAAAamBVGHJkXdmnnpn2/f37/9S8E//axTP/2MIo/+XX
cP/eqa3/zX2D/9CEif/IcHf//v39/83Ixf92Z2C8AAAAAHJjXOC5sK36//////7++//bxjb///////Xw
yv/k1Gf/3KOn//Pf4P//////0IaL//79/f/w7u7/cWFb8gAAAAF0Zl/i4+Df///////+/vv/2cMr//bx
zP/u5aL/5NRn/9yjp//px8n/8+Di/85/hf/+/f3//////3hpYvNuWlMldGReo8K7uf////////79/+PU
Zv/j1Gb/49Rm//Dorv/qyMv/3KOn/9yjp//eqKz///7+//////+ajoryalxUXmpaVWCbkYzz//////7+
//+ikfD/nYvv/52L7//Lwfb/ruL9/2bI+/9myPv/b8z8//7/////////wbq3/3RlXqJuWlMleGli8///
///8/P//d17p/97Y+v/DuPX/nYvv/2fJ+/+i3v3/zO3+/yuz+v/7/v///////+Pg3/90Zl/iAAAAAXFh
W/Lw7u7//Pz//35m6v//////3df5/52L7/9nyfv/yuz+//////82t/r/+/7///////+5sK36cmNc4AAA
AAB2Z2G+zsnH//z8//9iReX/fGTp/3Vb6P+jkvD/Z8n7/yiy+v8ztvr/E6v5//v9/v+to5/4c2Nd3m1b
UhwAAAAAbF1WdqSalvn+/v7///////////////////////////////////////v6+v+Zj4r2c2ReyW1b
Ww4AAAAAAAAAAGlcVSdzZV7bc2Vd9qCXkvXSzcv/+vn5//////////////////f29v+MgHr0c2Rdsm1J
SQcAAAAAAAAAAAAAAAAAAAAAAAAAAG9eVR5rW1NrdGRexnBhWfiShoHvxr+9/uTh4P+CdG70c2RdmYCA
gAIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABmVVUPbFtVV3VmYLJvYFn0cmFbewAA
AAAAAAAAAAAAAAAAAAAAAAAA+D+sQeAHrEHAAaxBgAGsQQABrEEAAKxBAACsQQAArEEAAKxBAACsQQAA
rEGAAKxBgAGsQYADrEHgB6xB/B+sQQ==
</value>
</data>
</root>

View File

@ -0,0 +1,37 @@
namespace RyzStudio.Windows.Forms
{
partial class THorizontalSeparator
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Component Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
components = new System.ComponentModel.Container();
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
}
#endregion
}
}

View File

@ -0,0 +1,101 @@
using System.ComponentModel;
using System.Drawing;
using System.Windows.Forms;
namespace RyzStudio.Windows.Forms
{
public partial class THorizontalSeparator : System.Windows.Forms.UserControl
{
public THorizontalSeparator()
{
InitializeComponent();
this.BackColor = Color.Transparent;
this.Margin = new Padding(10, 0, 10, 0);
this.MaximumSize = new Size(SystemInformation.VirtualScreen.Width, 22);
this.MinimumSize = new Size(0, 22);
this.Padding = new Padding(0, 10, 0, 10);
}
protected override void OnPaintBackground(PaintEventArgs e)
{
base.OnPaintBackground(e);
Graphics g = e.Graphics;
g.FillRectangle(new SolidBrush(Color.FromArgb(213, 223, 229)), new Rectangle(this.DisplayRectangle.Left, 11, this.DisplayRectangle.Width, 1));
g.FillRectangle(new SolidBrush(Color.FromArgb(249, 251, 253)), new Rectangle(this.DisplayRectangle.Left, 12, this.DisplayRectangle.Width, 1));
}
[Browsable(false), EditorBrowsable(EditorBrowsableState.Never)]
public override Image BackgroundImage { get => base.BackgroundImage; set => base.BackgroundImage = value; }
[Browsable(false), EditorBrowsable(EditorBrowsableState.Never)]
public override ImageLayout BackgroundImageLayout { get => base.BackgroundImageLayout; set => base.BackgroundImageLayout = value; }
[Browsable(false), EditorBrowsable(EditorBrowsableState.Never)]
public new BorderStyle BorderStyle { get => base.BorderStyle; set => base.BorderStyle = value; }
[Browsable(false), EditorBrowsable(EditorBrowsableState.Never)]
public override Cursor Cursor { get => base.Cursor; set => base.Cursor = value; }
[Browsable(false), EditorBrowsable(EditorBrowsableState.Never)]
public override Font Font { get => base.Font; set => base.Font = value; }
[Browsable(false), EditorBrowsable(EditorBrowsableState.Never)]
public override Color BackColor { get => base.BackColor; set => base.BackColor = value; }
[Browsable(false), EditorBrowsable(EditorBrowsableState.Never)]
public override Color ForeColor { get => base.ForeColor; set => base.ForeColor = value; }
[Browsable(false), EditorBrowsable(EditorBrowsableState.Never)]
public override RightToLeft RightToLeft { get => base.RightToLeft; set => base.RightToLeft = value; }
[Browsable(false), EditorBrowsable(EditorBrowsableState.Never)]
public new bool UseWaitCursor { get => base.UseWaitCursor; set => base.UseWaitCursor = value; }
[Browsable(false), EditorBrowsable(EditorBrowsableState.Never)]
public override bool AllowDrop { get => base.AllowDrop; set => base.AllowDrop = value; }
[Browsable(false), EditorBrowsable(EditorBrowsableState.Never)]
public override AutoValidate AutoValidate { get => base.AutoValidate; set => base.AutoValidate = value; }
[Browsable(false), EditorBrowsable(EditorBrowsableState.Never)]
public override ContextMenuStrip ContextMenuStrip { get => base.ContextMenuStrip; set => base.ContextMenuStrip = value; }
[Browsable(false), EditorBrowsable(EditorBrowsableState.Never)]
public new ImeMode ImeMode { get => base.ImeMode; set => base.ImeMode = value; }
[Browsable(false), EditorBrowsable(EditorBrowsableState.Never)]
public override bool AutoScroll { get => base.AutoScroll; set => base.AutoScroll = value; }
[Browsable(false), EditorBrowsable(EditorBrowsableState.Never)]
public new Size AutoScrollMargin { get => base.AutoScrollMargin; set => base.AutoScrollMargin = value; }
[Browsable(false), EditorBrowsable(EditorBrowsableState.Never)]
public new Size AutoScrollMinSize { get => base.AutoScrollMinSize; set => base.AutoScrollMinSize = value; }
[Browsable(false), EditorBrowsable(EditorBrowsableState.Never)]
public override bool AutoSize { get => base.AutoSize; set => base.AutoSize = value; }
[Browsable(false), EditorBrowsable(EditorBrowsableState.Never)]
public new AutoSizeMode AutoSizeMode { get => base.AutoSizeMode; set => base.AutoSizeMode = value; }
[Browsable(false), EditorBrowsable(EditorBrowsableState.Never)]
public override Size MaximumSize { get => base.MaximumSize; set => base.MaximumSize = value; }
[Browsable(false), EditorBrowsable(EditorBrowsableState.Never)]
public override Size MinimumSize { get => base.MinimumSize; set => base.MinimumSize = value; }
[Browsable(false), EditorBrowsable(EditorBrowsableState.Never)]
public new Padding Margin { get => base.Margin; set => base.Margin = value; }
[Browsable(false), EditorBrowsable(EditorBrowsableState.Never)]
public new Padding Padding { get => base.Padding; set => base.Padding = value; }
[Browsable(false), EditorBrowsable(EditorBrowsableState.Never)]
public new DockStyle Dock { get => base.Dock; set => base.Dock = value; }
}
}

View File

@ -0,0 +1,120 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>

View File

@ -0,0 +1,84 @@
using System;
using System.ComponentModel;
using System.Drawing;
namespace RyzStudio.Windows.Forms
{
public class TImageBox : System.Windows.Forms.PictureBox
{
public TImageBox() : base()
{
this.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Center;
this.ErrorImage = null;
this.InitialImage = null;
this.SizeMode = System.Windows.Forms.PictureBoxSizeMode.CenterImage;
}
protected override void OnCreateControl()
{
OnMouseLeave(null);
base.OnCreateControl();
}
[Browsable(false), EditorBrowsable(EditorBrowsableState.Never)]
public new Color BackColor { get => base.BackColor; set => base.BackColor = value; }
[Browsable(false), EditorBrowsable(EditorBrowsableState.Never)]
public new Image Image { get => base.Image; set => base.Image = value; }
[Category("Appearance"), Browsable(true)]
public Color BackColorNormal { get; set; } = Color.Transparent;
[Category("Appearance"), Browsable(true)]
public Color BackColorHover { get; set; } = Color.Transparent;
[Category("Appearance"), Browsable(true)]
public Color BackColorSelected { get; set; } = Color.Transparent;
[Category("Appearance"), Browsable(true)]
public Image ImageNormal { get; set; }
[Category("Appearance"), Browsable(true)]
public Image ImageHover { get; set; }
[Category("Appearance"), Browsable(true)]
public Image ImageSelected { get; set; }
[Browsable(false), EditorBrowsable(EditorBrowsableState.Never)]
public Image NormalImage { get => this.ImageNormal; set => this.ImageNormal = value; }
[Browsable(false), EditorBrowsable(EditorBrowsableState.Never)]
public Image HoverImage { get => this.ImageHover; set => this.ImageHover = value; }
[Browsable(false), EditorBrowsable(EditorBrowsableState.Never)]
public Image SelectedImage { get => this.ImageSelected; set => this.ImageSelected = value; }
public bool IsSelected { get; set; } = false;
protected override void OnMouseEnter(EventArgs e)
{
this.Image = this.ImageHover;
this.BackColor = this.BackColorHover;
base.OnMouseEnter(e);
}
protected override void OnMouseLeave(EventArgs e)
{
this.Image = (this.IsSelected ? this.ImageSelected : this.ImageNormal);
this.BackColor = (this.IsSelected ? this.BackColorSelected : this.BackColorNormal);
base.OnMouseLeave(e);
}
protected override void OnLostFocus(EventArgs e)
{
this.Image = (this.IsSelected ? this.ImageSelected : this.ImageNormal);
this.BackColor = (this.IsSelected ? this.BackColorSelected : this.BackColorNormal);
base.OnLostFocus(e);
}
}
}

View File

@ -0,0 +1,258 @@
namespace RyzStudio.Windows.Forms
{
using System;
using System.Collections;
using System.ComponentModel;
using System.Drawing;
using System.Windows.Forms;
[ToolboxItem(true)]
public class TPanelBook : UserControl
{
public class PanelCollection : CollectionBase
{
protected TPanelBook panelBook = null;
public PanelCollection(TPanelBook parentPanelBook) : base()
{
panelBook = parentPanelBook;
}
public TPanelBook Parent => panelBook;
public Panel this[int index] { get => (Panel)List[index]; set => List[index] = value; }
public int Add(Panel value) => List.Add(value);
public void AddRange(Panel[] pages) => Array.ForEach(pages, x => this.Add(x));
public bool Contains(Panel value) => List.Contains(value);
public int IndexOf(Panel value) => List.IndexOf(value);
public void Insert(int index, Panel value) => List.Insert(index, value);
public void Remove(Panel value) => List.Remove(value);
protected override void OnInsertComplete(int index, object value)
{
base.OnInsertComplete(index, value);
if (panelBook != null)
{
panelBook.PageIndex = index;
}
}
protected override void OnRemoveComplete(int index, object value)
{
base.OnRemoveComplete(index, value);
if (panelBook != null)
{
if (panelBook.PageIndex == index)
{
if (index < InnerList.Count)
{
panelBook.PageIndex = index;
}
else
{
panelBook.PageIndex = InnerList.Count - 1;
}
}
}
}
}
private System.ComponentModel.IContainer components = null;
protected PanelCollection panelCollection = null;
public TPanelBook()
{
InitializeComponent();
panelCollection = new PanelCollection(this);
}
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
protected void InitializeComponent()
{
components = new System.ComponentModel.Container();
}
[Browsable(false), EditorBrowsable(EditorBrowsableState.Never)]
public Panel ActivePanel { get; protected set; } = null;
[Browsable(false), EditorBrowsable(EditorBrowsableState.Never)]
public override bool AutoScroll { get => base.AutoScroll; set => base.AutoScroll = value; }
[Browsable(false), EditorBrowsable(EditorBrowsableState.Never)]
public new Size AutoScrollMargin { get => base.AutoScrollMargin; set => base.AutoScrollMargin = value; }
[Browsable(false), EditorBrowsable(EditorBrowsableState.Never)]
public new Size AutoScrollMinSize { get => base.AutoScrollMinSize; set => base.AutoScrollMinSize = value; }
[Browsable(false), EditorBrowsable(EditorBrowsableState.Never)]
public override Image BackgroundImage { get => base.BackgroundImage; set => base.BackgroundImage = value; }
[Browsable(false), EditorBrowsable(EditorBrowsableState.Never)]
public override ImageLayout BackgroundImageLayout { get => base.BackgroundImageLayout; set => base.BackgroundImageLayout = value; }
[Browsable(false), EditorBrowsable(EditorBrowsableState.Never)]
public new ImeMode ImeMode { get => base.ImeMode; set => base.ImeMode = value; }
[Browsable(false), EditorBrowsable(EditorBrowsableState.Never)]
public override RightToLeft RightToLeft { get => base.RightToLeft; set => base.RightToLeft = value; }
[Browsable(false), EditorBrowsable(EditorBrowsableState.Never)]
public new bool UseWaitCursor { get => base.UseWaitCursor; set => base.UseWaitCursor = value; }
[Category("Collection")]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Content)]
public PanelCollection Pages => panelCollection;
[Category("Collection")]
public int SelectedIndex
{
get => (panelCollection.Count <= 0) ? -1 : panelCollection.IndexOf(this.ActivePanel);
set
{
if (panelCollection.Count <= 0) return;
if (value < 0) return;
if (value > (panelCollection.Count - 1)) return;
if (value == this.SelectedIndex) return;
ActivatePage(value);
}
}
protected internal int PageIndex
{
get => panelCollection.IndexOf(this.ActivePanel);
set
{
if (panelCollection.Count <= 0)
{
ActivatePage(-1);
return;
}
if ((value < -1) || (value >= panelCollection.Count))
{
throw new ArgumentOutOfRangeException("PageIndex", value, "The page index must be between 0 and " + Convert.ToString(panelCollection.Count - 1));
}
ActivatePage(value);
}
}
protected internal void ActivatePage(int index)
{
if ((panelCollection.Count == 0) && (index >= panelCollection.Count) && (index <= 0))
{
return;
}
Panel p = (Panel)panelCollection[index];
ActivatePage(p);
}
protected internal void ActivatePage(Panel page)
{
if (this.ActivePanel != null)
{
if (this.ActivePanel.InvokeRequired)
{
this.ActivePanel.Invoke(new MethodInvoker(() => {
this.ActivePanel.Visible = false;
}));
}
else
{
this.ActivePanel.Visible = false;
}
}
this.ActivePanel = page;
if (this.ActivePanel != null)
{
this.ActivePanel.Parent = this;
if (!this.Contains(this.ActivePanel))
{
this.Container.Add(this.ActivePanel);
}
if (this.ActivePanel.InvokeRequired)
{
this.ActivePanel.Invoke(new MethodInvoker(() => {
this.ActivePanel.Dock = DockStyle.Fill;
this.ActivePanel.Visible = true;
this.ActivePanel.BringToFront();
}));
}
else
{
this.ActivePanel.Dock = DockStyle.Fill;
this.ActivePanel.Visible = true;
this.ActivePanel.BringToFront();
}
}
if (this.ActivePanel != null)
{
if (this.ActivePanel.InvokeRequired)
{
this.ActivePanel.Invoke(new MethodInvoker(() => {
this.ActivePanel.Invalidate();
}));
}
else
{
this.ActivePanel.Invalidate();
}
}
else
{
this.Invalidate();
}
}
#if DEBUG
protected override void OnResize(EventArgs e)
{
base.OnResize(e);
if (this.DesignMode)
{
this.Invalidate();
}
}
#endif
protected override void DestroyHandle()
{
base.DestroyHandle();
foreach (Panel p in panelCollection)
{
p.Dispose();
}
}
}
}

View File

@ -0,0 +1,73 @@
using System.ComponentModel;
using System.Drawing;
using System.Windows.Forms;
namespace RyzStudio.Windows.Forms
{
public class TUserControl : UserControl
{
public TUserControl() : base()
{
}
[Browsable(false), EditorBrowsable(EditorBrowsableState.Never)]
public override Image BackgroundImage { get => base.BackgroundImage; set => base.BackgroundImage = value; }
[Browsable(false), EditorBrowsable(EditorBrowsableState.Never)]
public override ImageLayout BackgroundImageLayout { get => base.BackgroundImageLayout; set => base.BackgroundImageLayout = value; }
[Browsable(false), EditorBrowsable(EditorBrowsableState.Never)]
public new BorderStyle BorderStyle { get => base.BorderStyle; set => base.BorderStyle = value; }
[Browsable(false), EditorBrowsable(EditorBrowsableState.Never)]
public override Cursor Cursor { get => base.Cursor; set => base.Cursor = value; }
[Browsable(false), EditorBrowsable(EditorBrowsableState.Never)]
public override Font Font { get => base.Font; set => base.Font = value; }
[Browsable(false), EditorBrowsable(EditorBrowsableState.Never)]
public override Color ForeColor { get => base.ForeColor; set => base.ForeColor = value; }
[Browsable(false), EditorBrowsable(EditorBrowsableState.Never)]
public override RightToLeft RightToLeft { get => base.RightToLeft; set => base.RightToLeft = value; }
[Browsable(false), EditorBrowsable(EditorBrowsableState.Never)]
public new bool UseWaitCursor { get => base.UseWaitCursor; set => base.UseWaitCursor = value; }
[Browsable(false), EditorBrowsable(EditorBrowsableState.Never)]
public override bool AllowDrop { get => base.AllowDrop; set => base.AllowDrop = value; }
[Browsable(false), EditorBrowsable(EditorBrowsableState.Never)]
public override AutoValidate AutoValidate { get => base.AutoValidate; set => base.AutoValidate = value; }
//[Browsable(false), EditorBrowsable(EditorBrowsableState.Never)]
//public override ContextMenuStrip ContextMenuStrip { get => base.ContextMenuStrip; set => base.ContextMenuStrip = value; }
[Browsable(false), EditorBrowsable(EditorBrowsableState.Never)]
public new ImeMode ImeMode { get => base.ImeMode; set => base.ImeMode = value; }
[Browsable(false), EditorBrowsable(EditorBrowsableState.Never)]
public override bool AutoScroll { get => base.AutoScroll; set => base.AutoScroll = value; }
[Browsable(false), EditorBrowsable(EditorBrowsableState.Never)]
public new Size AutoScrollMargin { get => base.AutoScrollMargin; set => base.AutoScrollMargin = value; }
[Browsable(false), EditorBrowsable(EditorBrowsableState.Never)]
public new Size AutoScrollMinSize { get => base.AutoScrollMinSize; set => base.AutoScrollMinSize = value; }
[Browsable(false), EditorBrowsable(EditorBrowsableState.Never)]
public override bool AutoSize { get => base.AutoSize; set => base.AutoSize = value; }
[Browsable(false), EditorBrowsable(EditorBrowsableState.Never)]
public new AutoSizeMode AutoSizeMode { get => base.AutoSizeMode; set => base.AutoSizeMode = value; }
[Browsable(false), EditorBrowsable(EditorBrowsableState.Never)]
public override Size MaximumSize { get => base.MaximumSize; set => base.MaximumSize = value; }
[Browsable(false), EditorBrowsable(EditorBrowsableState.Never)]
public override Size MinimumSize { get => base.MinimumSize; set => base.MinimumSize = value; }
}
}

View File

@ -0,0 +1,633 @@
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace RyzStudio.Windows.Forms
{
public class ThreadControl
{
public static void Add(Control control, Control value)
{
if (control.InvokeRequired)
{
control.Invoke(new MethodInvoker(() =>
{
control.Controls.Add(value);
}));
}
else
{
control.Controls.Add(value);
}
}
public static void Add(ListBox control, string value)
{
if (control.InvokeRequired)
{
control.Invoke(new MethodInvoker(() => {
control.Items.Add(value);
}));
}
else
{
control.Items.Add(value);
}
}
//public static void Add(FlowLayoutPanel control, Control value)
//{
// if (control.InvokeRequired)
// {
// control.Invoke(new MethodInvoker(() => {
// control.Controls.Add(value);
// }));
// }
// else
// {
// control.Controls.Add(value);
// }
//}
public static int Add(TreeView control, TreeNode value)
{
int n = -1;
if (control.InvokeRequired)
{
control.Invoke(new MethodInvoker(() => {
n = control.Nodes.Add(value);
}));
}
else
{
n = control.Nodes.Add(value);
}
return n;
}
public static int Add(TreeNode control, TreeNode value)
{
int n = -1;
if (control.TreeView.InvokeRequired)
{
control.TreeView.Invoke(new MethodInvoker(() => {
n = control.Nodes.Add(value);
}));
}
else
{
n = control.Nodes.Add(value);
}
return n;
}
public static int Add(DataGridView control, object[] value)
{
int n = -1;
if (control.InvokeRequired)
{
control.Invoke(new MethodInvoker(() => {
n = control.Rows.Add(value);
}));
}
else
{
n = control.Rows.Add(value);
}
return n;
}
public static int Add(DataGridView control, object[] value, object tag)
{
int n = -1;
if (control.InvokeRequired)
{
control.Invoke(new MethodInvoker(() => {
n = control.Rows.Add(value);
control.Rows[n].Tag = tag;
}));
}
else
{
n = control.Rows.Add(value);
control.Rows[n].Tag = tag;
}
return n;
}
public static TreeNode Add(TreeView control, string key, string text)
{
TreeNode rv = null;
if (control.InvokeRequired)
{
control.Invoke(new MethodInvoker(() => {
rv = control.Nodes.Add(key, text);
}));
}
else
{
rv = control.Nodes.Add(key, text);
}
return rv;
}
public static TreeNode Add(TreeNode control, string key, string text)
{
TreeNode rv = null;
if (control.TreeView.InvokeRequired)
{
control.TreeView.Invoke(new MethodInvoker(() => {
rv = control.Nodes.Add(key, text);
}));
}
else
{
rv = control.Nodes.Add(key, text);
}
return rv;
}
public static TreeNode Add(TreeView parentControl, TreeNodeCollection control, string key, string text, int imageIndex, int selectedImageIndex)
{
TreeNode rv = null;
if (parentControl.InvokeRequired)
{
parentControl.Invoke(new MethodInvoker(() => {
rv = control.Add(key, text, imageIndex, selectedImageIndex);
}));
}
else
{
rv = control.Add(key, text, imageIndex, selectedImageIndex);
}
return rv;
}
public static void AddLine(RichTextBox control, string text)
{
if (control.InvokeRequired)
{
control.Invoke(new MethodInvoker(() =>
{
control.Text += text + Environment.NewLine;
}));
}
else
{
control.Text += text + Environment.NewLine;
}
}
public static void Clear(ListBox control)
{
if (control.InvokeRequired)
{
control.Invoke(new MethodInvoker(() => {
control.Items.Clear();
}));
}
else
{
control.Items.Clear();
}
}
public static void Clear(FlowLayoutPanel control)
{
if (control.InvokeRequired)
{
control.Invoke(new MethodInvoker(() => {
control.Controls.Clear();
}));
}
else
{
control.Controls.Clear();
}
}
public static void Clear(TreeView control)
{
if (control.InvokeRequired)
{
control.Invoke(new MethodInvoker(() => {
control.Nodes.Clear();
}));
}
else
{
control.Nodes.Clear();
}
}
public static void Clear(Label control) => SetText(control, string.Empty);
public static void Clear(PictureBox control)
{
if (control.InvokeRequired)
{
control.Invoke(new MethodInvoker(() =>
{
control.Image = null;
}));
}
else
{
control.Image = null;
}
}
public static void Clear(DataGridView control)
{
if (control.InvokeRequired)
{
control.Invoke(new MethodInvoker(() =>
{
control.Rows.Clear();
}));
}
else
{
control.Rows.Clear();
}
}
public static void Expand(TreeNode control)
{
if (control.TreeView.InvokeRequired)
{
control.TreeView.Invoke(new MethodInvoker(() => {
control.Expand();
}));
}
else
{
control.Expand();
}
}
public static List<T> FindChildControl<T>(Control control) where T : Control
{
List<T> rs = new List<T>();
foreach (Control item in control.Controls)
{
var ctr = item as T;
if (ctr == null)
{
rs.AddRange(FindChildControl<T>(item));
}
else
{
rs.Add(ctr);
}
}
return rs;
}
public static string GetText(Control control, bool doTrim = true)
{
string rv = string.Empty;
if (control.InvokeRequired)
{
control.Invoke(new MethodInvoker(() => {
rv = (doTrim ? control.Text?.Trim() : control.Text);
}));
}
else
{
rv = (doTrim ? control.Text?.Trim() : control.Text);
}
return rv;
}
public static void SetChecked(ToolStripMenuItem control, bool value)
{
if (control.GetCurrentParent().InvokeRequired)
{
control.GetCurrentParent().Invoke(new MethodInvoker(() =>
{
control.Checked = value;
}));
}
else
{
control.Checked = value;
}
}
public static void SetEnable(Control control, bool value)
{
if (control.InvokeRequired)
{
control.Invoke(new MethodInvoker(() =>
{
control.Enabled = value;
}));
}
else
{
control.Enabled = value;
}
}
public static void SetEnable(ToolStripMenuItem control, bool value)
{
if (control.GetCurrentParent().InvokeRequired)
{
control.GetCurrentParent().Invoke(new MethodInvoker(() =>
{
control.Enabled = value;
}));
}
else
{
control.Enabled = value;
}
}
public static void SetFocus(Control control)
{
if (control.InvokeRequired)
{
control.Invoke(new MethodInvoker(() =>
{
control.Focus();
}));
}
else
{
control.Focus();
}
}
public static int GetValue(NumericUpDown sender)
{
int rv = 0;
if (sender.InvokeRequired)
{
sender.Invoke(new MethodInvoker(() => {
rv = (int)sender.Value;
}));
}
else
{
rv = (int)sender.Value;
}
return rv;
}
public static string GetSelectedValue(ListBox sender)
{
string rv = string.Empty;
if (sender.InvokeRequired)
{
sender.Invoke(new MethodInvoker(() => {
rv = (sender.SelectedItem == null) ? string.Empty : sender.SelectedItem.ToString();
}));
}
else
{
rv = (sender.SelectedItem == null) ? string.Empty : sender.SelectedItem.ToString();
}
return rv;
}
public static void SetHeight(Control control, int value)
{
if (control.InvokeRequired)
{
control.Invoke(new MethodInvoker(() => {
control.Height = value;
}));
}
else
{
control.Height = value;
}
}
public static void SetLocation(Control control, Point value)
{
if (control.InvokeRequired)
{
control.Invoke(new MethodInvoker(() => {
control.Location = value;
}));
}
else
{
control.Location = value;
}
}
public static void SetClientSize(Control control, int width, int height) => SetClientSize(control, new Size(width, height));
public static void SetClientSize(Control control, Size value)
{
if (control.InvokeRequired)
{
control.Invoke(new MethodInvoker(() => {
control.ClientSize = value;
}));
}
else
{
control.ClientSize = value;
}
}
public static void SetClientHeight(Control control, int value)
{
if (control.InvokeRequired)
{
control.Invoke(new MethodInvoker(() => {
control.ClientSize = new Size(control.ClientSize.Width, value);
}));
}
else
{
control.ClientSize = new Size(control.ClientSize.Width, value);
}
}
public static void SetSize(Control control, int width, int height) => SetSize(control, new Size(width, height));
public static void SetSize(Control control, Size value)
{
if (control.InvokeRequired)
{
control.Invoke(new MethodInvoker(() => {
control.Size = value;
}));
}
else
{
control.Size = value;
}
}
public static void SetText(Control control, string text)
{
if (control.InvokeRequired)
{
control.Invoke(new MethodInvoker(() =>
{
control.Text = text;
}));
}
else
{
control.Text = text;
}
}
public static void SetTopMost(Form control, bool value)
{
if (control.InvokeRequired)
{
control.Invoke(new MethodInvoker(() => {
control.TopMost = value;
}));
}
else
{
control.TopMost = value;
}
}
public static void SetValue(Control control, string value)
{
if (control.InvokeRequired)
{
control.Invoke(new MethodInvoker(() => {
control.Text = value;
}));
}
else
{
control.Text = value;
}
}
public static void SetValue(PictureBox control, Image value)
{
if (control.InvokeRequired)
{
control.Invoke(new MethodInvoker(() =>
{
control.Image = value;
}));
}
else
{
control.Image = value;
}
}
public static void SetVisible(Control control, bool value)
{
if (control.InvokeRequired)
{
control.Invoke(new MethodInvoker(() => {
control.Visible = value;
}));
}
else
{
control.Visible = value;
}
}
public static void SetVisible(Form control, bool value)
{
if (control.InvokeRequired)
{
control.Invoke(new MethodInvoker(() => {
if (value)
{
//control.ShowInTaskbar = value;
//control.Opacity = 100;
control.Visible = value;
}
else
{
control.Visible = value;
//control.ShowInTaskbar = value;
//control.Opacity = 0;
}
}));
}
else
{
if (value)
{
//control.ShowInTaskbar = value;
//control.Opacity = 100;
control.Visible = value;
}
else
{
control.Visible = value;
//control.ShowInTaskbar = value;
//control.Opacity = 0;
}
}
}
public static void SetWidth(Control control, int value)
{
if (control.InvokeRequired)
{
control.Invoke(new MethodInvoker(() => {
control.Width = value;
}));
}
else
{
control.Width = value;
}
}
public static void SetClientWidth(Control control, int value)
{
if (control.InvokeRequired)
{
control.Invoke(new MethodInvoker(() => {
control.ClientSize = new Size(value, control.ClientSize.Height);
}));
}
else
{
control.ClientSize = new Size(value, control.ClientSize.Height);
}
}
}
}

View File

@ -0,0 +1,193 @@
using RyzStudio.Windows.Forms;
namespace RyzStudio.Windows.ThemedForms
{
partial class BorderlessForm
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(BorderlessForm));
this.label1 = new System.Windows.Forms.Label();
this.panel1 = new System.Windows.Forms.Panel();
this.area1 = new System.Windows.Forms.Panel();
this.pictureBox4 = new RyzStudio.Windows.Forms.TImageBox();
this.pictureBox2 = new RyzStudio.Windows.Forms.TImageBox();
this.pictureBox1 = new RyzStudio.Windows.Forms.TImageBox();
this.pictureBox3 = new RyzStudio.Windows.Forms.TImageBox();
((System.ComponentModel.ISupportInitialize)(this.pictureBox4)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.pictureBox2)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.pictureBox3)).BeginInit();
this.SuspendLayout();
//
// label1
//
this.label1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.label1.BackColor = System.Drawing.Color.Transparent;
this.label1.Font = new System.Drawing.Font("Segoe UI", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.label1.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(241)))), ((int)(((byte)(241)))), ((int)(((byte)(241)))));
this.label1.Location = new System.Drawing.Point(1, 1);
this.label1.Name = "label1";
this.label1.Padding = new System.Windows.Forms.Padding(48, 0, 0, 0);
this.label1.Size = new System.Drawing.Size(454, 48);
this.label1.TabIndex = 148;
this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
this.label1.DoubleClick += new System.EventHandler(this.label1_DoubleClick);
this.label1.MouseClick += new System.Windows.Forms.MouseEventHandler(this.label1_MouseClick);
this.label1.MouseDown += new System.Windows.Forms.MouseEventHandler(this.label1_MouseDown);
this.label1.MouseMove += new System.Windows.Forms.MouseEventHandler(this.label1_MouseMove);
this.label1.MouseUp += new System.Windows.Forms.MouseEventHandler(this.label1_MouseUp);
//
// panel1
//
this.panel1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.panel1.BackColor = System.Drawing.Color.Transparent;
this.panel1.Cursor = System.Windows.Forms.Cursors.SizeNWSE;
this.panel1.Location = new System.Drawing.Point(594, 674);
this.panel1.Name = "panel1";
this.panel1.Size = new System.Drawing.Size(6, 6);
this.panel1.TabIndex = 150;
this.panel1.MouseDown += new System.Windows.Forms.MouseEventHandler(this.panel1_MouseDown);
this.panel1.MouseMove += new System.Windows.Forms.MouseEventHandler(this.panel1_MouseMove);
this.panel1.MouseUp += new System.Windows.Forms.MouseEventHandler(this.panel1_MouseUp);
//
// area1
//
this.area1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.area1.BackColor = System.Drawing.Color.Transparent;
this.area1.Cursor = System.Windows.Forms.Cursors.SizeNS;
this.area1.Location = new System.Drawing.Point(1, 674);
this.area1.Name = "area1";
this.area1.Size = new System.Drawing.Size(592, 6);
this.area1.TabIndex = 152;
this.area1.MouseDown += new System.Windows.Forms.MouseEventHandler(this.panel2_MouseDown);
this.area1.MouseMove += new System.Windows.Forms.MouseEventHandler(this.panel2_MouseMove);
this.area1.MouseUp += new System.Windows.Forms.MouseEventHandler(this.panel2_MouseUp);
//
// pictureBox4
//
this.pictureBox4.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.pictureBox4.BackColor = System.Drawing.Color.Transparent;
this.pictureBox4.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Center;
this.pictureBox4.ErrorImage = null;
this.pictureBox4.ImageHover = global::hiim.dply.Properties.Resources.form20_menu2;
this.pictureBox4.Image = global::hiim.dply.Properties.Resources.form20_menu;
this.pictureBox4.InitialImage = null;
this.pictureBox4.Location = new System.Drawing.Point(460, 11);
this.pictureBox4.Name = "pictureBox4";
this.pictureBox4.NormalImage = global::hiim.dply.Properties.Resources.form20_menu;
this.pictureBox4.Size = new System.Drawing.Size(28, 28);
this.pictureBox4.SizeMode = System.Windows.Forms.PictureBoxSizeMode.CenterImage;
this.pictureBox4.TabIndex = 149;
this.pictureBox4.TabStop = false;
//
// pictureBox2
//
this.pictureBox2.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.pictureBox2.BackColor = System.Drawing.Color.Transparent;
this.pictureBox2.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Center;
this.pictureBox2.ErrorImage = null;
this.pictureBox2.ImageHover = global::hiim.dply.Properties.Resources.form20_maximise2;
this.pictureBox2.Image = global::hiim.dply.Properties.Resources.form20_maximise;
this.pictureBox2.InitialImage = null;
this.pictureBox2.Location = new System.Drawing.Point(528, 11);
this.pictureBox2.Name = "pictureBox2";
this.pictureBox2.NormalImage = global::hiim.dply.Properties.Resources.form20_maximise;
this.pictureBox2.Size = new System.Drawing.Size(28, 28);
this.pictureBox2.SizeMode = System.Windows.Forms.PictureBoxSizeMode.CenterImage;
this.pictureBox2.TabIndex = 147;
this.pictureBox2.TabStop = false;
//
// pictureBox1
//
this.pictureBox1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.pictureBox1.BackColor = System.Drawing.Color.Transparent;
this.pictureBox1.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Center;
this.pictureBox1.ErrorImage = null;
this.pictureBox1.ImageHover = global::hiim.dply.Properties.Resources.form20_minimise2;
this.pictureBox1.Image = global::hiim.dply.Properties.Resources.form20_minimise;
this.pictureBox1.InitialImage = null;
this.pictureBox1.Location = new System.Drawing.Point(494, 11);
this.pictureBox1.Name = "pictureBox1";
this.pictureBox1.NormalImage = global::hiim.dply.Properties.Resources.form20_minimise;
this.pictureBox1.Size = new System.Drawing.Size(28, 28);
this.pictureBox1.SizeMode = System.Windows.Forms.PictureBoxSizeMode.CenterImage;
this.pictureBox1.TabIndex = 146;
this.pictureBox1.TabStop = false;
//
// pictureBox3
//
this.pictureBox3.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.pictureBox3.BackColor = System.Drawing.Color.Transparent;
this.pictureBox3.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Center;
this.pictureBox3.ErrorImage = null;
this.pictureBox3.ImageHover = global::hiim.dply.Properties.Resources.form20_close2;
this.pictureBox3.Image = ((System.Drawing.Image)(resources.GetObject("pictureBox3.Image")));
this.pictureBox3.InitialImage = null;
this.pictureBox3.Location = new System.Drawing.Point(562, 11);
this.pictureBox3.Name = "pictureBox3";
this.pictureBox3.NormalImage = ((System.Drawing.Image)(resources.GetObject("pictureBox3.NormalImage")));
this.pictureBox3.Size = new System.Drawing.Size(28, 28);
this.pictureBox3.SizeMode = System.Windows.Forms.PictureBoxSizeMode.CenterImage;
this.pictureBox3.TabIndex = 145;
this.pictureBox3.TabStop = false;
//
// BorderlessForm
//
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None;
this.BackColor = System.Drawing.Color.WhiteSmoke;
this.ClientSize = new System.Drawing.Size(600, 680);
this.Controls.Add(this.area1);
this.Controls.Add(this.panel1);
this.Controls.Add(this.pictureBox4);
this.Controls.Add(this.label1);
this.Controls.Add(this.pictureBox2);
this.Controls.Add(this.pictureBox1);
this.Controls.Add(this.pictureBox3);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
this.Name = "BorderlessForm";
((System.ComponentModel.ISupportInitialize)(this.pictureBox4)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.pictureBox2)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.pictureBox3)).EndInit();
this.ResumeLayout(false);
}
#endregion
protected internal TImageBox pictureBox2;
protected internal TImageBox pictureBox1;
protected internal TImageBox pictureBox3;
protected internal System.Windows.Forms.Label label1;
protected internal TImageBox pictureBox4;
protected internal System.Windows.Forms.Panel panel1;
protected internal System.Windows.Forms.Panel area1;
}
}

View File

@ -0,0 +1,409 @@
namespace RyzStudio.Windows.ThemedForms
{
using System;
using System.ComponentModel;
using System.Drawing;
using System.Drawing.Design;
using System.Windows.Forms;
public partial class BorderlessForm : System.Windows.Forms.Form
{
protected bool isBusy = false;
protected Color topFillColour = Color.FromArgb(15, 15, 15);
protected int topFillHeight = 48;
protected Color bottomFillColour = Color.FromArgb(15, 15, 15);
protected int bottomFillMargin = 19;
protected int bottomLeftMargin = 20;
protected int borderWidth = 1;
protected int menuFillWidth = 160;
protected Color menuFillColour = Color.FromArgb(179, 179, 179);
private bool windowDragging = false;
private Point windowOffset = new Point();
private Point windowSize = new Point();
public BorderlessForm() : base()
{
this.InitializeComponent();
this.BackColor = Color.FromArgb(247, 247, 247);
this.FormBorderStyle = FormBorderStyle.None;
this.Padding = new Padding(1);
this.topFillColour = Color.FromArgb(51, 51, 51);
this.topFillHeight = 48;
this.bottomFillColour = Color.FromArgb(0, 152, 167);
this.bottomFillMargin = 6;
pictureBox1.Click += pictureBox1_Click;
pictureBox2.Click += pictureBox2_Click;
pictureBox3.Click += pictureBox3_Click;
pictureBox4.Click += pictureBox4_Click;
updatePictureBox2Image();
}
protected override void OnClosing(CancelEventArgs e)
{
base.OnClosing(e);
if (this.IsBusy)
{
e.Cancel = true;
}
}
protected override void OnPaint(PaintEventArgs e)
{
base.OnPaint(e);
Graphics g = e.Graphics;
Rectangle areaTop = new Rectangle(this.DisplayRectangle.Left, this.Padding.Top, this.DisplayRectangle.Width, topFillHeight);
Rectangle areaBottom = new Rectangle(this.DisplayRectangle.Left, (this.DisplayRectangle.Height - bottomFillMargin + this.Padding.Top), this.DisplayRectangle.Width, bottomFillMargin);
Rectangle areaBorder = new Rectangle(this.ClientRectangle.X, this.ClientRectangle.Y, this.ClientRectangle.Width - borderWidth, this.ClientRectangle.Height - borderWidth);
Rectangle areaMenu = new Rectangle(this.DisplayRectangle.Left, this.DisplayRectangle.Top + topFillHeight, menuFillWidth, (this.DisplayRectangle.Height - bottomFillMargin - topFillHeight));
// draw header
if (topFillHeight > 0)
{
g.FillRectangle(new SolidBrush(topFillColour), areaTop);
}
// fill menu
g.FillRectangle(new SolidBrush(menuFillColour), areaMenu);
// draw footer
if (bottomFillMargin > 0)
{
g.FillRectangle(new SolidBrush(bottomFillColour), areaBottom);
}
// draw logo
if (this.TitleLogo != null)
{
g.DrawImageUnscaled(this.TitleLogo, this.Padding.Left, this.Padding.Top);
}
if (this.Banner != null)
{
g.DrawImageUnscaled(this.Banner, this.Padding.Left + bottomLeftMargin, (this.DisplayRectangle.Height - this.Banner.Height - bottomFillMargin + this.Padding.Top), (this.DisplayRectangle.Width - (this.Padding.Left + this.Padding.Right)), this.Banner.Height);
}
g.DrawRectangle(new Pen(Color.Black, borderWidth), areaBorder);
}
protected override void OnResize(EventArgs e)
{
base.OnResize(e);
updatePictureBox2Image();
this.Invalidate();
}
[Browsable(false), EditorBrowsable(EditorBrowsableState.Never)]
public new Color BackColor { get => base.BackColor; set => base.BackColor = value; }
[Browsable(false), EditorBrowsable(EditorBrowsableState.Never)]
public new FormBorderStyle FormBorderStyle { get => base.FormBorderStyle; set => base.FormBorderStyle = value; }
[Browsable(false), EditorBrowsable(EditorBrowsableState.Never)]
public new Padding Padding { get => base.Padding; set => base.Padding = value; }
[Category("Appearance"), Browsable(true)]
public string Description
{
get
{
return label1.Text?.Replace("\n", "\\n");
}
set
{
label1.Text = value?.Replace("\\n", "\n");
}
}
[Category("Appearance"), Browsable(true)]
public Image TitleLogo { get; set; }
[Category("Appearance"), Browsable(true)]
public Image Banner { get; set; }
[Category("Appearance"), Browsable(true)]
public bool ShowMenuButton { get => pictureBox4.Visible; set => pictureBox4.Visible = value; }
protected virtual bool IsBusy { get => isBusy; set => isBusy = value; }
private void pictureBox4_Click(object sender, System.EventArgs e)
{
//this.WindowState = FormWindowState.Minimized;
}
private void pictureBox1_Click(object sender, System.EventArgs e)
{
MouseEventArgs mouseEvent = (MouseEventArgs)e;
if (mouseEvent != null)
{
if (mouseEvent.Button != MouseButtons.Left)
{
return;
}
}
this.WindowState = FormWindowState.Minimized;
}
private void pictureBox2_Click(object sender, System.EventArgs e)
{
MouseEventArgs mouseEvent = (MouseEventArgs)e;
if (mouseEvent != null)
{
if (mouseEvent.Button != MouseButtons.Left)
{
return;
}
}
if (this.WindowState == FormWindowState.Maximized)
{
this.WindowState = FormWindowState.Normal;
pictureBox2.NormalImage = Resources.form20_maximise;
pictureBox2.HighlightImage = Resources.form20_maximise2;
}
else
{
this.WindowState = FormWindowState.Maximized;
pictureBox2.NormalImage = Resources.form20_restore;
pictureBox2.HighlightImage = Resources.form20_restore2;
}
}
private void pictureBox3_Click(object sender, System.EventArgs e)
{
MouseEventArgs mouseEvent = (MouseEventArgs)e;
if (mouseEvent != null)
{
if (mouseEvent.Button != MouseButtons.Left)
{
return;
}
}
this.Close();
}
public void SetValue(Label sender, string value)
{
if (sender.InvokeRequired)
{
sender.Invoke(new MethodInvoker(() => { sender.Text = value; }));
}
else
{
sender.Text = value;
}
}
public void SetValue(GroupBox sender, string value)
{
if (sender.InvokeRequired)
{
sender.Invoke(new MethodInvoker(() => { sender.Text = value; }));
}
else
{
sender.Text = value;
}
}
public void AddValue(ListBox sender, string value)
{
if (sender.InvokeRequired)
{
sender.Invoke(new MethodInvoker(() => { sender.Items.Add(value); }));
}
else
{
sender.Items.Add(value);
}
}
public void AddControl(FlowLayoutPanel sender, Control value)
{
if (sender.InvokeRequired)
{
sender.Invoke(new MethodInvoker(() =>
{
sender.Controls.Add(value);
}));
}
else
{
sender.Controls.Add(value);
}
}
public void ClearValues(ListBox sender)
{
if (sender.InvokeRequired)
{
sender.Invoke(new MethodInvoker(() => { sender.Items.Clear(); }));
}
else
{
sender.Items.Clear();
}
}
public string GetValue(ListBox sender)
{
string rv = string.Empty;
if (sender.InvokeRequired)
{
sender.Invoke(new MethodInvoker(() => { rv = (sender.SelectedItem == null) ? string.Empty : sender.SelectedItem.ToString(); }));
}
else
{
rv = (sender.SelectedItem == null) ? string.Empty : sender.SelectedItem.ToString();
}
return rv;
}
public string GetValue(TextBox sender)
{
string rv = string.Empty;
if (sender.InvokeRequired)
{
sender.Invoke(new MethodInvoker(() => { rv = sender.Text.Trim(); }));
}
else
{
rv = sender.Text.Trim();
}
return rv;
}
public int GetValue(NumericUpDown sender)
{
int rv = 0;
if (sender.InvokeRequired)
{
sender.Invoke(new MethodInvoker(() => { rv = (int)sender.Value; }));
}
else
{
rv = (int)sender.Value;
}
return rv;
}
protected void updatePictureBox2Image()
{
if (this.WindowState == FormWindowState.Maximized)
{
pictureBox2.NormalImage = Resources.form20_restore;
pictureBox2.HighlightImage = Resources.form20_restore2;
}
else
{
pictureBox2.NormalImage = Resources.form20_maximise;
pictureBox2.HighlightImage = Resources.form20_maximise2;
}
}
private void label1_MouseDown(object sender, MouseEventArgs e)
{
if (e.Button != MouseButtons.Left)
{
return;
}
windowDragging = true;
windowOffset = e.Location;
}
private void label1_MouseUp(object sender, MouseEventArgs e)
{
windowDragging = false;
}
private void label1_MouseMove(object sender, MouseEventArgs e)
{
if (windowDragging)
{
Point currentScreenPos = PointToScreen(e.Location);
Location = new Point(currentScreenPos.X - windowOffset.X, currentScreenPos.Y - windowOffset.Y);
}
}
private void label1_DoubleClick(object sender, EventArgs e) => pictureBox2_Click(sender, e);
private void label1_MouseClick(object sender, MouseEventArgs e)
{
if (e.Button == MouseButtons.Middle)
{
this.TopMost = !this.TopMost;
}
}
private void panel1_MouseDown(object sender, MouseEventArgs e)
{
if (e.Button != MouseButtons.Left)
{
return;
}
windowDragging = true;
windowOffset = e.Location;
windowSize = new Point(this.Width, this.Height);
}
private void panel1_MouseUp(object sender, MouseEventArgs e)
{
windowDragging = false;
}
private void panel1_MouseMove(object sender, MouseEventArgs e)
{
if (windowDragging)
{
this.Size = new Size(e.X - windowOffset.X + this.Width, e.Y - windowOffset.Y + this.Height);
}
}
private void panel2_MouseDown(object sender, MouseEventArgs e)
{
if (e.Button != MouseButtons.Left)
{
return;
}
windowDragging = true;
windowOffset = e.Location;
windowSize = new Point(this.Width, this.Height);
}
private void panel2_MouseUp(object sender, MouseEventArgs e)
{
windowDragging = false;
}
private void panel2_MouseMove(object sender, MouseEventArgs e)
{
if (windowDragging)
{
this.Size = new Size(windowSize.X, e.Y - windowOffset.Y + this.Height);
}
}
}
}

View File

@ -0,0 +1,158 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<metadata name="label1.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="pictureBox4.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="pictureBox2.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="pictureBox1.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="pictureBox3.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="pictureBox3.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAYAAACNiR0NAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAO
xAAADsQBlSsOGwAAABl0RVh0U29mdHdhcmUAd3d3Lmlua3NjYXBlLm9yZ5vuPBoAAADnSURBVDhP1ZVB
DoIwEEW7whNo9Cri/QCv5Y4YEoTWxK71Gvqn+W2AgEkbNvxkYPgzfWkpKcpau9NaX/u+/yC+iSFjK3Ay
RdhcU0qUChc3s67rzipRGJ8T+JYHR2ctWYGzXSC8Gzbs3rbtgZaSXDyp0QoKnJBMBK8WH5vVCUhCcvbX
bAuivwxsmmaP2TxYfyE3zJ/Ij2wLYu3/OxQoah4kYedgIt8TDTTGnFgeyfcsAodLxn205Dlo4IRkInjr
bgq8dT+bWG0L6A/WnLVo4b1eyHDHV8WHNaJwvwAkJeI9KMSGjC201tkP+AimzgF8cMEAAAAASUVORK5C
YII=
</value>
</data>
<data name="pictureBox3.NormalImage" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAYAAACNiR0NAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAO
xAAADsQBlSsOGwAAABl0RVh0U29mdHdhcmUAd3d3Lmlua3NjYXBlLm9yZ5vuPBoAAADnSURBVDhP1ZVB
DoIwEEW7whNo9Cri/QCv5Y4YEoTWxK71Gvqn+W2AgEkbNvxkYPgzfWkpKcpau9NaX/u+/yC+iSFjK3Ay
RdhcU0qUChc3s67rzipRGJ8T+JYHR2ctWYGzXSC8Gzbs3rbtgZaSXDyp0QoKnJBMBK8WH5vVCUhCcvbX
bAuivwxsmmaP2TxYfyE3zJ/Ij2wLYu3/OxQoah4kYedgIt8TDTTGnFgeyfcsAodLxn205Dlo4IRkInjr
bgq8dT+bWG0L6A/WnLVo4b1eyHDHV8WHNaJwvwAkJeI9KMSGjC201tkP+AimzgF8cMEAAAAASUVORK5C
YII=
</value>
</data>
</root>

View File

@ -0,0 +1,191 @@
namespace RyzStudio.Windows.ThemedForms
{
partial class BorderlessToolForm
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.lblDescription = new System.Windows.Forms.Label();
this.panel1 = new System.Windows.Forms.Panel();
this.imgbxMenu = new RyzStudio.Windows.Forms.ImageBox();
this.imgbxMaximise = new RyzStudio.Windows.Forms.ImageBox();
this.imgbxMinimise = new RyzStudio.Windows.Forms.ImageBox();
this.imgbxClose = new RyzStudio.Windows.Forms.ImageBox();
this.area1 = new System.Windows.Forms.Panel();
((System.ComponentModel.ISupportInitialize)(this.imgbxMenu)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.imgbxMaximise)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.imgbxMinimise)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.imgbxClose)).BeginInit();
this.SuspendLayout();
//
// lblDescription
//
this.lblDescription.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.lblDescription.BackColor = System.Drawing.Color.Transparent;
this.lblDescription.Font = new System.Drawing.Font("Segoe UI", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.lblDescription.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(241)))), ((int)(((byte)(241)))), ((int)(((byte)(241)))));
this.lblDescription.Location = new System.Drawing.Point(1, 1);
this.lblDescription.Name = "lblDescription";
this.lblDescription.Padding = new System.Windows.Forms.Padding(10, 0, 0, 0);
this.lblDescription.Size = new System.Drawing.Size(194, 30);
this.lblDescription.TabIndex = 148;
this.lblDescription.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
this.lblDescription.DoubleClick += new System.EventHandler(this.label1_DoubleClick);
this.lblDescription.MouseClick += new System.Windows.Forms.MouseEventHandler(this.label1_MouseClick);
this.lblDescription.MouseDown += new System.Windows.Forms.MouseEventHandler(this.label1_MouseDown);
this.lblDescription.MouseMove += new System.Windows.Forms.MouseEventHandler(this.label1_MouseMove);
this.lblDescription.MouseUp += new System.Windows.Forms.MouseEventHandler(this.label1_MouseUp);
//
// panel1
//
this.panel1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.panel1.BackColor = System.Drawing.Color.Transparent;
this.panel1.Cursor = System.Windows.Forms.Cursors.SizeNWSE;
this.panel1.Location = new System.Drawing.Point(335, 595);
this.panel1.Name = "panel1";
this.panel1.Size = new System.Drawing.Size(5, 5);
this.panel1.TabIndex = 150;
this.panel1.MouseDown += new System.Windows.Forms.MouseEventHandler(this.panel1_MouseDown);
this.panel1.MouseMove += new System.Windows.Forms.MouseEventHandler(this.panel1_MouseMove);
this.panel1.MouseUp += new System.Windows.Forms.MouseEventHandler(this.panel1_MouseUp);
//
// imgbxMenu
//
this.imgbxMenu.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.imgbxMenu.BackColor = System.Drawing.Color.Transparent;
this.imgbxMenu.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Center;
this.imgbxMenu.ErrorImage = null;
this.imgbxMenu.HighlightImage = global::AppLauncher.Properties.Resources.form16_menu2;
this.imgbxMenu.Image = global::AppLauncher.Properties.Resources.form16_menu;
this.imgbxMenu.InitialImage = null;
this.imgbxMenu.Location = new System.Drawing.Point(224, 4);
this.imgbxMenu.Name = "imgbxMenu";
this.imgbxMenu.NormalImage = global::AppLauncher.Properties.Resources.form16_menu;
this.imgbxMenu.Size = new System.Drawing.Size(24, 24);
this.imgbxMenu.SizeMode = System.Windows.Forms.PictureBoxSizeMode.CenterImage;
this.imgbxMenu.TabIndex = 149;
this.imgbxMenu.TabStop = false;
//
// imgbxMaximise
//
this.imgbxMaximise.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.imgbxMaximise.BackColor = System.Drawing.Color.Transparent;
this.imgbxMaximise.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Center;
this.imgbxMaximise.ErrorImage = null;
this.imgbxMaximise.HighlightImage = global::AppLauncher.Properties.Resources.form16_maximise2;
this.imgbxMaximise.Image = global::AppLauncher.Properties.Resources.form16_maximise;
this.imgbxMaximise.InitialImage = null;
this.imgbxMaximise.Location = new System.Drawing.Point(280, 4);
this.imgbxMaximise.Name = "imgbxMaximise";
this.imgbxMaximise.NormalImage = global::AppLauncher.Properties.Resources.form16_maximise;
this.imgbxMaximise.Size = new System.Drawing.Size(24, 24);
this.imgbxMaximise.SizeMode = System.Windows.Forms.PictureBoxSizeMode.CenterImage;
this.imgbxMaximise.TabIndex = 147;
this.imgbxMaximise.TabStop = false;
//
// imgbxMinimise
//
this.imgbxMinimise.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.imgbxMinimise.BackColor = System.Drawing.Color.Transparent;
this.imgbxMinimise.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Center;
this.imgbxMinimise.ErrorImage = null;
this.imgbxMinimise.HighlightImage = global::AppLauncher.Properties.Resources.form16_minimise2;
this.imgbxMinimise.Image = global::AppLauncher.Properties.Resources.form16_minimise;
this.imgbxMinimise.InitialImage = null;
this.imgbxMinimise.Location = new System.Drawing.Point(252, 4);
this.imgbxMinimise.Name = "imgbxMinimise";
this.imgbxMinimise.NormalImage = global::AppLauncher.Properties.Resources.form16_minimise;
this.imgbxMinimise.Size = new System.Drawing.Size(24, 24);
this.imgbxMinimise.SizeMode = System.Windows.Forms.PictureBoxSizeMode.CenterImage;
this.imgbxMinimise.TabIndex = 146;
this.imgbxMinimise.TabStop = false;
//
// imgbxClose
//
this.imgbxClose.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.imgbxClose.BackColor = System.Drawing.Color.Transparent;
this.imgbxClose.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Center;
this.imgbxClose.ErrorImage = null;
this.imgbxClose.HighlightImage = global::AppLauncher.Properties.Resources.form16_close2;
this.imgbxClose.Image = global::AppLauncher.Properties.Resources.form16_close;
this.imgbxClose.InitialImage = null;
this.imgbxClose.Location = new System.Drawing.Point(308, 4);
this.imgbxClose.Name = "imgbxClose";
this.imgbxClose.NormalImage = global::AppLauncher.Properties.Resources.form16_close;
this.imgbxClose.Size = new System.Drawing.Size(24, 24);
this.imgbxClose.SizeMode = System.Windows.Forms.PictureBoxSizeMode.CenterImage;
this.imgbxClose.TabIndex = 145;
this.imgbxClose.TabStop = false;
//
// area1
//
this.area1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.area1.BackColor = System.Drawing.Color.Transparent;
this.area1.Cursor = System.Windows.Forms.Cursors.SizeNS;
this.area1.Location = new System.Drawing.Point(0, 595);
this.area1.Name = "area1";
this.area1.Size = new System.Drawing.Size(334, 5);
this.area1.TabIndex = 151;
this.area1.MouseDown += new System.Windows.Forms.MouseEventHandler(this.panel2_MouseDown);
this.area1.MouseMove += new System.Windows.Forms.MouseEventHandler(this.panel2_MouseMove);
this.area1.MouseUp += new System.Windows.Forms.MouseEventHandler(this.panel2_MouseUp);
//
// BorderlessToolForm
//
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None;
this.BackColor = System.Drawing.Color.WhiteSmoke;
this.ClientSize = new System.Drawing.Size(340, 600);
this.Controls.Add(this.area1);
this.Controls.Add(this.panel1);
this.Controls.Add(this.imgbxMenu);
this.Controls.Add(this.lblDescription);
this.Controls.Add(this.imgbxMaximise);
this.Controls.Add(this.imgbxMinimise);
this.Controls.Add(this.imgbxClose);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
this.MinimumSize = new System.Drawing.Size(40, 0);
this.Name = "BorderlessToolForm";
((System.ComponentModel.ISupportInitialize)(this.imgbxMenu)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.imgbxMaximise)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.imgbxMinimise)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.imgbxClose)).EndInit();
this.ResumeLayout(false);
}
#endregion
protected internal Forms.ImageBox imgbxMaximise;
protected internal Forms.ImageBox imgbxMinimise;
protected internal Forms.ImageBox imgbxClose;
protected internal System.Windows.Forms.Label lblDescription;
protected internal Forms.ImageBox imgbxMenu;
protected internal System.Windows.Forms.Panel panel1;
protected internal System.Windows.Forms.Panel area1;
}
}

View File

@ -0,0 +1,394 @@
namespace RyzStudio.Windows.ThemedForms
{
using System;
using System.ComponentModel;
using System.Drawing;
using System.Drawing.Design;
using System.Windows.Forms;
using Resources = AppLauncher.Properties.Resources;
public partial class BorderlessToolForm : System.Windows.Forms.Form
{
protected bool isBusy = false;
protected Color topFillColour = Color.FromArgb(15, 15, 15);
protected int topFillHeight = 32;
protected int borderWidth = 1;
private bool windowDragging = false;
private Point windowOffset = new Point();
private Point windowSize = new Point();
public BorderlessToolForm() : base()
{
this.InitializeComponent();
this.BackColor = Color.FromArgb(246, 246, 246);
this.Padding = new Padding(1);
this.topFillColour = Color.FromArgb(51, 51, 51);
this.topFillHeight = 32;
this.BackColor = Color.FromArgb(179, 179, 179);
this.FormBorderStyle = FormBorderStyle.None;
imgbxMinimise.Click += pictureBox1_Click;
imgbxMaximise.Click += pictureBox2_Click;
imgbxClose.Click += pictureBox3_Click;
imgbxMenu.Click += pictureBox4_Click;
updatePictureBox2Image();
}
protected override void OnClosing(CancelEventArgs e)
{
base.OnClosing(e);
if (this.IsBusy)
{
e.Cancel = true;
}
}
protected override void OnPaint(PaintEventArgs e)
{
base.OnPaint(e);
Graphics g = e.Graphics;
Rectangle areaTop = new Rectangle(this.DisplayRectangle.Left, this.Padding.Top, this.DisplayRectangle.Width, topFillHeight);
Rectangle areaBorder = new Rectangle(this.ClientRectangle.X, this.ClientRectangle.Y, this.ClientRectangle.Width - borderWidth, this.ClientRectangle.Height - borderWidth);
// draw header
if (topFillHeight > 0)
{
g.FillRectangle(new SolidBrush(topFillColour), areaTop);
}
// draw logo
//if (this.TitleLogo != null)
//{
// g.DrawImageUnscaled(this.TitleLogo, this.Padding.Left, this.Padding.Top);
//}
g.DrawRectangle(new Pen(Color.Black, borderWidth), areaBorder);
}
protected override void OnResize(EventArgs e)
{
base.OnResize(e);
updatePictureBox2Image();
this.Invalidate();
}
[Browsable(false), EditorBrowsable(EditorBrowsableState.Never)]
public new Color BackColor { get => base.BackColor; set => base.BackColor = value; }
[Browsable(false), EditorBrowsable(EditorBrowsableState.Never)]
public new FormBorderStyle FormBorderStyle { get => base.FormBorderStyle; set => base.FormBorderStyle = value; }
[Browsable(false), EditorBrowsable(EditorBrowsableState.Never)]
public new Padding Padding { get => base.Padding; set => base.Padding = value; }
[Category("Appearance"), Browsable(true)]
public string Description
{
get
{
return lblDescription.Text?.Replace("\n", "\\n");
}
set
{
lblDescription.Text = value?.Replace("\\n", "\n");
}
}
//[Category("Appearance"), Browsable(true)]
//public Image TitleLogo { get; set; }
[Category("Appearance"), Browsable(true)]
public Image Banner { get; set; }
[Category("Appearance"), Browsable(true)]
public bool ShowMenuButton { get => imgbxMenu.Visible; set => imgbxMenu.Visible = value; }
[Category("Appearance"), Browsable(true)]
public bool ShowMinimiseButton { get => imgbxMinimise.Visible; set => imgbxMinimise.Visible = value; }
[Category("Appearance"), Browsable(true)]
public bool ShowMaximiseButton { get => imgbxMaximise.Visible; set => imgbxMaximise.Visible = value; }
protected virtual bool IsBusy { get => isBusy; set => isBusy = value; }
private void pictureBox4_Click(object sender, System.EventArgs e)
{
//this.WindowState = FormWindowState.Minimized;
}
private void pictureBox1_Click(object sender, System.EventArgs e)
{
MouseEventArgs mouseEvent = (MouseEventArgs)e;
if (mouseEvent != null)
{
if (mouseEvent.Button != MouseButtons.Left)
{
return;
}
}
this.WindowState = FormWindowState.Minimized;
}
private void pictureBox2_Click(object sender, System.EventArgs e)
{
MouseEventArgs mouseEvent = (MouseEventArgs)e;
if (mouseEvent != null)
{
if (mouseEvent.Button != MouseButtons.Left)
{
return;
}
}
if (this.WindowState == FormWindowState.Maximized)
{
this.WindowState = FormWindowState.Normal;
imgbxMaximise.NormalImage = Resources.form16_maximise;
imgbxMaximise.HighlightImage = Resources.form16_maximise2;
}
else
{
this.WindowState = FormWindowState.Maximized;
imgbxMaximise.NormalImage = Resources.form16_restore;
imgbxMaximise.HighlightImage = Resources.form16_restore2;
}
}
private void pictureBox3_Click(object sender, System.EventArgs e)
{
MouseEventArgs mouseEvent = (MouseEventArgs)e;
if (mouseEvent != null)
{
if (mouseEvent.Button != MouseButtons.Left)
{
return;
}
}
this.Close();
}
public void SetValue(Label sender, string value)
{
if (sender.InvokeRequired)
{
sender.Invoke(new MethodInvoker(() => { sender.Text = value; }));
}
else
{
sender.Text = value;
}
}
public void SetValue(GroupBox sender, string value)
{
if (sender.InvokeRequired)
{
sender.Invoke(new MethodInvoker(() => { sender.Text = value; }));
}
else
{
sender.Text = value;
}
}
public void AddValue(ListBox sender, string value)
{
if (sender.InvokeRequired)
{
sender.Invoke(new MethodInvoker(() => { sender.Items.Add(value); }));
}
else
{
sender.Items.Add(value);
}
}
public void AddControl(FlowLayoutPanel sender, Control value)
{
if (sender.InvokeRequired)
{
sender.Invoke(new MethodInvoker(() =>
{
sender.Controls.Add(value);
}));
}
else
{
sender.Controls.Add(value);
}
}
public void ClearValues(ListBox sender)
{
if (sender.InvokeRequired)
{
sender.Invoke(new MethodInvoker(() => { sender.Items.Clear(); }));
}
else
{
sender.Items.Clear();
}
}
public string GetValue(ListBox sender)
{
string rv = string.Empty;
if (sender.InvokeRequired)
{
sender.Invoke(new MethodInvoker(() => { rv = (sender.SelectedItem == null) ? string.Empty : sender.SelectedItem.ToString(); }));
}
else
{
rv = (sender.SelectedItem == null) ? string.Empty : sender.SelectedItem.ToString();
}
return rv;
}
public string GetValue(TTextBox sender)
{
string rv = string.Empty;
if (sender.InvokeRequired)
{
sender.Invoke(new MethodInvoker(() => { rv = sender.Text.Trim(); }));
}
else
{
rv = sender.Text.Trim();
}
return rv;
}
public int GetValue(NumericUpDown sender)
{
int rv = 0;
if (sender.InvokeRequired)
{
sender.Invoke(new MethodInvoker(() => { rv = (int)sender.Value; }));
}
else
{
rv = (int)sender.Value;
}
return rv;
}
protected void updatePictureBox2Image()
{
if (this.WindowState == FormWindowState.Maximized)
{
imgbxMaximise.NormalImage = Resources.form16_restore;
imgbxMaximise.HighlightImage = Resources.form16_restore2;
}
else
{
imgbxMaximise.NormalImage = Resources.form16_maximise;
imgbxMaximise.HighlightImage = Resources.form16_maximise2;
}
}
private void label1_MouseDown(object sender, MouseEventArgs e)
{
if (e.Button != MouseButtons.Left)
{
return;
}
windowDragging = true;
windowOffset = e.Location;
}
private void label1_MouseUp(object sender, MouseEventArgs e)
{
windowDragging = false;
}
private void label1_MouseMove(object sender, MouseEventArgs e)
{
if (windowDragging)
{
Point currentScreenPos = PointToScreen(e.Location);
Location = new Point(currentScreenPos.X - windowOffset.X, currentScreenPos.Y - windowOffset.Y);
}
}
private void label1_DoubleClick(object sender, EventArgs e) => pictureBox2_Click(sender, e);
private void label1_MouseClick(object sender, MouseEventArgs e)
{
if (e.Button == MouseButtons.Middle)
{
this.TopMost = !this.TopMost;
}
}
private void panel1_MouseDown(object sender, MouseEventArgs e)
{
if (e.Button != MouseButtons.Left)
{
return;
}
windowDragging = true;
windowOffset = e.Location;
windowSize = new Point(this.Width, this.Height);
}
private void panel1_MouseUp(object sender, MouseEventArgs e)
{
windowDragging = false;
}
private void panel1_MouseMove(object sender, MouseEventArgs e)
{
if (windowDragging)
{
this.Size = new Size(e.X - windowOffset.X + this.Width, e.Y - windowOffset.Y + this.Height);
}
}
private void panel2_MouseDown(object sender, MouseEventArgs e)
{
if (e.Button != MouseButtons.Left)
{
return;
}
windowDragging = true;
windowOffset = e.Location;
windowSize = new Point(this.Width, this.Height);
}
private void panel2_MouseUp(object sender, MouseEventArgs e)
{
windowDragging = false;
}
private void panel2_MouseMove(object sender, MouseEventArgs e)
{
if (windowDragging)
{
this.Size = new Size(windowSize.X, e.Y - windowOffset.Y + this.Height);
}
}
}
}

View File

@ -0,0 +1,138 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<metadata name="lblDescription.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="panel1.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="imgbxMenu.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="imgbxMaximise.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="imgbxMinimise.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="imgbxClose.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
</root>

View File

@ -0,0 +1,98 @@
namespace RyzStudio.Windows.ThemedForms
{
using RyzStudio.Drawing;
using System;
using System.ComponentModel;
using System.Drawing;
using System.Windows.Forms;
public partial class TPickerBox : RyzStudio.Windows.ThemedForms.TUserControl
{
protected readonly Padding textboxPadding = new Padding(6, 2, 4, 2);
public TPickerBox() : base()
{
InitializeComponent();
this.Font = new Font(this.Font, FontStyle.Regular);
this.Margin = new Padding(10, 4, 10, 4);
comboBox1.Font = this.Font;
comboBox1.DropDownStyle = ComboBoxStyle.DropDownList;
comboBox1.PreviewKeyDown += textBox_PreviewKeyDown;
}
protected override void OnResize(EventArgs e)
{
base.OnResize(e);
int b = (styleActive.BorderWidth + 1) + styleActive.BorderPadding;
this.Height = comboBox1.Height + (b + textboxPadding.Top) + ((b - 1) + textboxPadding.Bottom);
}
protected override void OnGotFocus(EventArgs e)
{
base.OnGotFocus(e);
comboBox1.Focus();
}
protected void textBox_PreviewKeyDown(object sender, PreviewKeyDownEventArgs e)
{
switch (e.KeyCode)
{
case Keys.Enter:
if (this.SubmitButton != null)
{
this.SubmitButton.PerformClick();
}
break;
case Keys.Escape:
close();
break;
default: break;
}
}
[Browsable(true), EditorBrowsable(EditorBrowsableState.Advanced)]
[Category("Appearance")]
public System.Windows.Forms.ComboBox ComboBox { get => comboBox1; set => comboBox1 = value; }
//[Browsable(true), EditorBrowsable(EditorBrowsableState.Advanced)]
//[Category("Appearance")]
//public new string Text
//{
// get => textBox1.Text;
// set
// {
// textBox1.Text = value;
// textBox1.SelectionStart = textBox1.Text.Length;
// }
//}
//[Browsable(true)]
//[Category("Appearance")]
//public ComboBox.ObjectCollection Items { get => comboBox1.Items; set => comboBox1.Items = value; }
[Browsable(true), EditorBrowsable(EditorBrowsableState.Advanced)]
[Category("Appearance")]
public TButton SubmitButton { get; set; } = null;
[Browsable(false), EditorBrowsable(EditorBrowsableState.Never)]
public new Padding Margin { get => base.Margin; set => base.Margin = value; }
protected override void updateBackground(Graphics g, ThemeStyle style)
{
int b = (styleActive.BorderWidth + 1) + styleActive.BorderPadding;
this.Padding = new Padding((b + textboxPadding.Left), (b + textboxPadding.Top), ((b - 1) + textboxPadding.Right), ((b - 1) + textboxPadding.Bottom));
Rectangoid area = new Rectangoid(this.ClientRectangle, style.BorderRadius, style.BorderWidth);
g.FillPath(new SolidBrush(style.BackColour), area.ToGraphicsPath());
g.DrawPath(new Pen(new SolidBrush(style.BorderColour), style.BorderWidth), area.ToGraphicsPath());
}
}
}

View File

@ -0,0 +1,59 @@
namespace RyzStudio.Windows.ThemedForms
{
partial class TPickerBox
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Component Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.comboBox1 = new System.Windows.Forms.ComboBox();
this.SuspendLayout();
//
// comboBox1
//
this.comboBox1.Dock = System.Windows.Forms.DockStyle.Fill;
this.comboBox1.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.comboBox1.FormattingEnabled = true;
this.comboBox1.Location = new System.Drawing.Point(4, 4);
this.comboBox1.Name = "comboBox1";
this.comboBox1.Size = new System.Drawing.Size(121, 21);
this.comboBox1.TabIndex = 0;
//
// PickerBox
//
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None;
this.Controls.Add(this.comboBox1);
this.Name = "PickerBox";
this.Padding = new System.Windows.Forms.Padding(4, 4, 3, 3);
this.Size = new System.Drawing.Size(128, 32);
this.ResumeLayout(false);
}
#endregion
private System.Windows.Forms.ComboBox comboBox1;
}
}

View File

@ -0,0 +1,120 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>

View File

@ -0,0 +1,17 @@
namespace RyzStudio.Windows.ThemedForms
{
public class TYesNoPickerBox : TPickerBox
{
public TYesNoPickerBox() : base()
{
this.ComboBox.Items.Clear();
this.ComboBox.Items.AddRange(new string[] { "No", "Yes" });
if (this.ComboBox.Items.Count > 0) this.ComboBox.SelectedIndex = 0;
}
public bool Value { get => (this.ComboBox.SelectedIndex == 1); set =>this.ComboBox.SelectedIndex = (value ? 1 : 0); }
}
}

View File

@ -0,0 +1,170 @@
namespace RyzStudio.Windows.ThemedForms
{
using System;
using System.ComponentModel;
using System.Drawing;
using System.Windows.Forms;
public partial class TButton : RyzStudio.Windows.ThemedForms.TUserControl
{
public class ButtonStyle
{
public Color BackColour { get; set; } = Color.Transparent;
public Color PenColour { get; set; } = Color.Transparent;
public Image ForeImage { get; set; } = null;
}
public enum ButtonState
{
Idle = 0,
Hover,
Down
}
protected ButtonState controlState = ButtonState.Idle;
protected bool isSelected = false;
public TButton() : base()
{
InitializeComponent();
this.Margin = new Padding(10);
this.StyleDefault = new ButtonStyle()
{
BackColour = Color.White,
PenColour = Color.Black,
ForeImage = this.DefaultImage
};
this.StyleDown = new ButtonStyle()
{
BackColour = Color.FromArgb(60, 53, 148),
PenColour = Color.White,
ForeImage = this.DownImage
};
this.StyleOver = new ButtonStyle()
{
BackColour = Color.FromArgb(108, 101, 196),
PenColour = Color.White,
ForeImage = this.OverImage
};
this.StyleSelected = new ButtonStyle()
{
BackColour = Color.FromArgb(51, 51, 51),
PenColour = Color.White,
ForeImage = this.OverImage
};
label1.ImageAlign = ContentAlignment.MiddleCenter;
label1.Click += delegate { this.OnClick(null); };
label1.MouseEnter += delegate { this.VisualState = ButtonState.Hover; };
label1.MouseLeave += delegate { this.VisualState = ButtonState.Idle; };
label1.MouseDown += delegate { this.VisualState = ButtonState.Down; };
label1.MouseUp += delegate { this.VisualState = ButtonState.Idle; };
}
protected override void OnLoad(EventArgs e)
{
base.OnLoad(e);
this.VisualState = ButtonState.Idle;
}
[Browsable(false), EditorBrowsable(EditorBrowsableState.Never)]
public new Padding Margin { get => base.Margin; set => base.Margin = value; }
[Browsable(false), EditorBrowsable(EditorBrowsableState.Never)]
public new Padding Padding { get => base.Padding; set => base.Padding = value; }
protected ButtonState VisualState
{
get { return controlState; }
set
{
switch (value)
{
case ButtonState.Idle:
if (this.VisualState == ButtonState.Down)
{
updateButton(StyleOver);
}
else
{
if (this.IsSelected)
{
updateButton(StyleSelected);
}
else
{
updateButton(StyleDefault);
}
}
break;
case ButtonState.Hover:
updateButton(StyleOver);
break;
case ButtonState.Down:
updateButton(StyleDown);
break;
default:
if (this.IsSelected)
{
updateButton(StyleSelected);
}
else
{
updateButton(StyleDefault);
}
break;
}
controlState = value;
}
}
protected void updateButton(ButtonStyle style)
{
label1.ForeColor = style.PenColour;
label1.BackColor = style.BackColour;
label1.Image = style.ForeImage;
}
[Browsable(true)]
[Category("Appearance")]
public string LabelText { get => label1.Text; set => label1.Text = value; }
[Browsable(true)]
[Category("Appearance")]
public Image OverImage { get; set; } = null;
[Browsable(true)]
[Category("Appearance")]
public Image DownImage { get; set; } = null;
[Browsable(true)]
[Category("Appearance")]
public Image DefaultImage { get; set; } = null;
public bool IsSelected
{
get => isSelected;
set
{
isSelected = value;
this.VisualState = this.VisualState;
}
}
protected ButtonStyle StyleOver { get; set; } = new ButtonStyle();
protected ButtonStyle StyleDown { get; set; } = new ButtonStyle();
protected ButtonStyle StyleDefault { get; set; } = new ButtonStyle();
protected ButtonStyle StyleSelected { get; set; } = new ButtonStyle();
public void PerformClick() => this.OnClick(null);
}
}

View File

@ -0,0 +1,61 @@
namespace RyzStudio.Windows.ThemedForms
{
partial class TButton
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Component Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.label1 = new System.Windows.Forms.Label();
this.SuspendLayout();
//
// label1
//
this.label1.Dock = System.Windows.Forms.DockStyle.Fill;
this.label1.Location = new System.Drawing.Point(4, 4);
this.label1.Margin = new System.Windows.Forms.Padding(0);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(121, 25);
this.label1.TabIndex = 0;
this.label1.Text = "label1";
this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
//
// Button
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.Controls.Add(this.label1);
this.Name = "Button";
this.Padding = new System.Windows.Forms.Padding(4, 4, 3, 3);
this.Size = new System.Drawing.Size(128, 32);
this.ResumeLayout(false);
}
#endregion
private System.Windows.Forms.Label label1;
}
}

View File

@ -0,0 +1,120 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>

View File

@ -0,0 +1,47 @@
namespace RyzStudio.Windows.ThemedForms
{
partial class TDialogForm
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.SuspendLayout();
//
// TDialogForm
//
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None;
this.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(248)))), ((int)(((byte)(249)))), ((int)(((byte)(250)))));
this.ClientSize = new System.Drawing.Size(340, 600);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
this.MinimumSize = new System.Drawing.Size(40, 0);
this.Name = "TDialogForm";
this.ResumeLayout(false);
}
#endregion
}
}

View File

@ -0,0 +1,117 @@
using System.ComponentModel;
using System.Drawing;
using System.Windows.Forms;
namespace RyzStudio.Windows.ThemedForms
{
public partial class TDialogForm : Form
{
public TDialogForm()
{
this.InitializeComponent();
this.BackColor = Color.FromArgb(254, 254, 254);
this.FormBorderStyle = FormBorderStyle.Sizable;
this.MaximizeBox = false;
this.MinimizeBox = false;
this.Padding = new Padding(5, 10, 5, 10);
this.ShowIcon = false;
this.ShowInTaskbar = false;
this.StartPosition = FormStartPosition.WindowsDefaultLocation;
this.TopMost = true;
this.SizeGripStyle = SizeGripStyle.Hide;
this.AutoScaleMode = AutoScaleMode.None;
}
[Browsable(false), EditorBrowsable(EditorBrowsableState.Never)]
public override Color BackColor { get => base.BackColor; set => base.BackColor = value; }
[Browsable(false)]
public override Image BackgroundImage { get => base.BackgroundImage; set => base.BackgroundImage = value; }
[Browsable(false)]
public override ImageLayout BackgroundImageLayout { get => base.BackgroundImageLayout; set => base.BackgroundImageLayout = value; }
[Browsable(false), EditorBrowsable(EditorBrowsableState.Never)]
public new FormBorderStyle FormBorderStyle { get => base.FormBorderStyle; set => base.FormBorderStyle = value; }
//[Browsable(false), EditorBrowsable(EditorBrowsableState.Never)]
//public override Size MaximumSize { get => base.MaximumSize; set => base.MaximumSize = value; }
//[Browsable(false), EditorBrowsable(EditorBrowsableState.Never)]
//public override Size MinimumSize { get => base.MinimumSize; set => base.MinimumSize = value; }
[Browsable(false), EditorBrowsable(EditorBrowsableState.Never)]
public new Padding Padding { get => base.Padding; set => base.Padding = value; }
[Browsable(false), EditorBrowsable(EditorBrowsableState.Never)]
public new bool ShowIcon { get => base.ShowIcon; set => base.ShowIcon = value; }
[Browsable(false), EditorBrowsable(EditorBrowsableState.Never)]
public new bool ShowInTaskbar { get => base.ShowInTaskbar; set => base.ShowInTaskbar = value; }
[Browsable(false), EditorBrowsable(EditorBrowsableState.Never)]
public new FormStartPosition StartPosition { get => base.StartPosition; set => base.StartPosition = value; }
[Browsable(false), EditorBrowsable(EditorBrowsableState.Never)]
public new bool TopMost { get => base.TopMost; set => base.TopMost = value; }
[Browsable(false), EditorBrowsable(EditorBrowsableState.Never)]
public override Cursor Cursor { get => base.Cursor; set => base.Cursor = value; }
[Browsable(false), EditorBrowsable(EditorBrowsableState.Never)]
public override RightToLeft RightToLeft { get => base.RightToLeft; set => base.RightToLeft = value; }
[Browsable(false), EditorBrowsable(EditorBrowsableState.Never)]
public override bool RightToLeftLayout { get => base.RightToLeftLayout; set => base.RightToLeftLayout = value; }
[Browsable(false), EditorBrowsable(EditorBrowsableState.Never)]
public new bool UseWaitCursor { get => base.UseWaitCursor; set => base.UseWaitCursor = value; }
[Browsable(false), EditorBrowsable(EditorBrowsableState.Never)]
public new ImeMode ImeMode { get => base.ImeMode; set => base.ImeMode = value; }
[Browsable(false), EditorBrowsable(EditorBrowsableState.Never)]
public override bool AutoSize { get => base.AutoSize; set => base.AutoSize = value; }
[Browsable(false), EditorBrowsable(EditorBrowsableState.Never)]
public new AutoSizeMode AutoSizeMode { get => base.AutoSizeMode; set => base.AutoSizeMode = value; }
[Browsable(false), EditorBrowsable(EditorBrowsableState.Never)]
public new bool MinimizeBox { get => base.MinimizeBox; set => base.MinimizeBox = value; }
[Browsable(false), EditorBrowsable(EditorBrowsableState.Never)]
public new bool MaximizeBox { get => base.MaximizeBox; set => base.MaximizeBox = value; }
[Browsable(false), EditorBrowsable(EditorBrowsableState.Never)]
public new bool ControlBox { get => base.ControlBox; set => base.ControlBox = value; }
[Browsable(false), EditorBrowsable(EditorBrowsableState.Never)]
public new bool HelpButton { get => base.HelpButton; set => base.HelpButton = value; }
[Browsable(false), EditorBrowsable(EditorBrowsableState.Never)]
public new MenuStrip MainMenuStrip { get => base.MainMenuStrip; set => base.MainMenuStrip = value; }
[Browsable(false), EditorBrowsable(EditorBrowsableState.Never)]
public new SizeGripStyle SizeGripStyle { get => base.SizeGripStyle; set => base.SizeGripStyle = value; }
[Browsable(false), EditorBrowsable(EditorBrowsableState.Never)]
public new AutoScaleMode AutoScaleMode { get => base.AutoScaleMode; set => base.AutoScaleMode = value; }
[Browsable(false), EditorBrowsable(EditorBrowsableState.Never)]
public new bool AutoScroll { get => base.AutoScroll; set => base.AutoScroll = value; }
[Browsable(false), EditorBrowsable(EditorBrowsableState.Never)]
public new Size AutoScrollMargin { get => base.AutoScrollMargin; set => base.AutoScrollMargin = value; }
[Browsable(false), EditorBrowsable(EditorBrowsableState.Never)]
public new Size AutoScrollMinSize { get => base.AutoScrollMinSize; set => base.AutoScrollMinSize = value; }
[Browsable(false), EditorBrowsable(EditorBrowsableState.Never)]
public new Point AutoScrollOffset { get => base.AutoScrollOffset; set => base.AutoScrollOffset = value; }
[Browsable(false), EditorBrowsable(EditorBrowsableState.Never)]
public new FormWindowState WindowState { get => base.WindowState; set => base.WindowState = value; }
}
}

Some files were not shown because too many files have changed in this diff Show More