diff --git a/ColorManager/App.xaml b/ColorManager/App.xaml
new file mode 100644
index 0000000..553a1fc
--- /dev/null
+++ b/ColorManager/App.xaml
@@ -0,0 +1,7 @@
+
+
+
+
+
diff --git a/ColorManager/App.xaml.cs b/ColorManager/App.xaml.cs
new file mode 100644
index 0000000..ba218cb
--- /dev/null
+++ b/ColorManager/App.xaml.cs
@@ -0,0 +1,23 @@
+using Avalonia;
+using Avalonia.Controls.ApplicationLifetimes;
+using Avalonia.Markup.Xaml;
+
+namespace ColorManager;
+
+public partial class App : Application
+{
+ public override void Initialize()
+ {
+ AvaloniaXamlLoader.Load(this);
+ }
+
+ public override void OnFrameworkInitializationCompleted()
+ {
+ if (ApplicationLifetime is IClassicDesktopStyleApplicationLifetime desktop)
+ {
+ desktop.MainWindow = new MainWindow();
+ }
+
+ base.OnFrameworkInitializationCompleted();
+ }
+}
diff --git a/ColorManager/ColorManager.csproj b/ColorManager/ColorManager.csproj
index 54c778e..841b3a8 100644
--- a/ColorManager/ColorManager.csproj
+++ b/ColorManager/ColorManager.csproj
@@ -1,31 +1,38 @@
- Exe
net8.0
- disable
- disable
+ Exe
+ enable
+ enable
ColorManager
ColorManager
false
+
+ win-x64;linux-x64
+
+ true
-
+
+
+
+
+
+
-
- gui.stetic
+
+ colors.xml
-
-
+
-
- PreserveNewest
-
+
+
\ No newline at end of file
diff --git a/ColorManager/Main.cs b/ColorManager/Main.cs
index 18796c3..83b54b2 100644
--- a/ColorManager/Main.cs
+++ b/ColorManager/Main.cs
@@ -1,17 +1,17 @@
-using System;
-using Gtk;
+using Avalonia;
-namespace ColorManager
+namespace ColorManager;
+
+public static class Program
{
- class MainClass
+ [STAThread]
+ public static void Main(string[] args)
{
- public static void Main (string[] args)
- {
- Application.Init ();
- //MainWindow win = new MainWindow ();
- MyForm win = new MyForm ();
- win.Show ();
- Application.Run ();
- }
+ BuildAvaloniaApp().StartWithClassicDesktopLifetime(args);
}
-}
\ No newline at end of file
+
+ public static AppBuilder BuildAvaloniaApp() =>
+ AppBuilder.Configure()
+ .UsePlatformDetect()
+ .LogToTrace();
+}
diff --git a/ColorManager/MainViewModel.cs b/ColorManager/MainViewModel.cs
new file mode 100644
index 0000000..b19ac16
--- /dev/null
+++ b/ColorManager/MainViewModel.cs
@@ -0,0 +1,186 @@
+using System;
+using System.Collections.ObjectModel;
+using System.Diagnostics;
+using System.Xml.Linq;
+using CommunityToolkit.Mvvm.ComponentModel;
+using CommunityToolkit.Mvvm.Input;
+
+
+namespace ColorManager
+{
+ public partial class MainViewModel : ObservableObject
+ {
+ private PaletteManager paletteManager;
+
+ [ObservableProperty]
+ private ObservableCollection palettes = new();
+
+ [ObservableProperty]
+ private string selectedPalette = string.Empty;
+
+ [ObservableProperty]
+ private ObservableCollection colors = new();
+
+ [ObservableProperty]
+ private string newPaletteName = string.Empty;
+
+ public MainViewModel()
+ {
+ try
+ {
+ paletteManager = new PaletteManager();
+ LoadPalettesCommand.Execute(null);
+ }
+ catch (Exception ex)
+ {
+ Debug.WriteLine($"Error initializing MainViewModel: {ex.Message}");
+ }
+ }
+
+ [RelayCommand]
+ private void LoadPalettes()
+ {
+ try
+ {
+ Palettes.Clear();
+ var paletteList = paletteManager.GetList();
+ foreach (var palette in paletteList)
+ {
+ Palettes.Add(palette);
+ }
+
+ if (Palettes.Count > 0 && string.IsNullOrEmpty(SelectedPalette))
+ {
+ SelectedPalette = Palettes[0];
+ }
+ }
+ catch (Exception ex)
+ {
+ Debug.WriteLine($"Error loading palettes: {ex.Message}");
+ }
+ }
+
+ partial void OnSelectedPaletteChanged(string value)
+ {
+ if (value != null)
+ {
+ LoadColors(value);
+ }
+ }
+
+ private void LoadColors(string paletteName)
+ {
+ try
+ {
+ Colors.Clear();
+ var colorElements = paletteManager.GetPalette(paletteName);
+ foreach (var element in colorElements)
+ {
+ var colorList = element.Elements("Color");
+ foreach (var colorElement in colorList)
+ {
+ var hexAttr = colorElement.Attribute("hex");
+ if (hexAttr != null)
+ {
+ var myColor = new MyColor { Hex = hexAttr.Value };
+ Colors.Add(myColor);
+ }
+ }
+ }
+ }
+ catch (Exception ex)
+ {
+ Debug.WriteLine($"Error loading colors: {ex.Message}");
+ }
+ }
+
+ [RelayCommand]
+ private void CreatePalette()
+ {
+ if (string.IsNullOrWhiteSpace(NewPaletteName))
+ {
+ Debug.WriteLine("Palette name cannot be empty");
+ return;
+ }
+
+ try
+ {
+ paletteManager.CreatePalette(NewPaletteName);
+ NewPaletteName = string.Empty;
+ LoadPalettesCommand.Execute(null);
+ }
+ catch (Exception ex)
+ {
+ Debug.WriteLine($"Error creating palette: {ex.Message}");
+ }
+ }
+
+ [RelayCommand]
+ private void DeletePalette()
+ {
+ if (string.IsNullOrWhiteSpace(SelectedPalette))
+ {
+ Debug.WriteLine("No palette selected");
+ return;
+ }
+
+ try
+ {
+ paletteManager.DeletePalette(SelectedPalette);
+ LoadPalettesCommand.Execute(null);
+ }
+ catch (Exception ex)
+ {
+ Debug.WriteLine($"Error deleting palette: {ex.Message}");
+ }
+ }
+
+ [RelayCommand]
+ private void UpdateColor(MyColor color)
+ {
+ if (color == null)
+ return;
+
+ int index = Colors.IndexOf(color);
+ if (index >= 0)
+ {
+ // Color updated via binding
+ SaveColorsInternal();
+ }
+ }
+
+ public void SaveColorsInternal()
+ {
+ try
+ {
+ if (SelectedPalette == null)
+ return;
+
+ var paletteElement = paletteManager.GetPalette(SelectedPalette).FirstOrDefault();
+ if (paletteElement == null)
+ return;
+
+ // Remove existing colors
+ paletteElement.Elements("Color").Remove();
+
+ // Add updated colors
+ foreach (var color in Colors)
+ {
+ paletteElement.Add(new XElement("Color", new XAttribute("hex", color.Hex)));
+ }
+
+ paletteManager.save();
+ }
+ catch (Exception ex)
+ {
+ Debug.WriteLine($"Error saving colors: {ex.Message}");
+ }
+ }
+
+ [RelayCommand]
+ private void SaveColors()
+ {
+ SaveColorsInternal();
+ }
+ }
+}
diff --git a/ColorManager/MainWindow.cs b/ColorManager/MainWindow.cs
deleted file mode 100644
index f2b7c1a..0000000
--- a/ColorManager/MainWindow.cs
+++ /dev/null
@@ -1,1558 +0,0 @@
-using System;
-using Gtk;
-using System.Xml;
-using System.Globalization;
-using System.IO;
-using System.Xml.XPath;
-using System.Xml.Linq;
-
-public partial class MainWindow : Gtk.Window
-{
- public MainWindow () : base(Gtk.WindowType.Toplevel)
- {
- Build ();
- FormLoad ();
- }
- protected void FormLoad ()
- {
- //comboboxentry1.Clear();
- XmlDocument xdoc = new XmlDocument ();
- xdoc.Load ("colors.xml");
-
- XmlElement root = xdoc.DocumentElement;
- foreach (XmlNode child in root.ChildNodes) {
- comboboxentry1.AppendText (child.Attributes["name"].Value);
- }
- comboboxentry1.Active = 0;
- }
-
- protected void OnDeleteEvent (object sender, DeleteEventArgs a)
- {
- Application.Quit ();
- a.RetVal = true;
- }
- #region -------------------------HboxEnableDisable---------------------------
- protected virtual void OnBtnNewClicked (object sender, System.EventArgs e)
- {
- hbox2.Visible = true;
- btnUpdate.Visible = false;
- entry1.Text = " ";
- }
- protected virtual void OnBtnCancleClicked (object sender, System.EventArgs e)
- {
- hbox2.Visible = false;
- }
- #endregion
- protected virtual void add_Click (object sender, System.EventArgs e)
- {
-
- if (entry1.Text == comboboxentry1.ActiveText) {
- int i = comboboxentry1.Active;
- comboboxentry1.InsertText (i, entry1.Text.Trim ());
- } else {
- string a = entry1.Text;
- comboboxentry1.AppendText (a);
- }
- //comboboxentry1.te
- hbox2.Visible = false;
- }
-
- protected virtual void btnUpdateClick (object sender, System.EventArgs e)
- {
- if (entry1.Text == comboboxentry1.ActiveText) {
- int i = comboboxentry1.Active;
- comboboxentry1.InsertText (i, entry1.Text);
- } else {
- string a = entry1.Text;
- comboboxentry1.AppendText (a);
- }
-
- hbox2.Visible = false;
- }
-
- protected virtual void onBtnEditClicked (object sender, System.EventArgs e)
- {
- hbox2.Visible = true;
- entry1.Text = comboboxentry1.ActiveText;
- int j = comboboxentry1.Active;
- comboboxentry1.Remove (j);
- btnUpdate.Visible = true;
-
- }
- /* string s = comboboxentry1.ActiveText;
- string t= s.Trim();
-
- //code for delete
- FileStream fs = new FileStream("colors.xml",FileMode.Open,FileAccess.Read,FileShare.ReadWrite);
- XmlDocument xmldoc = new XmlDocument();
- xmldoc.Load(fs);
- XmlElement root =xmldoc.DocumentElement;
-
- XmlNode rmNode= root.SelectSingleNode("Palette[@name='"+t+"']") ;
- root.RemoveChild(rmNode);
- FileStream fsxml = new FileStream("colors.xml",FileMode.Truncate,FileAccess.Write,FileShare.ReadWrite);
- xmldoc.Save(fsxml);
-
- int i = comboboxentry1.Active;
- comboboxentry1.Remove(i);*/
- protected virtual void onBtnDeleteClicked (object sender, System.EventArgs e)
- {
- string s = comboboxentry1.ActiveText;
- string t = s.Trim ();
-
- FileStream fs = new FileStream ("colors.xml", FileMode.Open, FileAccess.Read, FileShare.ReadWrite);
- XmlDocument xmldoc = new XmlDocument ();
- xmldoc.Load (fs);
- XmlElement root = xmldoc.DocumentElement;
-
- XmlNode rmNode = root.SelectSingleNode ("Palette[@name='" + t + "']");
- root.RemoveChild (rmNode);
- FileStream fsxml = new FileStream ("colors.xml", FileMode.Truncate, FileAccess.Write, FileShare.ReadWrite);
- xmldoc.Save (fsxml);
-
- int i = comboboxentry1.Active;
- comboboxentry1.Remove (i);
-
- }
-
- protected virtual void OnCbtnClick (object sender, System.EventArgs e)
- {
- }
-
- protected virtual void OnColorbutton1ColorSet (object sender, System.EventArgs e)
- {
- //Red
- double a = colorbutton1.Color.Red;
- int mod1 = Convert.ToInt32 (a / 257);
-
- string red = mod1.ToString ();
- string l1 = Convert.ToString (mod1, 16).ToUpper ();
- string hax1;
-
- if (l1.Length <= 1)
-
- hax1 = string.Concat ("0", l1);
- else
- hax1 = l1;
- //Green
- double b = colorbutton1.Color.Green;
- int mod2 = Convert.ToInt32 (b / 257);
-
- string green = mod2.ToString ();
- string l2 = Convert.ToString (mod2, 16).ToUpper ();
- string hax2;
-
- if (l2.Length <= 1)
-
- hax2 = string.Concat ("0", l2);
- else
- hax2 = l2;
- //blue
- double c = colorbutton1.Color.Blue;
- int mod3 = Convert.ToInt32 (c / 257);
-
- string blue = mod3.ToString ();
- string l3 = Convert.ToString (mod3, 16).ToUpper ();
- string hax3;
- if (l3.Length <= 1)
-
- hax3 = string.Concat ("0", l3);
- else
- hax3 = l3;
-
- string XCode = string.Concat ("#", hax1, hax2, hax3);
- entry4.Text = XCode;
-
- string Code = string.Concat (red, green, blue);
- entry2.Text = Code;
- //label1.Text = Code;
-
-
- //code to write data into xml file
- FileStream fs = new FileStream ("colors.xml", FileMode.Open, FileAccess.Read, FileShare.ReadWrite);
- XmlDocument xmldoc = new XmlDocument ();
- xmldoc.Load (fs);
-
- XmlElement newpalette = xmldoc.CreateElement ("Palette");
- XmlAttribute newpname = xmldoc.CreateAttribute ("name");
- newpname.Value = entry1.Text.Trim ();
- newpalette.SetAttributeNode (newpname);
-
- XmlElement firstelement = xmldoc.CreateElement ("Color");
- XmlAttribute newcname = xmldoc.CreateAttribute ("COLOR");
-
- newcname.Value = entry4.Text;
- firstelement.SetAttributeNode (newcname);
- newpalette.AppendChild (firstelement);
-
- xmldoc.DocumentElement.InsertAfter (newpalette, xmldoc.DocumentElement.LastChild);
- FileStream fsxml = new FileStream ("colors.xml", FileMode.Truncate, FileAccess.Write, FileShare.ReadWrite);
- xmldoc.Save (fsxml);
- }
-
- protected virtual void OnColorbutton2ColorSet (object sender, System.EventArgs e)
- {
- //Red
- double a = colorbutton2.Color.Red;
- int mod1 = Convert.ToInt32 (a / 257);
-
- string red = mod1.ToString ();
- string l1 = Convert.ToString (mod1, 16).ToUpper ();
- string hax1;
-
- if (l1.Length <= 1)
-
- hax1 = string.Concat ("0", l1);
- else
- hax1 = l1;
- //Green
- double b = colorbutton2.Color.Green;
- int mod2 = Convert.ToInt32 (b / 257);
-
- string green = mod2.ToString ();
-
- string l2 = Convert.ToString (mod2, 16).ToUpper ();
- string hax2;
-
- if (l2.Length <= 1)
-
- hax2 = string.Concat ("0", l2);
- else
- hax2 = l2;
-
- //blue
- double c = colorbutton2.Color.Blue;
- int mod3 = Convert.ToInt32 (c / 257);
-
- string blue = mod3.ToString ();
-
- string l3 = Convert.ToString (mod3, 16).ToUpper ();
- string hax3;
- if (l3.Length <= 1)
-
- hax3 = string.Concat ("0", l3);
- else
- hax3 = l3;
-
- string XCode = string.Concat ("#", hax1, hax2, hax3);
- entry4.Text = XCode;
-
- string Code = string.Concat (red, green, blue);
- entry2.Text = Code;
- //label1.Text = Code;
-
- //code to write data into xml file
- FileStream fs = new FileStream ("colors.xml", FileMode.Open, FileAccess.Read, FileShare.ReadWrite);
- XmlDocument xmldoc = new XmlDocument ();
- xmldoc.Load (fs);
-
- XmlElement root = xmldoc.DocumentElement;
- foreach (XmlNode child in root.ChildNodes) {
- if (child.Attributes["name"].Value == entry1.Text) {
- XmlElement xmlNewColor = xmldoc.CreateElement ("Color");
- xmlNewColor.SetAttribute ("COLOR", entry4.Text);
- child.AppendChild (xmlNewColor);
- FileStream fsxml = new FileStream ("colors.xml", FileMode.Truncate, FileAccess.Write, FileShare.ReadWrite);
- xmldoc.Save (fsxml);
- }
- }
- }
-
- protected virtual void OnColorbutton3ColorSet (object sender, System.EventArgs e)
- {
- double a = colorbutton3.Color.Red;
- int mod1 = Convert.ToInt32 (a / 257);
-
- string red = mod1.ToString ();
- string l1 = Convert.ToString (mod1, 16).ToUpper ();
- string hax1;
-
- if (l1.Length <= 1)
-
- hax1 = string.Concat ("0", l1);
- else
- hax1 = l1;
- //Green
- double b = colorbutton3.Color.Green;
- int mod2 = Convert.ToInt32 (b / 257);
-
- string green = mod2.ToString ();
-
- string l2 = Convert.ToString (mod2, 16).ToUpper ();
- string hax2;
-
- if (l2.Length <= 1)
-
- hax2 = string.Concat ("0", l2);
- else
- hax2 = l2;
-
- //blue
- double c = colorbutton3.Color.Blue;
- int mod3 = Convert.ToInt32 (c / 257);
-
- string blue = mod3.ToString ();
-
- string l3 = Convert.ToString (mod3, 16).ToUpper ();
- string hax3;
- if (l3.Length <= 1)
-
- hax3 = string.Concat ("0", l3);
- else
- hax3 = l3;
-
- string XCode = string.Concat ("#", hax1, hax2, hax3);
- entry4.Text = XCode;
-
- string Code = string.Concat (red, green, blue);
- entry2.Text = Code;
- // label1.Text = Code;
-
- //code to write data into xml file
-
- FileStream fs = new FileStream ("colors.xml", FileMode.Open, FileAccess.Read, FileShare.ReadWrite);
- XmlDocument xmldoc = new XmlDocument ();
- xmldoc.Load (fs);
-
- XmlElement root = xmldoc.DocumentElement;
- foreach (XmlNode child in root.ChildNodes) {
-
- if (child.Attributes["name"].Value == entry1.Text) {
- XmlElement xmlNewColor = xmldoc.CreateElement ("Color");
- xmlNewColor.SetAttribute ("COLOR", entry4.Text);
- child.AppendChild (xmlNewColor);
- FileStream fsxml = new FileStream ("colors.xml", FileMode.Truncate, FileAccess.Write, FileShare.ReadWrite);
- xmldoc.Save (fsxml);
-
- }
- }
- }
-
-
- protected virtual void OnColorbutton4ColorSet (object sender, System.EventArgs e)
- {
- //Red
- double a = colorbutton4.Color.Red;
- int mod1 = Convert.ToInt32 (a / 257);
-
- string red = mod1.ToString ();
- string l1 = Convert.ToString (mod1, 16).ToUpper ();
- string hax1;
-
- if (l1.Length <= 1)
-
- hax1 = string.Concat ("0", l1);
- else
- hax1 = l1;
- //Green
- double b = colorbutton4.Color.Green;
- int mod2 = Convert.ToInt32 (b / 257);
-
- string green = mod2.ToString ();
- string l2 = Convert.ToString (mod2, 16).ToUpper ();
- string hax2;
-
- if (l2.Length <= 1)
-
- hax2 = string.Concat ("0", l2);
- else
- hax2 = l2;
-
- //blue
- double c = colorbutton4.Color.Blue;
- int mod3 = Convert.ToInt32 (c / 257);
-
- string blue = mod3.ToString ();
- string l3 = Convert.ToString (mod3, 16).ToUpper ();
- string hax3;
- if (l3.Length <= 1)
-
- hax3 = string.Concat ("0", l3);
- else
- hax3 = l3;
-
- string XCode = string.Concat ("#", hax1, hax2, hax3);
- entry4.Text = XCode;
-
- string Code = string.Concat (red, green, blue);
- entry2.Text = Code;
- //label1.Text = Code;
-
- //code to write data into xml file
- FileStream fs = new FileStream ("colors.xml", FileMode.Open, FileAccess.Read, FileShare.ReadWrite);
- XmlDocument xmldoc = new XmlDocument ();
- xmldoc.Load (fs);
-
- XmlElement root = xmldoc.DocumentElement;
- foreach (XmlNode child in root.ChildNodes) {
-
- if (child.Attributes["name"].Value == entry1.Text) {
- XmlElement xmlNewColor = xmldoc.CreateElement ("Color");
- xmlNewColor.SetAttribute ("COLOR", entry4.Text);
- child.AppendChild (xmlNewColor);
- FileStream fsxml = new FileStream ("colors.xml", FileMode.Truncate, FileAccess.Write, FileShare.ReadWrite);
- xmldoc.Save (fsxml);
-
- }
- }
- }
-
- //b5
- protected virtual void OnColorbutton5ColorSet (object sender, System.EventArgs e)
- {
- //Red
- double a = colorbutton5.Color.Red;
- int mod1 = Convert.ToInt32 (a / 257);
-
- string red = mod1.ToString ();
- string l1 = Convert.ToString (mod1, 16).ToUpper ();
- string hax1;
-
- if (l1.Length <= 1)
-
- hax1 = string.Concat ("0", l1);
- else
- hax1 = l1;
- //Green
- double b = colorbutton5.Color.Green;
- int mod2 = Convert.ToInt32 (b / 257);
-
- string green = mod2.ToString ();
- string l2 = Convert.ToString (mod2, 16).ToUpper ();
- string hax2;
-
- if (l2.Length <= 1)
-
- hax2 = string.Concat ("0", l2);
- else
- hax2 = l2;
- //blue
- double c = colorbutton5.Color.Blue;
- int mod3 = Convert.ToInt32 (c / 257);
-
- string blue = mod3.ToString ();
- string l3 = Convert.ToString (mod3, 16).ToUpper ();
- string hax3;
- if (l3.Length <= 1)
-
- hax3 = string.Concat ("0", l3);
- else
- hax3 = l3;
- string XCode = string.Concat ("#", hax1, hax2, hax3);
- entry4.Text = XCode;
-
- string Code = string.Concat (red, green, blue);
- entry2.Text = Code;
- //label1.Text = Code;
- //code to write data into xml file
- FileStream fs = new FileStream ("colors.xml", FileMode.Open, FileAccess.Read, FileShare.ReadWrite);
- XmlDocument xmldoc = new XmlDocument ();
- xmldoc.Load (fs);
-
- XmlElement root = xmldoc.DocumentElement;
- foreach (XmlNode child in root.ChildNodes) {
- if (child.Attributes["name"].Value == entry1.Text) {
- XmlElement xmlNewColor = xmldoc.CreateElement ("Color");
- xmlNewColor.SetAttribute ("COLOR", entry4.Text);
- child.AppendChild (xmlNewColor);
- FileStream fsxml = new FileStream ("colors.xml", FileMode.Truncate, FileAccess.Write, FileShare.ReadWrite);
- xmldoc.Save (fsxml);
- }
- }
- }
- //b6
- protected virtual void OnColorbutton6ColorSet (object sender, System.EventArgs e)
- {
- //Red
- double a = colorbutton6.Color.Red;
- int mod1 = Convert.ToInt32 (a / 257);
-
- string red = mod1.ToString ();
- string l1 = Convert.ToString (mod1, 16).ToUpper ();
- string hax1;
-
- if (l1.Length <= 1)
-
- hax1 = string.Concat ("0", l1);
- else
- hax1 = l1;
- //Green
- double b = colorbutton6.Color.Green;
- int mod2 = Convert.ToInt32 (b / 257);
-
- string green = mod2.ToString ();
-
- string l2 = Convert.ToString (mod2, 16).ToUpper ();
- string hax2;
-
- if (l2.Length <= 1)
-
- hax2 = string.Concat ("0", l2);
- else
- hax2 = l2;
-
- //blue
- double c = colorbutton6.Color.Blue;
- int mod3 = Convert.ToInt32 (c / 257);
-
- string blue = mod3.ToString ();
-
- string l3 = Convert.ToString (mod3, 16).ToUpper ();
- string hax3;
- if (l3.Length <= 1)
-
- hax3 = string.Concat ("0", l3);
- else
- hax3 = l3;
-
-
- string XCode = string.Concat ("#", hax1, hax2, hax3);
- entry4.Text = XCode;
-
- string Code = string.Concat (red, green, blue);
- entry2.Text = Code;
- //label1.Text = Code;
- //code to write data into xml file
-
- FileStream fs = new FileStream ("colors.xml", FileMode.Open, FileAccess.Read, FileShare.ReadWrite);
- XmlDocument xmldoc = new XmlDocument ();
- xmldoc.Load (fs);
-
- XmlElement root = xmldoc.DocumentElement;
- foreach (XmlNode child in root.ChildNodes) {
-
- if (child.Attributes["name"].Value == entry1.Text) {
- XmlElement xmlNewColor = xmldoc.CreateElement ("Color");
- xmlNewColor.SetAttribute ("COLOR", entry4.Text);
- child.AppendChild (xmlNewColor);
- FileStream fsxml = new FileStream ("colors.xml", FileMode.Truncate, FileAccess.Write, FileShare.ReadWrite);
- xmldoc.Save (fsxml);
-
- }
- }
- }
- //b7
- protected virtual void OnColorbutton7ColorSet (object sender, System.EventArgs e)
- {
- //Red
- double a = colorbutton7.Color.Red;
- int mod1 = Convert.ToInt32 (a / 257);
-
- string red = mod1.ToString ();
- string l1 = Convert.ToString (mod1, 16).ToUpper ();
- string hax1;
- if (l1.Length <= 1)
-
- hax1 = string.Concat ("0", l1);
- else
- hax1 = l1;
- //Green
- double b = colorbutton7.Color.Green;
- int mod2 = Convert.ToInt32 (b / 257);
-
- string green = mod2.ToString ();
- string l2 = Convert.ToString (mod2, 16).ToUpper ();
- string hax2;
- if (l2.Length <= 1)
-
- hax2 = string.Concat ("0", l2);
- else
- hax2 = l2;
- //blue
- double c = colorbutton7.Color.Blue;
- int mod3 = Convert.ToInt32 (c / 257);
-
- string blue = mod3.ToString ();
- string l3 = Convert.ToString (mod3, 16).ToUpper ();
- string hax3;
- if (l3.Length <= 1)
-
- hax3 = string.Concat ("0", l3);
- else
- hax3 = l3;
-
-
- string XCode = string.Concat ("#", hax1, hax2, hax3);
- entry4.Text = XCode;
-
- string Code = string.Concat (red, green, blue);
- entry2.Text = Code;
- //label1.Text = Code;
- //code to write data into xml file
-
- FileStream fs = new FileStream ("colors.xml", FileMode.Open, FileAccess.Read, FileShare.ReadWrite);
- XmlDocument xmldoc = new XmlDocument ();
- xmldoc.Load (fs);
-
- XmlElement root = xmldoc.DocumentElement;
- foreach (XmlNode child in root.ChildNodes) {
-
- if (child.Attributes["name"].Value == entry1.Text) {
- XmlElement xmlNewColor = xmldoc.CreateElement ("Color");
- xmlNewColor.SetAttribute ("COLOR", entry4.Text);
- child.AppendChild (xmlNewColor);
- FileStream fsxml = new FileStream ("colors.xml", FileMode.Truncate, FileAccess.Write, FileShare.ReadWrite);
- xmldoc.Save (fsxml);
- }
- }
- }
- //b8
- protected virtual void OnColorbutton8ColorSet (object sender, System.EventArgs e)
- {
- //Red
- double a = colorbutton8.Color.Red;
- int mod1 = Convert.ToInt32 (a / 257);
-
- string red = mod1.ToString ();
- string l1 = Convert.ToString (mod1, 16).ToUpper ();
- string hax1;
-
- if (l1.Length <= 1)
- hax1 = string.Concat ("0", l1);
- else
- hax1 = l1;
- //Green
- double b = colorbutton8.Color.Green;
- int mod2 = Convert.ToInt32 (b / 257);
-
- string green = mod2.ToString ();
- string l2 = Convert.ToString (mod2, 16).ToUpper ();
- string hax2;
-
- if (l2.Length <= 1)
-
- hax2 = string.Concat ("0", l2);
- else
- hax2 = l2;
- //blue
- //string bl = colorbutton1.Color.Blue.ToString();
- double c = colorbutton8.Color.Blue;
- int mod3 = Convert.ToInt32 (c / 257);
-
- string blue = mod3.ToString ();
- string l3 = Convert.ToString (mod3, 16).ToUpper ();
- string hax3;
- if (l3.Length <= 1)
-
- hax3 = string.Concat ("0", l3);
- else
- hax3 = l3;
-
-
- string XCode = string.Concat ("#", hax1, hax2, hax3);
- entry4.Text = XCode;
-
- string Code = string.Concat (red, green, blue);
- entry2.Text = Code;
-
- //code to write data into xml file
-
- FileStream fs = new FileStream ("colors.xml", FileMode.Open, FileAccess.Read, FileShare.ReadWrite);
- XmlDocument xmldoc = new XmlDocument ();
- xmldoc.Load (fs);
-
- XmlElement root = xmldoc.DocumentElement;
- foreach (XmlNode child in root.ChildNodes) {
-
- if (child.Attributes["name"].Value == entry1.Text) {
- XmlElement xmlNewColor = xmldoc.CreateElement ("Color");
- xmlNewColor.SetAttribute ("COLOR", entry4.Text);
- child.AppendChild (xmlNewColor);
- FileStream fsxml = new FileStream ("colors.xml", FileMode.Truncate, FileAccess.Write, FileShare.ReadWrite);
- xmldoc.Save (fsxml);
-
- }
- }
- }
- //b9
- protected virtual void OnColorbutton9ColorSet (object sender, System.EventArgs e)
- {
- //Red
- double a = colorbutton9.Color.Red;
- int mod1 = Convert.ToInt32 (a / 257);
-
- string red = mod1.ToString ();
- string l1 = Convert.ToString (mod1, 16).ToUpper ();
- string hax1;
-
- if (l1.Length <= 1)
-
- hax1 = string.Concat ("0", l1);
- else
- hax1 = l1;
- //Green
- double b = colorbutton9.Color.Green;
- int mod2 = Convert.ToInt32 (b / 257);
-
- string green = mod2.ToString ();
- string l2 = Convert.ToString (mod2, 16).ToUpper ();
- string hax2;
-
- if (l2.Length <= 1)
-
- hax2 = string.Concat ("0", l2);
- else
- hax2 = l2;
-
- //blue
- double c = colorbutton9.Color.Blue;
- int mod3 = Convert.ToInt32 (c / 257);
-
- string blue = mod3.ToString ();
- string l3 = Convert.ToString (mod3, 16).ToUpper ();
- string hax3;
- if (l3.Length <= 1)
-
- hax3 = string.Concat ("0", l3);
- else
- hax3 = l3;
-
- string XCode = string.Concat ("#", hax1, hax2, hax3);
- entry4.Text = XCode;
-
- string Code = string.Concat (red, green, blue);
- entry2.Text = Code;
-
- //code to write data into xml file
-
- FileStream fs = new FileStream ("colors.xml", FileMode.Open, FileAccess.Read, FileShare.ReadWrite);
- XmlDocument xmldoc = new XmlDocument ();
- xmldoc.Load (fs);
-
- XmlElement root = xmldoc.DocumentElement;
- foreach (XmlNode child in root.ChildNodes) {
-
- if (child.Attributes["name"].Value == entry1.Text) {
- XmlElement xmlNewColor = xmldoc.CreateElement ("Color");
- xmlNewColor.SetAttribute ("COLOR", entry4.Text);
- child.AppendChild (xmlNewColor);
- FileStream fsxml = new FileStream ("colors.xml", FileMode.Truncate, FileAccess.Write, FileShare.ReadWrite);
- xmldoc.Save (fsxml);
-
- }
- }
- }
- //b10
- protected virtual void OnColorbutton10ColorSet (object sender, System.EventArgs e)
- {
- //Red
- double a = colorbutton10.Color.Red;
- int mod1 = Convert.ToInt32 (a / 257);
-
- string red = mod1.ToString ();
- string l1 = Convert.ToString (mod1, 16).ToUpper ();
- string hax1;
-
- if (l1.Length <= 1)
-
- hax1 = string.Concat ("0", l1);
- else
- hax1 = l1;
- //Green
- double b = colorbutton10.Color.Green;
- int mod2 = Convert.ToInt32 (b / 257);
-
- string green = mod2.ToString ();
- string l2 = Convert.ToString (mod2, 16).ToUpper ();
- string hax2;
-
- if (l2.Length <= 1)
-
- hax2 = string.Concat ("0", l2);
- else
- hax2 = l2;
- //blue
- double c = colorbutton10.Color.Blue;
- int mod3 = Convert.ToInt32 (c / 257);
-
- string blue = mod3.ToString ();
- string l3 = Convert.ToString (mod3, 16).ToUpper ();
- string hax3;
- if (l3.Length <= 1)
-
- hax3 = string.Concat ("0", l3);
- else
- hax3 = l3;
-
- string XCode = string.Concat ("#", hax1, hax2, hax3);
- entry4.Text = XCode;
-
- string Code = string.Concat (red, green, blue);
- entry2.Text = Code;
-
- //code to write data into xml file
-
- FileStream fs = new FileStream ("colors.xml", FileMode.Open, FileAccess.Read, FileShare.ReadWrite);
- XmlDocument xmldoc = new XmlDocument ();
- xmldoc.Load (fs);
-
- XmlElement root = xmldoc.DocumentElement;
- foreach (XmlNode child in root.ChildNodes) {
-
- if (child.Attributes["name"].Value == entry1.Text) {
- XmlElement xmlNewColor = xmldoc.CreateElement ("Color");
- xmlNewColor.SetAttribute ("COLOR", entry4.Text);
- child.AppendChild (xmlNewColor);
- FileStream fsxml = new FileStream ("colors.xml", FileMode.Truncate, FileAccess.Write, FileShare.ReadWrite);
- xmldoc.Save (fsxml);
-
- }
- }
- }
- //b11
- protected virtual void OnColorbutton11ColorSet (object sender, System.EventArgs e)
- {
- //entry3.Text = "Button2";
- //Red
- double a = colorbutton11.Color.Red;
- int mod1 = Convert.ToInt32 (a / 257);
-
- string red = mod1.ToString ();
- string l1 = Convert.ToString (mod1, 16).ToUpper ();
- string hax1;
-
- if (l1.Length <= 1)
-
- hax1 = string.Concat ("0", l1);
- else
- hax1 = l1;
- //Green
- double b = colorbutton11.Color.Green;
- int mod2 = Convert.ToInt32 (b / 257);
-
- string green = mod2.ToString ();
- string l2 = Convert.ToString (mod2, 16).ToUpper ();
- string hax2;
-
- if (l2.Length <= 1)
-
- hax2 = string.Concat ("0", l2);
- else
- hax2 = l2;
-
- //blue
- double c = colorbutton11.Color.Blue;
- int mod3 = Convert.ToInt32 (c / 257);
-
- string blue = mod3.ToString ();
- string l3 = Convert.ToString (mod3, 16).ToUpper ();
- string hax3;
- if (l3.Length <= 1)
-
- hax3 = string.Concat ("0", l3);
- else
- hax3 = l3;
-
-
- string XCode = string.Concat ("#", hax1, hax2, hax3);
- entry4.Text = XCode;
-
- string Code = string.Concat (red, green, blue);
- entry2.Text = Code;
-
- //code to write data into xml file
- FileStream fs = new FileStream ("colors.xml", FileMode.Open, FileAccess.Read, FileShare.ReadWrite);
- XmlDocument xmldoc = new XmlDocument ();
- xmldoc.Load (fs);
-
- XmlElement root = xmldoc.DocumentElement;
- foreach (XmlNode child in root.ChildNodes) {
-
- if (child.Attributes["name"].Value == entry1.Text) {
- XmlElement xmlNewColor = xmldoc.CreateElement ("Color");
- xmlNewColor.SetAttribute ("COLOR", entry4.Text);
- child.AppendChild (xmlNewColor);
- FileStream fsxml = new FileStream ("colors.xml", FileMode.Truncate, FileAccess.Write, FileShare.ReadWrite);
- xmldoc.Save (fsxml);
- }
- }
- }
- //b12
- protected virtual void OnColorbutton12ColorSet (object sender, System.EventArgs e)
- {
-
- //Red
- double a = colorbutton12.Color.Red;
- int mod1 = Convert.ToInt32 (a / 257);
-
- string red = mod1.ToString ();
- string l1 = Convert.ToString (mod1, 16).ToUpper ();
- string hax1;
-
- if (l1.Length <= 1)
-
- hax1 = string.Concat ("0", l1);
- else
- hax1 = l1;
- //Green
- double b = colorbutton12.Color.Green;
- int mod2 = Convert.ToInt32 (b / 257);
-
- string green = mod2.ToString ();
- string l2 = Convert.ToString (mod2, 16).ToUpper ();
- string hax2;
-
- if (l2.Length <= 1)
-
- hax2 = string.Concat ("0", l2);
- else
- hax2 = l2;
- //blue
- double c = colorbutton12.Color.Blue;
- int mod3 = Convert.ToInt32 (c / 257);
-
- string blue = mod3.ToString ();
- string l3 = Convert.ToString (mod3, 16).ToUpper ();
- string hax3;
- if (l3.Length <= 1)
-
- hax3 = string.Concat ("0", l3);
- else
- hax3 = l3;
-
- string XCode = string.Concat ("#", hax1, hax2, hax3);
- entry4.Text = XCode;
-
- string Code = string.Concat (red, green, blue);
- entry2.Text = Code;
-
-
- //code to write data into xml file
- FileStream fs = new FileStream ("colors.xml", FileMode.Open, FileAccess.Read, FileShare.ReadWrite);
- XmlDocument xmldoc = new XmlDocument ();
- xmldoc.Load (fs);
-
- XmlElement root = xmldoc.DocumentElement;
- foreach (XmlNode child in root.ChildNodes) {
-
- if (child.Attributes["name"].Value == entry1.Text) {
- XmlElement xmlNewColor = xmldoc.CreateElement ("Color");
- xmlNewColor.SetAttribute ("COLOR", entry4.Text);
- child.AppendChild (xmlNewColor);
- FileStream fsxml = new FileStream ("colors.xml", FileMode.Truncate, FileAccess.Write, FileShare.ReadWrite);
- xmldoc.Save (fsxml);
-
- }
- }
- }
- //b13
- protected virtual void OnColorbutton13ColorSet (object sender, System.EventArgs e)
- {
-
- //Red
- double a = colorbutton13.Color.Red;
- int mod1 = Convert.ToInt32 (a / 257);
-
- string red = mod1.ToString ();
- string l1 = Convert.ToString (mod1, 16).ToUpper ();
- string hax1;
-
- if (l1.Length <= 1)
-
- hax1 = string.Concat ("0", l1);
- else
- hax1 = l1;
- //Green
- double b = colorbutton13.Color.Green;
- int mod2 = Convert.ToInt32 (b / 257);
-
- string green = mod2.ToString ();
- string l2 = Convert.ToString (mod2, 16).ToUpper ();
- string hax2;
-
- if (l2.Length <= 1)
-
- hax2 = string.Concat ("0", l2);
- else
- hax2 = l2;
- //blue
- double c = colorbutton13.Color.Blue;
- int mod3 = Convert.ToInt32 (c / 257);
-
- string blue = mod3.ToString ();
- string l3 = Convert.ToString (mod3, 16).ToUpper ();
- string hax3;
- if (l3.Length <= 1)
-
- hax3 = string.Concat ("0", l3);
- else
- hax3 = l3;
-
- string XCode = string.Concat ("#", hax1, hax2, hax3);
- entry4.Text = XCode;
-
- string Code = string.Concat (red, green, blue);
- entry2.Text = Code;
-
- //code to write data into xml file
-
- FileStream fs = new FileStream ("colors.xml", FileMode.Open, FileAccess.Read, FileShare.ReadWrite);
- XmlDocument xmldoc = new XmlDocument ();
- xmldoc.Load (fs);
-
- XmlElement root = xmldoc.DocumentElement;
- foreach (XmlNode child in root.ChildNodes) {
-
- if (child.Attributes["name"].Value == entry1.Text) {
- XmlElement xmlNewColor = xmldoc.CreateElement ("Color");
- xmlNewColor.SetAttribute ("COLOR", entry4.Text);
- child.AppendChild (xmlNewColor);
- FileStream fsxml = new FileStream ("colors.xml", FileMode.Truncate, FileAccess.Write, FileShare.ReadWrite);
- xmldoc.Save (fsxml);
-
- }
- }
- }
- //b14
- protected virtual void OnColorbutton14ColorSet (object sender, System.EventArgs e)
- {
- // entry3.Text = "Button2";
- //Red
- double a = colorbutton14.Color.Red;
- int mod1 = Convert.ToInt32 (a / 257);
-
- string red = mod1.ToString ();
- string l1 = Convert.ToString (mod1, 16).ToUpper ();
- string hax1;
-
- if (l1.Length <= 1)
-
- hax1 = string.Concat ("0", l1);
- else
- hax1 = l1;
- //Green
- double b = colorbutton14.Color.Green;
- int mod2 = Convert.ToInt32 (b / 257);
-
- string green = mod2.ToString ();
- string l2 = Convert.ToString (mod2, 16).ToUpper ();
- string hax2;
-
- if (l2.Length <= 1)
-
- hax2 = string.Concat ("0", l2);
- else
- hax2 = l2;
-
- //blue
- double c = colorbutton14.Color.Blue;
- int mod3 = Convert.ToInt32 (c / 257);
-
- string blue = mod3.ToString ();
-
- string l3 = Convert.ToString (mod3, 16).ToUpper ();
- string hax3;
- if (l3.Length <= 1)
-
- hax3 = string.Concat ("0", l3);
- else
- hax3 = l3;
-
- string XCode = string.Concat ("#", hax1, hax2, hax3);
- entry4.Text = XCode;
-
- string Code = string.Concat (red, green, blue);
- entry2.Text = Code;
- //label1.Text = Code;
-
- //code to write data into xml file
-
- FileStream fs = new FileStream ("colors.xml", FileMode.Open, FileAccess.Read, FileShare.ReadWrite);
- XmlDocument xmldoc = new XmlDocument ();
- xmldoc.Load (fs);
- XmlElement root = xmldoc.DocumentElement;
-
- foreach (XmlNode child in root.ChildNodes) {
-
- if (child.Attributes["name"].Value == entry1.Text) {
- XmlElement xmlNewColor = xmldoc.CreateElement ("Color");
- xmlNewColor.SetAttribute ("COLOR", entry4.Text);
- child.AppendChild (xmlNewColor);
- FileStream fsxml = new FileStream ("colors.xml", FileMode.Truncate, FileAccess.Write, FileShare.ReadWrite);
- xmldoc.Save (fsxml);
-
- }
- }
- }
- //b15
- protected virtual void OnColorbutton15ColorSet (object sender, System.EventArgs e)
- {
- // entry3.Text = "Button2";
- //Red
- double a = colorbutton15.Color.Red;
- int mod1 = Convert.ToInt32 (a / 257);
-
- string red = mod1.ToString ();
- string l1 = Convert.ToString (mod1, 16).ToUpper ();
- string hax1;
-
- if (l1.Length <= 1)
-
- hax1 = string.Concat ("0", l1);
- else
- hax1 = l1;
- //Green
- double b = colorbutton15.Color.Green;
- int mod2 = Convert.ToInt32 (b / 257);
-
- string green = mod2.ToString ();
- string l2 = Convert.ToString (mod2, 16).ToUpper ();
- string hax2;
-
- if (l2.Length <= 1)
-
- hax2 = string.Concat ("0", l2);
- else
- hax2 = l2;
-
- //blue
- double c = colorbutton15.Color.Blue;
- int mod3 = Convert.ToInt32 (c / 257);
-
- string blue = mod3.ToString ();
- string l3 = Convert.ToString (mod3, 16).ToUpper ();
- string hax3;
- if (l3.Length <= 1)
-
- hax3 = string.Concat ("0", l3);
- else
- hax3 = l3;
-
- string XCode = string.Concat ("#", hax1, hax2, hax3);
- entry4.Text = XCode;
-
- string Code = string.Concat (red, green, blue);
- entry2.Text = Code;
- // label1.Text = Code;
- //code to write data into xml file
-
- FileStream fs = new FileStream ("colors.xml", FileMode.Open, FileAccess.Read, FileShare.ReadWrite);
- XmlDocument xmldoc = new XmlDocument ();
- xmldoc.Load (fs);
-
- XmlElement root = xmldoc.DocumentElement;
- foreach (XmlNode child in root.ChildNodes) {
-
- if (child.Attributes["name"].Value == entry1.Text) {
- XmlElement xmlNewColor = xmldoc.CreateElement ("Color");
- xmlNewColor.SetAttribute ("COLOR", entry4.Text);
- child.AppendChild (xmlNewColor);
- FileStream fsxml = new FileStream ("colors.xml", FileMode.Truncate, FileAccess.Write, FileShare.ReadWrite);
- xmldoc.Save (fsxml);
-
- }
- }
- }
- //b16
- protected virtual void OnColorbutton16ColorSet (object sender, System.EventArgs e)
- {
- // entry3.Text = "Button2";
- //Red
- double a = colorbutton16.Color.Red;
- int mod1 = Convert.ToInt32 (a / 257);
-
- string red = mod1.ToString ();
- string l1 = Convert.ToString (mod1, 16).ToUpper ();
- string hax1;
-
- if (l1.Length <= 1)
-
- hax1 = string.Concat ("0", l1);
- else
- hax1 = l1;
- //Green
- double b = colorbutton16.Color.Green;
- int mod2 = Convert.ToInt32 (b / 257);
-
- string green = mod2.ToString ();
- string l2 = Convert.ToString (mod2, 16).ToUpper ();
- string hax2;
-
- if (l2.Length <= 1)
-
- hax2 = string.Concat ("0", l2);
- else
- hax2 = l2;
- //blue
- double c = colorbutton16.Color.Blue;
- int mod3 = Convert.ToInt32 (c / 257);
-
- string blue = mod3.ToString ();
- string l3 = Convert.ToString (mod3, 16).ToUpper ();
- string hax3;
- if (l3.Length <= 1)
-
- hax3 = string.Concat ("0", l3);
- else
- hax3 = l3;
- string XCode = string.Concat ("#", hax1, hax2, hax3);
- entry4.Text = XCode;
-
- string Code = string.Concat (red, green, blue);
- entry2.Text = Code;
- //label1.Text = Code;
-
- //code to write data into xml file
-
- FileStream fs = new FileStream ("colors.xml", FileMode.Open, FileAccess.Read, FileShare.ReadWrite);
- XmlDocument xmldoc = new XmlDocument ();
- xmldoc.Load (fs);
-
- XmlElement root = xmldoc.DocumentElement;
- foreach (XmlNode child in root.ChildNodes) {
-
- if (child.Attributes["name"].Value == entry1.Text) {
- XmlElement xmlNewColor = xmldoc.CreateElement ("Color");
- xmlNewColor.SetAttribute ("COLOR", entry4.Text);
- child.AppendChild (xmlNewColor);
- FileStream fsxml = new FileStream ("colors.xml", FileMode.Truncate, FileAccess.Write, FileShare.ReadWrite);
- xmldoc.Save (fsxml);
-
- }
- }
- }
- protected virtual void btnCancel (object o, Gtk.ButtonPressEventArgs args)
- {
- }
- protected virtual void btn_Click (object sender, System.EventArgs e)
- {
- //Code to get hexadecimal from decimal
- //int i= Convert.ToInt32(entry3.Text);
- // label1.Text = Convert.ToString(i, 16).ToUpper();
- }
- protected virtual void Cmb_Changed (object sender, System.EventArgs e)
- {
- colorbutton1.Color = new Gdk.Color (255, 255, 255);
- colorbutton2.Color = new Gdk.Color (255, 255, 255);
- colorbutton3.Color = new Gdk.Color (255, 255, 255);
- colorbutton4.Color = new Gdk.Color (255, 255, 255);
- colorbutton5.Color = new Gdk.Color (255, 255, 255);
- colorbutton6.Color = new Gdk.Color (255, 255, 255);
- colorbutton7.Color = new Gdk.Color (255, 255, 255);
- colorbutton8.Color = new Gdk.Color (255, 255, 255);
- colorbutton9.Color = new Gdk.Color (255, 255, 255);
- colorbutton10.Color = new Gdk.Color (255, 255, 255);
- colorbutton11.Color = new Gdk.Color (255, 255, 255);
- colorbutton12.Color = new Gdk.Color (255, 255, 255);
- colorbutton13.Color = new Gdk.Color (255, 255, 255);
- colorbutton14.Color = new Gdk.Color (255, 255, 255);
- colorbutton15.Color = new Gdk.Color (255, 255, 255);
- colorbutton16.Color = new Gdk.Color (255, 255, 255);
-
-
- XmlDocument xdoc = new XmlDocument ();
- xdoc.Load ("colors.xml");
- XmlElement root = xdoc.DocumentElement;
-
- foreach (XmlNode child in root.ChildNodes) {
- if (child.Attributes["name"].Value == comboboxentry1.ActiveText) {
- int cnt = child.ChildNodes.Count;
- if (cnt >= 1) {
- XmlNode newchild1 = child.FirstChild;
- string clr1 = newchild1.Attributes["COLOR"].Value;
- string r1 = clr1.Substring (1, 2);
-
- //Code To convert hexadecimal to decimal
- int ir1 = Int32.Parse (r1, NumberStyles.HexNumber);
-
- string g1 = clr1.Substring (3, 2);
- int ig1 = Int32.Parse (g1, NumberStyles.HexNumber);
-
- string b1 = clr1.Substring (5, 2);
- int ib1 = Int32.Parse (b1, NumberStyles.HexNumber);
- colorbutton1.Color = new Gdk.Color ((byte)ir1, (byte)ig1, (byte)ib1);
-
- cnt--;
- } else
- return;
-
- //2
- if (cnt >= 1) {
- XmlNode newchild2 = child.ChildNodes[1];
- string clr2 = newchild2.Attributes["COLOR"].Value;
-
- string r2 = clr2.Substring (1, 2);
- int ir2 = Int32.Parse (r2, NumberStyles.HexNumber);
-
- string g2 = clr2.Substring (3, 2);
- int ig2 = Int32.Parse (g2, NumberStyles.HexNumber);
-
- string b2 = clr2.Substring (5, 2);
- int ib2 = Int32.Parse (b2, NumberStyles.HexNumber);
-
- colorbutton2.Color = new Gdk.Color ((byte)ir2, (byte)ig2, (byte)ib2);
- cnt--;
- } else
- return;
-
- //3
- if (cnt >= 1) {
- XmlNode newchild3 = child.ChildNodes[2];
- string clr3 = newchild3.Attributes["COLOR"].Value;
-
- string r3 = clr3.Substring (1, 2);
- int ir3 = Int32.Parse (r3, NumberStyles.HexNumber);
-
- string g3 = clr3.Substring (3, 2);
- int ig3 = Int32.Parse (g3, NumberStyles.HexNumber);
-
- string b3 = clr3.Substring (5, 2);
- int ib3 = Int32.Parse (b3, NumberStyles.HexNumber);
-
- colorbutton3.Color = new Gdk.Color ((byte)ir3, (byte)ig3, (byte)ib3);
- cnt--;
- } else
- return;
- //4
- if (cnt >= 1) {
- XmlNode newchild4 = child.ChildNodes[3];
- string clr4 = newchild4.Attributes["COLOR"].Value;
-
- string r4 = clr4.Substring (1, 2);
- int ir4 = Int32.Parse (r4, NumberStyles.HexNumber);
-
- string g4 = clr4.Substring (3, 2);
- int ig4 = Int32.Parse (g4, NumberStyles.HexNumber);
-
- string b4 = clr4.Substring (5, 2);
- int ib4 = Int32.Parse (b4, NumberStyles.HexNumber);
-
- colorbutton4.Color = new Gdk.Color ((byte)ir4, (byte)ig4, (byte)ib4);
- cnt--;
- } else
- return;
-
- //5
- if (cnt >= 1) {
- XmlNode newchild5 = child.ChildNodes[4];
- string clr5 = newchild5.Attributes["COLOR"].Value;
-
- string r5 = clr5.Substring (1, 2);
- int ir5 = Int32.Parse (r5, NumberStyles.HexNumber);
-
- string g5 = clr5.Substring (3, 2);
- int ig5 = Int32.Parse (g5, NumberStyles.HexNumber);
-
- string b5 = clr5.Substring (5, 2);
- int ib5 = Int32.Parse (b5, NumberStyles.HexNumber);
-
- colorbutton5.Color = new Gdk.Color ((byte)ir5, (byte)ig5, (byte)ib5);
- cnt--;
- } else
- return;
- //6
- if (cnt >= 1) {
- XmlNode newchild6 = child.ChildNodes[5];
- string clr6 = newchild6.Attributes["COLOR"].Value;
-
- string r6 = clr6.Substring (1, 2);
- int ir6 = Int32.Parse (r6, NumberStyles.HexNumber);
-
- string g6 = clr6.Substring (3, 2);
- int ig6 = Int32.Parse (g6, NumberStyles.HexNumber);
-
- string b6 = clr6.Substring (5, 2);
- int ib6 = Int32.Parse (b6, NumberStyles.HexNumber);
-
- colorbutton6.Color = new Gdk.Color ((byte)ir6, (byte)ig6, (byte)ib6);
- cnt--;
- } else
- return;
-
- //7
- if (cnt >= 1) {
- XmlNode newchild7 = child.ChildNodes[6];
- string clr7 = newchild7.Attributes["COLOR"].Value;
-
- string r7 = clr7.Substring (1, 2);
- int ir7 = Int32.Parse (r7, NumberStyles.HexNumber);
-
- string g7 = clr7.Substring (3, 2);
- int ig7 = Int32.Parse (g7, NumberStyles.HexNumber);
-
- string b7 = clr7.Substring (5, 2);
- int ib7 = Int32.Parse (b7, NumberStyles.HexNumber);
- colorbutton7.Color = new Gdk.Color ((byte)ir7, (byte)ig7, (byte)ib7);
- cnt--;
- } else
- return;
- //8
- if (cnt >= 1) {
- XmlNode newchild8 = child.ChildNodes[7];
- string clr8 = newchild8.Attributes["COLOR"].Value;
-
- string r8 = clr8.Substring (1, 2);
- int ir8 = Int32.Parse (r8, NumberStyles.HexNumber);
-
- string g8 = clr8.Substring (3, 2);
- int ig8 = Int32.Parse (g8, NumberStyles.HexNumber);
-
- string b8 = clr8.Substring (5, 2);
- int ib8 = Int32.Parse (b8, NumberStyles.HexNumber);
- colorbutton8.Color = new Gdk.Color ((byte)ir8, (byte)ig8, (byte)ib8);
- cnt--;
- } else
- return;
- //9
- if (cnt >= 1) {
- XmlNode newchild9 = child.ChildNodes[8];
- string clr9 = newchild9.Attributes["COLOR"].Value;
-
- string r9 = clr9.Substring (1, 2);
- int ir9 = Int32.Parse (r9, NumberStyles.HexNumber);
-
- string g9 = clr9.Substring (3, 2);
- int ig9 = Int32.Parse (g9, NumberStyles.HexNumber);
-
- string b9 = clr9.Substring (5, 2);
- int ib9 = Int32.Parse (b9, NumberStyles.HexNumber);
- colorbutton9.Color = new Gdk.Color ((byte)ir9, (byte)ig9, (byte)ib9);
- cnt--;
- } else
- return;
- //10
- if (cnt >= 1) {
- XmlNode newchild10 = child.ChildNodes[9];
- string clr10 = newchild10.Attributes["COLOR"].Value;
-
- string r10 = clr10.Substring (1, 2);
- int ir10 = Int32.Parse (r10, NumberStyles.HexNumber);
-
- string g10 = clr10.Substring (3, 2);
- int ig10 = Int32.Parse (g10, NumberStyles.HexNumber);
-
- string b10 = clr10.Substring (5, 2);
- int ib10 = Int32.Parse (b10, NumberStyles.HexNumber);
- colorbutton10.Color = new Gdk.Color ((byte)ir10, (byte)ig10, (byte)ib10);
- cnt--;
- } else
- return;
- //11
- if (cnt >= 1) {
- XmlNode newchild11 = child.ChildNodes[10];
- string clr11 = newchild11.Attributes["COLOR"].Value;
-
- string r11 = clr11.Substring (1, 2);
- int ir11 = Int32.Parse (r11, NumberStyles.HexNumber);
-
- string g11 = clr11.Substring (3, 2);
- int ig11 = Int32.Parse (g11, NumberStyles.HexNumber);
-
- string b11 = clr11.Substring (5, 2);
- int ib11 = Int32.Parse (b11, NumberStyles.HexNumber);
- colorbutton11.Color = new Gdk.Color ((byte)ir11, (byte)ig11, (byte)ib11);
- cnt--;
- } else
- return;
- //12
- if (cnt >= 1) {
- XmlNode newchild12 = child.ChildNodes[11];
- string clr12 = newchild12.Attributes["COLOR"].Value;
-
- string r12 = clr12.Substring (1, 2);
- int ir12 = Int32.Parse (r12, NumberStyles.HexNumber);
-
- string g12 = clr12.Substring (3, 2);
- int ig12 = Int32.Parse (g12, NumberStyles.HexNumber);
-
- string b12 = clr12.Substring (5, 2);
- int ib12 = Int32.Parse (b12, NumberStyles.HexNumber);
- colorbutton12.Color = new Gdk.Color ((byte)ir12, (byte)ig12, (byte)ib12);
- cnt--;
- } else
- return;
- //13
- if (cnt >= 1) {
- XmlNode newchild13 = child.ChildNodes[12];
- string clr13 = newchild13.Attributes["COLOR"].Value;
-
- string r13 = clr13.Substring (1, 2);
- int ir13 = Int32.Parse (r13, NumberStyles.HexNumber);
-
- string g13 = clr13.Substring (3, 2);
- int ig13 = Int32.Parse (g13, NumberStyles.HexNumber);
-
- string b13 = clr13.Substring (5, 2);
- int ib13 = Int32.Parse (b13, NumberStyles.HexNumber);
- colorbutton13.Color = new Gdk.Color ((byte)ir13, (byte)ig13, (byte)ib13);
- cnt--;
- } else
- return;
- //14
- if (cnt >= 1) {
- XmlNode newchild14 = child.ChildNodes[13];
- string clr14 = newchild14.Attributes["COLOR"].Value;
-
- string r14 = clr14.Substring (1, 2);
- int ir14 = Int32.Parse (r14, NumberStyles.HexNumber);
-
- string g14 = clr14.Substring (3, 2);
- int ig14 = Int32.Parse (g14, NumberStyles.HexNumber);
-
- string b14 = clr14.Substring (5, 2);
- int ib14 = Int32.Parse (b14, NumberStyles.HexNumber);
- colorbutton14.Color = new Gdk.Color ((byte)ir14, (byte)ig14, (byte)ib14);
- cnt--;
- } else
- return;
- //15
- if (cnt >= 1) {
- XmlNode newchild15 = child.ChildNodes[14];
- string clr15 = newchild15.Attributes["COLOR"].Value;
-
- string r15 = clr15.Substring (1, 2);
- int ir15 = Int32.Parse (r15, NumberStyles.HexNumber);
-
- string g15 = clr15.Substring (3, 2);
- int ig15 = Int32.Parse (g15, NumberStyles.HexNumber);
-
- string b15 = clr15.Substring (5, 2);
- int ib15 = Int32.Parse (b15, NumberStyles.HexNumber);
- colorbutton15.Color = new Gdk.Color ((byte)ir15, (byte)ig15, (byte)ib15);
- cnt--;
- } else
- return;
- //16
- if (cnt >= 1) {
- XmlNode newchild16 = child.ChildNodes[15];
- string clr16 = newchild16.Attributes["COLOR"].Value;
-
- string r16 = clr16.Substring (1, 2);
- int ir16 = Int32.Parse (r16, NumberStyles.HexNumber);
-
- string g16 = clr16.Substring (3, 2);
- int ig16 = Int32.Parse (g16, NumberStyles.HexNumber);
-
- string b16 = clr16.Substring (5, 2);
- int ib16 = Int32.Parse (b16, NumberStyles.HexNumber);
- colorbutton16.Color = new Gdk.Color ((byte)ir16, (byte)ig16, (byte)ib16);
- cnt--;
- } else
- return;
- }
- //if
- }
- //for
- }
-
- protected virtual void cbtn_Released (object sender, System.EventArgs e)
- {
- }
-
- protected virtual void QuitClicked (object sender, System.EventArgs e)
- {
- Application.Quit ();
- }
-
- protected virtual void OnQuitActionActivated (object sender, System.EventArgs e)
- {
- Application.Quit ();
- }
-
- protected virtual void AboutusClicked (object sender, System.EventArgs e)
- {
- MessageDialog md = new MessageDialog (this, DialogFlags.Modal, MessageType.Info, ButtonsType.Close, "Color Manager \n \nVersion : 0.1\n.");
- md.Show ();
- }
-
-}
diff --git a/ColorManager/MainWindow.xaml b/ColorManager/MainWindow.xaml
new file mode 100644
index 0000000..b803bb5
--- /dev/null
+++ b/ColorManager/MainWindow.xaml
@@ -0,0 +1,55 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/ColorManager/MainWindow.xaml.cs b/ColorManager/MainWindow.xaml.cs
new file mode 100644
index 0000000..0259e9a
--- /dev/null
+++ b/ColorManager/MainWindow.xaml.cs
@@ -0,0 +1,18 @@
+using Avalonia.Controls;
+using Avalonia.Markup.Xaml;
+
+namespace ColorManager;
+
+public partial class MainWindow : Window
+{
+ public MainWindow()
+ {
+ InitializeComponent();
+ DataContext = new MainViewModel();
+ }
+
+ private void InitializeComponent()
+ {
+ AvaloniaXamlLoader.Load(this);
+ }
+}
diff --git a/ColorManager/MyColor.cs b/ColorManager/MyColor.cs
index 2e06629..563e1fc 100644
--- a/ColorManager/MyColor.cs
+++ b/ColorManager/MyColor.cs
@@ -10,27 +10,40 @@
using System;
using System.Xml.Linq;
+using CommunityToolkit.Mvvm.ComponentModel;
namespace ColorManager
{
- public class MyColor
+ public partial class MyColor : ObservableObject
{
- public string colorName { get; set; }
- public string colorCode { get; set; }
-
- public MyColor()
- {
- }
+ [ObservableProperty]
+ private string colorName = string.Empty;
- public XElement ToXml()
- {
- return new XElement("Color", new XAttribute("name", colorName), new XAttribute("code", colorCode));
- }
+ [ObservableProperty]
+ private string hex = "FFFFFF";
- public void FromXml(XElement xelem)
- {
- colorCode = xelem.Attribute("code").Value;
- colorName = xelem.Attribute("name").Value;
- }
+ public MyColor()
+ {
+ }
+
+ public XElement ToXml()
+ {
+ return new XElement("Color", new XAttribute("hex", Hex));
+ }
+
+ public void FromXml(XElement xelem)
+ {
+ var hexAttr = xelem.Attribute("hex");
+ if (hexAttr != null)
+ {
+ Hex = hexAttr.Value;
+ }
+
+ var nameAttr = xelem.Attribute("name");
+ if (nameAttr != null)
+ {
+ ColorName = nameAttr.Value;
+ }
+ }
}
}
diff --git a/ColorManager/MyForm.cs b/ColorManager/MyForm.cs
deleted file mode 100644
index 696d97d..0000000
--- a/ColorManager/MyForm.cs
+++ /dev/null
@@ -1,240 +0,0 @@
-
-using System;
-using System.Globalization;
-using System.Collections.Generic;
-using System.Xml.Linq;
-using System.Linq;
-
-namespace ColorManager
-{
- partial class MyForm : Gtk.Window
- {
- protected PaletteManager mgr = new PaletteManager ();
-
- public MyForm () : base(Gtk.WindowType.Toplevel)
- {
- this.Build ();
- BuildForm ();
- hbox2.Visible = false;
- }
-
- public void BuildForm ()
- {
- LoadList ();
- }
-
- public void LoadList ()
- {
- List lst = mgr.GetList ();
- foreach (var item in lst) {
- combobox1.AppendText (item);
- }
- combobox1.Active = 0;
- }
-
- protected virtual void OnCombobox1Changed (object sender, System.EventArgs e)
- {
- LoadPalette (combobox1.ActiveText);
- }
-
- protected void LoadPalette (string name)
- {
- ClearClrBtns ();
- IEnumerable elem = mgr.GetPalette (name).Descendants ();
- lblDebug.Text = "Palette "+ name+ " loaded.";
- tbClr.Text="";
- int cnt = elem.Count ();
-
- if (cnt >= 1)
- clrBtn1.Color = GetColor(elem.ElementAt (0).Attribute ("COLOR").Value.ToString ());
- if (cnt >= 2)
- clrBtn2.Color = GetColor (elem.ElementAt (1).Attribute ("COLOR").Value.ToString ());
- if (cnt >= 3)
- clrBtn3.Color = GetColor (elem.ElementAt (2).Attribute ("COLOR").Value.ToString ());
- if (cnt >= 4)
- clrBtn4.Color = GetColor (elem.ElementAt (3).Attribute ("COLOR").Value.ToString ());
- if (cnt >= 5)
- clrBtn5.Color = GetColor (elem.ElementAt (4).Attribute ("COLOR").Value.ToString ());
- if (cnt >= 6)
- clrBtn6.Color = GetColor (elem.ElementAt (5).Attribute ("COLOR").Value.ToString ());
- if (cnt >= 7)
- clrBtn7.Color = GetColor (elem.ElementAt (6).Attribute ("COLOR").Value.ToString ());
- if (cnt >= 8)
- clrBtn8.Color = GetColor (elem.ElementAt (7).Attribute ("COLOR").Value.ToString ());
- if (cnt >= 9)
- clrBtn9.Color = GetColor (elem.ElementAt (8).Attribute ("COLOR").Value.ToString ());
- if (cnt >= 10)
- clrBtn10.Color = GetColor (elem.ElementAt (9).Attribute ("COLOR").Value.ToString ());
- }
-
- protected void ClearClrBtns ()
- {
- clrBtn1.Color = new Gdk.Color (255, 255, 255);
- clrBtn2.Color = new Gdk.Color (255, 255, 255);
- clrBtn3.Color = new Gdk.Color (255, 255, 255);
- clrBtn4.Color = new Gdk.Color (255, 255, 255);
- clrBtn5.Color = new Gdk.Color (255, 255, 255);
- clrBtn6.Color = new Gdk.Color (255, 255, 255);
- clrBtn7.Color = new Gdk.Color (255, 255, 255);
- clrBtn8.Color = new Gdk.Color (255, 255, 255);
- clrBtn9.Color = new Gdk.Color (255, 255, 255);
- clrBtn10.Color = new Gdk.Color (255, 255, 255);
- }
-
- protected Gdk.Color GetColor (string clr1)
- {
- string r1 = clr1.Substring (1, 2);
-
- //Code To convert hexadecimal to decimal
- int ir1 = Int32.Parse (r1, NumberStyles.HexNumber);
-
- string g1 = clr1.Substring (3, 2);
- int ig1 = Int32.Parse (g1, NumberStyles.HexNumber);
-
- string b1 = clr1.Substring (5, 2);
- int ib1 = Int32.Parse (b1, NumberStyles.HexNumber);
-
- return new Gdk.Color ((byte)ir1, (byte)ig1, (byte)ib1);
-
- }
-
- protected string GetColorCode (Gtk.ColorButton clrbtn)
- {
- //Red
- double a = clrbtn.Color.Red;
- int mod1 = Convert.ToInt32 (a / 257);
-
- //string red = mod1.ToString ();
- string l1 = Convert.ToString (mod1, 16).ToUpper ();
- string hax1;
-
- if (l1.Length <= 1)
-
- hax1 = string.Concat ("0", l1);
- else
- hax1 = l1;
- //Green
- double b = clrbtn.Color.Green;
- int mod2 = Convert.ToInt32 (b / 257);
-
- //string green = mod2.ToString ();
- string l2 = Convert.ToString (mod2, 16).ToUpper ();
- string hax2;
-
- if (l2.Length <= 1)
-
- hax2 = string.Concat ("0", l2);
- else
- hax2 = l2;
- //blue
- double c = clrbtn.Color.Blue;
- int mod3 = Convert.ToInt32 (c / 257);
-
- //string blue = mod3.ToString ();
- string l3 = Convert.ToString (mod3, 16).ToUpper ();
- string hax3;
- if (l3.Length <= 1)
-
- hax3 = string.Concat ("0", l3);
- else
- hax3 = l3;
-
- string XCode = string.Concat ("#", hax1, hax2, hax3);
-
- tbClr.Text = XCode;
- //string Code = string.Concat (red, green, blue);
- return XCode;
- }
-
- protected virtual void OnBtnCreateClicked (object sender, System.EventArgs e)
- {
- hbox2.Visible = !hbox2.Visible;
- }
-
- protected virtual void OnButCr1Clicked (object sender, System.EventArgs e)
- {
- mgr.CreatePalette (tbName.Text);
- lblDebug.Text = "New Palette created : " + tbName.Text;
- combobox1.AppendText (tbName.Text);
- hbox2.Visible=false;
- }
-
- protected void updateColor (string pltname, Gtk.ColorButton btn, int no)
- {
-
- string clrCode = GetColorCode (btn);
- IEnumerable elem = mgr.GetPalette (pltname).Descendants ();
- try {
- XElement e1 = elem.ElementAt (no);
- if (e1 != null)
- e1.Attribute ("COLOR").Value = clrCode;
- //else
- // e1.Add ("Color",new XAttribute ("COLOR", clrCode));
- } catch (Exception ex) {
- XElement plelem = mgr.GetPalette (pltname).Single ();
- XElement e = new XElement ("Color", new XAttribute ("COLOR", clrCode));
- plelem.Add (e);
- }
-
- mgr.save ();
- }
-
- protected virtual void OnClrBtn1ColorSet (object sender, System.EventArgs e)
- {
- updateColor (combobox1.ActiveText, clrBtn1, 0);
- }
-
- protected virtual void OnClrBtn2ColorSet (object sender, System.EventArgs e)
- {
- updateColor (combobox1.ActiveText, clrBtn2, 1);
- }
-
- protected virtual void OnClrBtn3ColorSet (object sender, System.EventArgs e)
- {
- updateColor (combobox1.ActiveText, clrBtn3, 2);
- }
-
- protected virtual void OnClrBtn4ColorSet (object sender, System.EventArgs e)
- {
- updateColor (combobox1.ActiveText, clrBtn4, 3);
- }
-
- protected virtual void OnClrBtn5ColorSet (object sender, System.EventArgs e)
- {
- updateColor (combobox1.ActiveText, clrBtn5, 4);
- }
-
- protected virtual void OnClrBtn6ColorSet (object sender, System.EventArgs e)
- {
- updateColor (combobox1.ActiveText, clrBtn6, 5);
- }
-
- protected virtual void OnClrBtn7ColorSet (object sender, System.EventArgs e)
- {
- updateColor (combobox1.ActiveText, clrBtn7, 6);
- }
-
- protected virtual void OnClrBtn8ColorSet (object sender, System.EventArgs e)
- {
- updateColor (combobox1.ActiveText, clrBtn8, 7);
- }
-
- protected virtual void OnClrBtn9ColorSet (object sender, System.EventArgs e)
- {
- updateColor (combobox1.ActiveText, clrBtn9, 8);
- }
-
- protected virtual void OnClrBtn10ColorSet (object sender, System.EventArgs e)
- {
- updateColor (combobox1.ActiveText, clrBtn10, 9);
- }
-
- protected virtual void OnBtnDeleteClicked (object sender, System.EventArgs e)
- {
- mgr.DeletePalette(combobox1.ActiveText);
- combobox1.Remove(combobox1.Active);
- }
-
-
- }
-}
diff --git a/ColorManager/PaletteManager.cs b/ColorManager/PaletteManager.cs
index 3104baa..5a53eea 100644
--- a/ColorManager/PaletteManager.cs
+++ b/ColorManager/PaletteManager.cs
@@ -16,16 +16,69 @@ public class PaletteManager
public PaletteManager ()
{
file = GetFilePath ();
+ EnsureColorsFileExists ();
doc = XDocument.Load (file);
}
///
- /// Gets the full path to colors.xml next to the executable
+ /// Gets the full path to colors.xml in ApplicationData folder
///
protected string GetFilePath ()
{
- string exePath = Path.GetDirectoryName (Assembly.GetExecutingAssembly ().Location);
- return Path.Combine (exePath, "colors.xml");
+ string appDataPath = Path.Combine(
+ Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData),
+ "ColorManager");
+ return Path.Combine (appDataPath, "colors.xml");
+ }
+
+ ///
+ /// Ensures colors.xml exists. If not, extracts from embedded resource.
+ /// Also migrates from old execution directory location if it exists there.
+ ///
+ protected void EnsureColorsFileExists()
+ {
+ if (File.Exists(file))
+ return;
+
+ // Try to migrate from old location (execution directory)
+ string oldLocation = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "colors.xml");
+ if (File.Exists(oldLocation))
+ {
+ File.Copy(oldLocation, file);
+ return;
+ }
+
+ // Extract embedded resource
+ ExtractEmbeddedResource("colors.xml", file);
+ }
+
+ ///
+ /// Extracts an embedded resource to a file
+ ///
+ private void ExtractEmbeddedResource(string resourceName, string outputPath)
+ {
+ try
+ {
+ var assembly = Assembly.GetExecutingAssembly();
+ var fullResourceName = $"{assembly.GetName().Name}.{resourceName}";
+
+ using (var stream = assembly.GetManifestResourceStream(fullResourceName))
+ {
+ if (stream == null)
+ throw new FileNotFoundException($"Embedded resource '{fullResourceName}' not found.");
+
+ Directory.CreateDirectory(Path.GetDirectoryName(outputPath));
+ using (var fileStream = File.Create(outputPath))
+ {
+ stream.CopyTo(fileStream);
+ }
+ }
+ }
+ catch (Exception ex)
+ {
+ System.Diagnostics.Debug.WriteLine($"Error extracting embedded resource: {ex.Message}");
+ throw;
+ }
}
protected void LoadXml ()
diff --git a/ColorManager/gtk-gui/ColorManager.MyForm.cs b/ColorManager/gtk-gui/ColorManager.MyForm.cs
deleted file mode 100644
index f384b27..0000000
--- a/ColorManager/gtk-gui/ColorManager.MyForm.cs
+++ /dev/null
@@ -1,379 +0,0 @@
-
-// This file has been generated by the GUI designer. Do not modify.
-namespace ColorManager
-{
- internal partial class MyForm
- {
- private global::Gtk.UIManager UIManager;
-
- private global::Gtk.Action FileAction;
-
- private global::Gtk.Action quitAction;
-
- private global::Gtk.Action HelpAction;
-
- private global::Gtk.VBox vbox1;
-
- private global::Gtk.MenuBar menubar1;
-
- private global::Gtk.HBox hbox1;
-
- private global::Gtk.Label label1;
-
- private global::Gtk.ComboBoxText combobox1;
-
- private global::Gtk.Button btnCreate;
-
- private global::Gtk.Button btnDelete;
-
- private global::Gtk.HBox hbox2;
-
- private global::Gtk.Label label2;
-
- private global::Gtk.Entry tbName;
-
- private global::Gtk.Button butCr1;
-
- private global::Gtk.Table table1;
-
- private global::Gtk.ColorButton clrBtn1;
-
- private global::Gtk.ColorButton clrBtn10;
-
- private global::Gtk.ColorButton clrBtn2;
-
- private global::Gtk.ColorButton clrBtn3;
-
- private global::Gtk.ColorButton clrBtn4;
-
- private global::Gtk.ColorButton clrBtn5;
-
- private global::Gtk.ColorButton clrBtn6;
-
- private global::Gtk.ColorButton clrBtn7;
-
- private global::Gtk.ColorButton clrBtn8;
-
- private global::Gtk.ColorButton clrBtn9;
-
- private global::Gtk.Label label3;
-
- private global::Gtk.Entry tbClr;
-
- private global::Gtk.ColorSelection colorselection1;
-
- private global::Gtk.Label lblDebug;
-
- protected virtual void Build ()
- {
- global::Stetic.Gui.Initialize (this);
- // Widget ColorManager.MyForm
- this.UIManager = new global::Gtk.UIManager ();
- global::Gtk.ActionGroup w1 = new global::Gtk.ActionGroup ("Default");
- this.FileAction = new global::Gtk.Action ("FileAction", "_File", null, null);
- this.FileAction.ShortLabel = "_File";
- w1.Add (this.FileAction, null);
- this.quitAction = new global::Gtk.Action ("quitAction", "_Quit", null, "gtk-quit");
- this.quitAction.ShortLabel = "_Quit";
- w1.Add (this.quitAction, null);
- this.HelpAction = new global::Gtk.Action ("HelpAction", "_Help", null, null);
- this.HelpAction.ShortLabel = "_Help";
- w1.Add (this.HelpAction, null);
- this.UIManager.InsertActionGroup (w1, 0);
- this.AddAccelGroup (this.UIManager.AccelGroup);
- this.Name = "ColorManager.MyForm";
- this.Title = "Color Manager";
- this.WindowPosition = ((global::Gtk.WindowPosition)(4));
- // Container child ColorManager.MyForm.Gtk.Container+ContainerChild
- this.vbox1 = new global::Gtk.VBox ();
- this.vbox1.Name = "vbox1";
- this.vbox1.Spacing = 6;
- // Container child vbox1.Gtk.Box+BoxChild
- this.UIManager.AddUiFromString ("");
- this.menubar1 = ((global::Gtk.MenuBar)(this.UIManager.GetWidget ("/menubar1")));
- this.menubar1.Name = "menubar1";
- this.vbox1.Add (this.menubar1);
- global::Gtk.Box.BoxChild w2 = ((global::Gtk.Box.BoxChild)(this.vbox1 [this.menubar1]));
- w2.Position = 0;
- w2.Expand = false;
- w2.Fill = false;
- // Container child vbox1.Gtk.Box+BoxChild
- this.hbox1 = new global::Gtk.HBox ();
- this.hbox1.Name = "hbox1";
- this.hbox1.Spacing = 6;
- // Container child hbox1.Gtk.Box+BoxChild
- this.label1 = new global::Gtk.Label ();
- this.label1.Name = "label1";
- this.label1.LabelProp = "Select Palette";
- this.hbox1.Add (this.label1);
- global::Gtk.Box.BoxChild w3 = ((global::Gtk.Box.BoxChild)(this.hbox1 [this.label1]));
- w3.Position = 0;
- w3.Expand = false;
- w3.Fill = false;
- // Container child hbox1.Gtk.Box+BoxChild
- this.combobox1 = new global::Gtk.ComboBoxText ();
- this.combobox1.Name = "combobox1";
- this.hbox1.Add (this.combobox1);
- global::Gtk.Box.BoxChild w4 = ((global::Gtk.Box.BoxChild)(this.hbox1 [this.combobox1]));
- w4.Position = 1;
- w4.Expand = false;
- w4.Fill = false;
- // Container child hbox1.Gtk.Box+BoxChild
- this.btnCreate = new global::Gtk.Button ();
- this.btnCreate.CanFocus = true;
- this.btnCreate.Name = "btnCreate";
- this.btnCreate.UseUnderline = true;
- this.btnCreate.Label = "Create Palette";
- global::Gtk.Image w5 = new global::Gtk.Image ();
- w5.Pixbuf = global::Stetic.IconLoader.LoadIcon (this, "gtk-add", global::Gtk.IconSize.Menu);
- this.btnCreate.Image = w5;
- this.hbox1.Add (this.btnCreate);
- global::Gtk.Box.BoxChild w6 = ((global::Gtk.Box.BoxChild)(this.hbox1 [this.btnCreate]));
- w6.Position = 3;
- w6.Expand = false;
- w6.Fill = false;
- // Container child hbox1.Gtk.Box+BoxChild
- this.btnDelete = new global::Gtk.Button ();
- this.btnDelete.CanFocus = true;
- this.btnDelete.Name = "btnDelete";
- this.btnDelete.UseUnderline = true;
- this.btnDelete.Label = "Delete";
- global::Gtk.Image w7 = new global::Gtk.Image ();
- w7.Pixbuf = global::Stetic.IconLoader.LoadIcon (this, "gtk-close", global::Gtk.IconSize.Menu);
- this.btnDelete.Image = w7;
- this.hbox1.Add (this.btnDelete);
- global::Gtk.Box.BoxChild w8 = ((global::Gtk.Box.BoxChild)(this.hbox1 [this.btnDelete]));
- w8.Position = 4;
- w8.Expand = false;
- w8.Fill = false;
- this.vbox1.Add (this.hbox1);
- global::Gtk.Box.BoxChild w9 = ((global::Gtk.Box.BoxChild)(this.vbox1 [this.hbox1]));
- w9.Position = 1;
- w9.Expand = false;
- w9.Fill = false;
- // Container child vbox1.Gtk.Box+BoxChild
- this.hbox2 = new global::Gtk.HBox ();
- this.hbox2.Name = "hbox2";
- this.hbox2.Spacing = 6;
- // Container child hbox2.Gtk.Box+BoxChild
- this.label2 = new global::Gtk.Label ();
- this.label2.Name = "label2";
- this.label2.LabelProp = "Enter palette name";
- this.hbox2.Add (this.label2);
- global::Gtk.Box.BoxChild w10 = ((global::Gtk.Box.BoxChild)(this.hbox2 [this.label2]));
- w10.Position = 0;
- w10.Expand = false;
- w10.Fill = false;
- // Container child hbox2.Gtk.Box+BoxChild
- this.tbName = new global::Gtk.Entry ();
- this.tbName.CanFocus = true;
- this.tbName.Name = "tbName";
- this.tbName.IsEditable = true;
- this.tbName.InvisibleChar = '●';
- this.hbox2.Add (this.tbName);
- global::Gtk.Box.BoxChild w11 = ((global::Gtk.Box.BoxChild)(this.hbox2 [this.tbName]));
- w11.Position = 1;
- // Container child hbox2.Gtk.Box+BoxChild
- this.butCr1 = new global::Gtk.Button ();
- this.butCr1.CanFocus = true;
- this.butCr1.Name = "butCr1";
- this.butCr1.UseUnderline = true;
- this.butCr1.Label = "Create";
- this.hbox2.Add (this.butCr1);
- global::Gtk.Box.BoxChild w12 = ((global::Gtk.Box.BoxChild)(this.hbox2 [this.butCr1]));
- w12.Position = 2;
- w12.Expand = false;
- w12.Fill = false;
- this.vbox1.Add (this.hbox2);
- global::Gtk.Box.BoxChild w13 = ((global::Gtk.Box.BoxChild)(this.vbox1 [this.hbox2]));
- w13.Position = 2;
- w13.Expand = false;
- w13.Fill = false;
- // Container child vbox1.Gtk.Box+BoxChild
- this.table1 = new global::Gtk.Table (((uint)(2)), ((uint)(7)), false);
- this.table1.Name = "table1";
- this.table1.RowSpacing = ((uint)(6));
- this.table1.ColumnSpacing = ((uint)(6));
- // Container child table1.Gtk.Table+TableChild
- this.clrBtn1 = new global::Gtk.ColorButton ();
- this.clrBtn1.CanFocus = true;
- this.clrBtn1.Events = ((global::Gdk.EventMask)(784));
- this.clrBtn1.Name = "clrBtn1";
- this.table1.Add (this.clrBtn1);
- global::Gtk.Table.TableChild w14 = ((global::Gtk.Table.TableChild)(this.table1 [this.clrBtn1]));
- w14.XOptions = ((global::Gtk.AttachOptions)(4));
- w14.YOptions = ((global::Gtk.AttachOptions)(4));
- // Container child table1.Gtk.Table+TableChild
- this.clrBtn10 = new global::Gtk.ColorButton ();
- this.clrBtn10.CanFocus = true;
- this.clrBtn10.Events = ((global::Gdk.EventMask)(784));
- this.clrBtn10.Name = "clrBtn10";
- this.table1.Add (this.clrBtn10);
- global::Gtk.Table.TableChild w15 = ((global::Gtk.Table.TableChild)(this.table1 [this.clrBtn10]));
- w15.TopAttach = ((uint)(1));
- w15.BottomAttach = ((uint)(2));
- w15.LeftAttach = ((uint)(4));
- w15.RightAttach = ((uint)(5));
- w15.XOptions = ((global::Gtk.AttachOptions)(4));
- w15.YOptions = ((global::Gtk.AttachOptions)(4));
- // Container child table1.Gtk.Table+TableChild
- this.clrBtn2 = new global::Gtk.ColorButton ();
- this.clrBtn2.CanFocus = true;
- this.clrBtn2.Events = ((global::Gdk.EventMask)(784));
- this.clrBtn2.Name = "clrBtn2";
- this.table1.Add (this.clrBtn2);
- global::Gtk.Table.TableChild w16 = ((global::Gtk.Table.TableChild)(this.table1 [this.clrBtn2]));
- w16.LeftAttach = ((uint)(1));
- w16.RightAttach = ((uint)(2));
- w16.XOptions = ((global::Gtk.AttachOptions)(4));
- w16.YOptions = ((global::Gtk.AttachOptions)(4));
- // Container child table1.Gtk.Table+TableChild
- this.clrBtn3 = new global::Gtk.ColorButton ();
- this.clrBtn3.CanFocus = true;
- this.clrBtn3.Events = ((global::Gdk.EventMask)(784));
- this.clrBtn3.Name = "clrBtn3";
- this.table1.Add (this.clrBtn3);
- global::Gtk.Table.TableChild w17 = ((global::Gtk.Table.TableChild)(this.table1 [this.clrBtn3]));
- w17.LeftAttach = ((uint)(2));
- w17.RightAttach = ((uint)(3));
- w17.XOptions = ((global::Gtk.AttachOptions)(4));
- w17.YOptions = ((global::Gtk.AttachOptions)(4));
- // Container child table1.Gtk.Table+TableChild
- this.clrBtn4 = new global::Gtk.ColorButton ();
- this.clrBtn4.CanFocus = true;
- this.clrBtn4.Events = ((global::Gdk.EventMask)(784));
- this.clrBtn4.Name = "clrBtn4";
- this.table1.Add (this.clrBtn4);
- global::Gtk.Table.TableChild w18 = ((global::Gtk.Table.TableChild)(this.table1 [this.clrBtn4]));
- w18.LeftAttach = ((uint)(3));
- w18.RightAttach = ((uint)(4));
- w18.XOptions = ((global::Gtk.AttachOptions)(4));
- w18.YOptions = ((global::Gtk.AttachOptions)(4));
- // Container child table1.Gtk.Table+TableChild
- this.clrBtn5 = new global::Gtk.ColorButton ();
- this.clrBtn5.CanFocus = true;
- this.clrBtn5.Events = ((global::Gdk.EventMask)(784));
- this.clrBtn5.Name = "clrBtn5";
- this.table1.Add (this.clrBtn5);
- global::Gtk.Table.TableChild w19 = ((global::Gtk.Table.TableChild)(this.table1 [this.clrBtn5]));
- w19.LeftAttach = ((uint)(4));
- w19.RightAttach = ((uint)(5));
- w19.XOptions = ((global::Gtk.AttachOptions)(4));
- w19.YOptions = ((global::Gtk.AttachOptions)(4));
- // Container child table1.Gtk.Table+TableChild
- this.clrBtn6 = new global::Gtk.ColorButton ();
- this.clrBtn6.CanFocus = true;
- this.clrBtn6.Events = ((global::Gdk.EventMask)(784));
- this.clrBtn6.Name = "clrBtn6";
- this.table1.Add (this.clrBtn6);
- global::Gtk.Table.TableChild w20 = ((global::Gtk.Table.TableChild)(this.table1 [this.clrBtn6]));
- w20.TopAttach = ((uint)(1));
- w20.BottomAttach = ((uint)(2));
- w20.XOptions = ((global::Gtk.AttachOptions)(4));
- w20.YOptions = ((global::Gtk.AttachOptions)(4));
- // Container child table1.Gtk.Table+TableChild
- this.clrBtn7 = new global::Gtk.ColorButton ();
- this.clrBtn7.CanFocus = true;
- this.clrBtn7.Events = ((global::Gdk.EventMask)(784));
- this.clrBtn7.Name = "clrBtn7";
- this.table1.Add (this.clrBtn7);
- global::Gtk.Table.TableChild w21 = ((global::Gtk.Table.TableChild)(this.table1 [this.clrBtn7]));
- w21.TopAttach = ((uint)(1));
- w21.BottomAttach = ((uint)(2));
- w21.LeftAttach = ((uint)(1));
- w21.RightAttach = ((uint)(2));
- w21.XOptions = ((global::Gtk.AttachOptions)(4));
- w21.YOptions = ((global::Gtk.AttachOptions)(4));
- // Container child table1.Gtk.Table+TableChild
- this.clrBtn8 = new global::Gtk.ColorButton ();
- this.clrBtn8.CanFocus = true;
- this.clrBtn8.Events = ((global::Gdk.EventMask)(784));
- this.clrBtn8.Name = "clrBtn8";
- this.table1.Add (this.clrBtn8);
- global::Gtk.Table.TableChild w22 = ((global::Gtk.Table.TableChild)(this.table1 [this.clrBtn8]));
- w22.TopAttach = ((uint)(1));
- w22.BottomAttach = ((uint)(2));
- w22.LeftAttach = ((uint)(2));
- w22.RightAttach = ((uint)(3));
- w22.XOptions = ((global::Gtk.AttachOptions)(4));
- w22.YOptions = ((global::Gtk.AttachOptions)(4));
- // Container child table1.Gtk.Table+TableChild
- this.clrBtn9 = new global::Gtk.ColorButton ();
- this.clrBtn9.CanFocus = true;
- this.clrBtn9.Events = ((global::Gdk.EventMask)(784));
- this.clrBtn9.Name = "clrBtn9";
- this.table1.Add (this.clrBtn9);
- global::Gtk.Table.TableChild w23 = ((global::Gtk.Table.TableChild)(this.table1 [this.clrBtn9]));
- w23.TopAttach = ((uint)(1));
- w23.BottomAttach = ((uint)(2));
- w23.LeftAttach = ((uint)(3));
- w23.RightAttach = ((uint)(4));
- w23.XOptions = ((global::Gtk.AttachOptions)(4));
- w23.YOptions = ((global::Gtk.AttachOptions)(4));
- // Container child table1.Gtk.Table+TableChild
- this.label3 = new global::Gtk.Label ();
- this.label3.Name = "label3";
- this.label3.LabelProp = "Color Code";
- this.table1.Add (this.label3);
- global::Gtk.Table.TableChild w24 = ((global::Gtk.Table.TableChild)(this.table1 [this.label3]));
- w24.LeftAttach = ((uint)(5));
- w24.RightAttach = ((uint)(6));
- w24.XOptions = ((global::Gtk.AttachOptions)(4));
- w24.YOptions = ((global::Gtk.AttachOptions)(4));
- // Container child table1.Gtk.Table+TableChild
- this.tbClr = new global::Gtk.Entry ();
- this.tbClr.CanFocus = true;
- this.tbClr.Name = "tbClr";
- this.tbClr.IsEditable = true;
- this.tbClr.InvisibleChar = '•';
- this.table1.Add (this.tbClr);
- global::Gtk.Table.TableChild w25 = ((global::Gtk.Table.TableChild)(this.table1 [this.tbClr]));
- w25.LeftAttach = ((uint)(6));
- w25.RightAttach = ((uint)(7));
- w25.YOptions = ((global::Gtk.AttachOptions)(4));
- this.vbox1.Add (this.table1);
- global::Gtk.Box.BoxChild w26 = ((global::Gtk.Box.BoxChild)(this.vbox1 [this.table1]));
- w26.Position = 3;
- w26.Expand = false;
- w26.Fill = false;
- // Container child vbox1.Gtk.Box+BoxChild
- this.colorselection1 = new global::Gtk.ColorSelection ();
- this.colorselection1.Name = "colorselection1";
- this.colorselection1.HasOpacityControl = true;
- this.vbox1.Add (this.colorselection1);
- global::Gtk.Box.BoxChild w27 = ((global::Gtk.Box.BoxChild)(this.vbox1 [this.colorselection1]));
- w27.Position = 4;
- // Container child vbox1.Gtk.Box+BoxChild
- this.lblDebug = new global::Gtk.Label ();
- this.lblDebug.Name = "lblDebug";
- this.lblDebug.LabelProp = "Ready";
- this.lblDebug.SingleLineMode = true;
- this.vbox1.Add (this.lblDebug);
- global::Gtk.Box.BoxChild w28 = ((global::Gtk.Box.BoxChild)(this.vbox1 [this.lblDebug]));
- w28.Position = 5;
- w28.Expand = false;
- w28.Fill = false;
- this.Add (this.vbox1);
- if ((this.Child != null)) {
- this.Child.ShowAll ();
- }
- this.DefaultWidth = 505;
- this.DefaultHeight = 415;
- this.Show ();
- this.combobox1.Changed += new global::System.EventHandler (this.OnCombobox1Changed);
- this.btnCreate.Clicked += new global::System.EventHandler (this.OnBtnCreateClicked);
- this.btnDelete.Clicked += new global::System.EventHandler (this.OnBtnDeleteClicked);
- this.butCr1.Clicked += new global::System.EventHandler (this.OnButCr1Clicked);
- this.clrBtn9.ColorSet += new global::System.EventHandler (this.OnClrBtn9ColorSet);
- this.clrBtn8.ColorSet += new global::System.EventHandler (this.OnClrBtn8ColorSet);
- this.clrBtn7.ColorSet += new global::System.EventHandler (this.OnClrBtn7ColorSet);
- this.clrBtn6.ColorSet += new global::System.EventHandler (this.OnClrBtn6ColorSet);
- this.clrBtn5.ColorSet += new global::System.EventHandler (this.OnClrBtn5ColorSet);
- this.clrBtn4.ColorSet += new global::System.EventHandler (this.OnClrBtn4ColorSet);
- this.clrBtn3.ColorSet += new global::System.EventHandler (this.OnClrBtn3ColorSet);
- this.clrBtn2.ColorSet += new global::System.EventHandler (this.OnClrBtn2ColorSet);
- this.clrBtn10.ColorSet += new global::System.EventHandler (this.OnClrBtn10ColorSet);
- this.clrBtn1.ColorSet += new global::System.EventHandler (this.OnClrBtn1ColorSet);
- }
- }
-}
diff --git a/ColorManager/gtk-gui/MainWindow.cs b/ColorManager/gtk-gui/MainWindow.cs
deleted file mode 100644
index 3182edc..0000000
--- a/ColorManager/gtk-gui/MainWindow.cs
+++ /dev/null
@@ -1,574 +0,0 @@
-
-// This file has been generated by the GUI designer. Do not modify.
-
-public partial class MainWindow
-{
- private global::Gtk.UIManager UIManager;
-
- private global::Gtk.Action Help;
-
- private global::Gtk.Action AboutUs;
-
- private global::Gtk.Action help;
-
- private global::Gtk.Action colorPicker;
-
- private global::Gtk.Action selectColor;
-
- private global::Gtk.Action quit;
-
- private global::Gtk.Action File;
-
- private global::Gtk.Action quit1;
-
- private global::Gtk.Action Help1;
-
- private global::Gtk.Action Help2;
-
- private global::Gtk.Action selectColor1;
-
- private global::Gtk.VBox vbox1;
-
- private global::Gtk.MenuBar menubar1;
-
- private global::Gtk.HBox hbox1;
-
- private global::Gtk.ComboBoxText comboboxentry1;
-
- private global::Gtk.Button btnNew;
-
- private global::Gtk.Button button2;
-
- private global::Gtk.Button btnDelete;
-
- private global::Gtk.HBox hbox2;
-
- private global::Gtk.Label lblPaletteName;
-
- private global::Gtk.Entry entry1;
-
- private global::Gtk.Button btnAdd;
-
- private global::Gtk.Button btnUpdate;
-
- private global::Gtk.Button btnCancle;
-
- private global::Gtk.Table table1;
-
- private global::Gtk.ColorButton colorbutton1;
-
- private global::Gtk.ColorButton colorbutton10;
-
- private global::Gtk.ColorButton colorbutton11;
-
- private global::Gtk.ColorButton colorbutton12;
-
- private global::Gtk.ColorButton colorbutton13;
-
- private global::Gtk.ColorButton colorbutton14;
-
- private global::Gtk.ColorButton colorbutton15;
-
- private global::Gtk.ColorButton colorbutton16;
-
- private global::Gtk.ColorButton colorbutton2;
-
- private global::Gtk.ColorButton colorbutton3;
-
- private global::Gtk.ColorButton colorbutton4;
-
- private global::Gtk.ColorButton colorbutton5;
-
- private global::Gtk.ColorButton colorbutton6;
-
- private global::Gtk.ColorButton colorbutton7;
-
- private global::Gtk.ColorButton colorbutton8;
-
- private global::Gtk.ColorButton colorbutton9;
-
- private global::Gtk.Entry entry2;
-
- private global::Gtk.Entry entry4;
-
- private global::Gtk.Label label2;
-
- private global::Gtk.Label label3;
-
- private global::Gtk.ColorSelection colorselection1;
-
- protected virtual void Build ()
- {
- global::Stetic.Gui.Initialize (this);
- // Widget MainWindow
- this.UIManager = new global::Gtk.UIManager ();
- global::Gtk.ActionGroup w1 = new global::Gtk.ActionGroup ("Default");
- this.Help = new global::Gtk.Action ("Help", "Help", null, null);
- this.Help.ShortLabel = "Help";
- w1.Add (this.Help, null);
- this.AboutUs = new global::Gtk.Action ("AboutUs", "About us", null, null);
- this.AboutUs.ShortLabel = "About us";
- w1.Add (this.AboutUs, null);
- this.help = new global::Gtk.Action ("help", "About us", null, "gtk-help");
- this.help.ShortLabel = "_Help";
- w1.Add (this.help, null);
- this.colorPicker = new global::Gtk.Action ("colorPicker", null, null, "gtk-color-picker");
- w1.Add (this.colorPicker, null);
- this.selectColor = new global::Gtk.Action ("selectColor", "_Color", null, "gtk-select-color");
- this.selectColor.ShortLabel = "_Color";
- w1.Add (this.selectColor, null);
- this.quit = new global::Gtk.Action ("quit", "_Quit", null, "gtk-quit");
- this.quit.ShortLabel = "_Quit";
- w1.Add (this.quit, null);
- this.File = new global::Gtk.Action ("File", " File", null, null);
- this.File.ShortLabel = " File";
- w1.Add (this.File, null);
- this.quit1 = new global::Gtk.Action ("quit1", "_Quit", null, "gtk-quit");
- this.quit1.ShortLabel = "_Quit";
- w1.Add (this.quit1, null);
- this.Help1 = new global::Gtk.Action ("Help1", "Help", null, null);
- this.Help1.ShortLabel = "Help";
- w1.Add (this.Help1, null);
- this.Help2 = new global::Gtk.Action ("Help2", "Help", null, null);
- this.Help2.ShortLabel = "Help";
- w1.Add (this.Help2, null);
- this.selectColor1 = new global::Gtk.Action ("selectColor1", "About Us", null, "gtk-dialog-info");
- this.selectColor1.ShortLabel = "About Us";
- w1.Add (this.selectColor1, null);
- this.UIManager.InsertActionGroup (w1, 0);
- this.AddAccelGroup (this.UIManager.AccelGroup);
- this.Name = "MainWindow";
- this.Title = "ColorPicker";
- this.Icon = global::Stetic.IconLoader.LoadIcon (this, "gtk-select-color", global::Gtk.IconSize.Menu);
- this.WindowPosition = ((global::Gtk.WindowPosition)(4));
- this.DefaultWidth = 13;
- // Container child MainWindow.Gtk.Container+ContainerChild
- this.vbox1 = new global::Gtk.VBox ();
- this.vbox1.Name = "vbox1";
- this.vbox1.Spacing = 6;
- // Container child vbox1.Gtk.Box+BoxChild
- this.UIManager.AddUiFromString ("");
- this.menubar1 = ((global::Gtk.MenuBar)(this.UIManager.GetWidget ("/menubar1")));
- this.menubar1.Name = "menubar1";
- this.vbox1.Add (this.menubar1);
- global::Gtk.Box.BoxChild w2 = ((global::Gtk.Box.BoxChild)(this.vbox1 [this.menubar1]));
- w2.Position = 0;
- w2.Expand = false;
- w2.Fill = false;
- // Container child vbox1.Gtk.Box+BoxChild
- this.hbox1 = new global::Gtk.HBox ();
- this.hbox1.Name = "hbox1";
- this.hbox1.Spacing = 6;
- // Container child hbox1.Gtk.Box+BoxChild
- this.comboboxentry1 = new global::Gtk.ComboBoxText ();
- this.comboboxentry1.Name = "comboboxentry1";
- this.hbox1.Add (this.comboboxentry1);
- global::Gtk.Box.BoxChild w3 = ((global::Gtk.Box.BoxChild)(this.hbox1 [this.comboboxentry1]));
- w3.Position = 0;
- w3.Expand = false;
- w3.Fill = false;
- // Container child hbox1.Gtk.Box+BoxChild
- this.btnNew = new global::Gtk.Button ();
- this.btnNew.CanFocus = true;
- this.btnNew.Name = "btnNew";
- this.btnNew.UseUnderline = true;
- this.btnNew.Label = "New";
- global::Gtk.Image w4 = new global::Gtk.Image ();
- w4.Pixbuf = global::Stetic.IconLoader.LoadIcon (this, "gtk-add", global::Gtk.IconSize.Menu);
- this.btnNew.Image = w4;
- this.hbox1.Add (this.btnNew);
- global::Gtk.Box.BoxChild w5 = ((global::Gtk.Box.BoxChild)(this.hbox1 [this.btnNew]));
- w5.Position = 1;
- w5.Expand = false;
- w5.Fill = false;
- // Container child hbox1.Gtk.Box+BoxChild
- this.button2 = new global::Gtk.Button ();
- this.button2.CanFocus = true;
- this.button2.Name = "button2";
- this.button2.UseUnderline = true;
- this.button2.Label = "Edit";
- global::Gtk.Image w6 = new global::Gtk.Image ();
- w6.Pixbuf = global::Stetic.IconLoader.LoadIcon (this, "gtk-edit", global::Gtk.IconSize.Menu);
- this.button2.Image = w6;
- this.hbox1.Add (this.button2);
- global::Gtk.Box.BoxChild w7 = ((global::Gtk.Box.BoxChild)(this.hbox1 [this.button2]));
- w7.Position = 2;
- w7.Expand = false;
- w7.Fill = false;
- // Container child hbox1.Gtk.Box+BoxChild
- this.btnDelete = new global::Gtk.Button ();
- this.btnDelete.CanFocus = true;
- this.btnDelete.Name = "btnDelete";
- this.btnDelete.UseUnderline = true;
- this.btnDelete.Label = "Delete";
- global::Gtk.Image w8 = new global::Gtk.Image ();
- w8.Pixbuf = global::Stetic.IconLoader.LoadIcon (this, "gtk-clear", global::Gtk.IconSize.Menu);
- this.btnDelete.Image = w8;
- this.hbox1.Add (this.btnDelete);
- global::Gtk.Box.BoxChild w9 = ((global::Gtk.Box.BoxChild)(this.hbox1 [this.btnDelete]));
- w9.Position = 3;
- w9.Expand = false;
- w9.Fill = false;
- this.vbox1.Add (this.hbox1);
- global::Gtk.Box.BoxChild w10 = ((global::Gtk.Box.BoxChild)(this.vbox1 [this.hbox1]));
- w10.Position = 1;
- w10.Expand = false;
- w10.Fill = false;
- // Container child vbox1.Gtk.Box+BoxChild
- this.hbox2 = new global::Gtk.HBox ();
- this.hbox2.Name = "hbox2";
- this.hbox2.Spacing = 6;
- // Container child hbox2.Gtk.Box+BoxChild
- this.lblPaletteName = new global::Gtk.Label ();
- this.lblPaletteName.Name = "lblPaletteName";
- this.lblPaletteName.LabelProp = "Enter name for a new Palette:";
- this.hbox2.Add (this.lblPaletteName);
- global::Gtk.Box.BoxChild w11 = ((global::Gtk.Box.BoxChild)(this.hbox2 [this.lblPaletteName]));
- w11.Position = 0;
- w11.Expand = false;
- w11.Fill = false;
- // Container child hbox2.Gtk.Box+BoxChild
- this.entry1 = new global::Gtk.Entry ();
- this.entry1.WidthRequest = 0;
- this.entry1.HeightRequest = 28;
- this.entry1.CanFocus = true;
- this.entry1.Name = "entry1";
- this.entry1.IsEditable = true;
- this.entry1.InvisibleChar = '•';
- this.hbox2.Add (this.entry1);
- global::Gtk.Box.BoxChild w12 = ((global::Gtk.Box.BoxChild)(this.hbox2 [this.entry1]));
- w12.Position = 1;
- // Container child hbox2.Gtk.Box+BoxChild
- this.btnAdd = new global::Gtk.Button ();
- this.btnAdd.CanFocus = true;
- this.btnAdd.Name = "btnAdd";
- this.btnAdd.UseUnderline = true;
- this.btnAdd.Label = "Add";
- this.hbox2.Add (this.btnAdd);
- global::Gtk.Box.BoxChild w13 = ((global::Gtk.Box.BoxChild)(this.hbox2 [this.btnAdd]));
- w13.Position = 2;
- w13.Expand = false;
- w13.Fill = false;
- // Container child hbox2.Gtk.Box+BoxChild
- this.btnUpdate = new global::Gtk.Button ();
- this.btnUpdate.CanFocus = true;
- this.btnUpdate.Name = "btnUpdate";
- this.btnUpdate.UseUnderline = true;
- this.btnUpdate.Label = "Update";
- this.hbox2.Add (this.btnUpdate);
- global::Gtk.Box.BoxChild w14 = ((global::Gtk.Box.BoxChild)(this.hbox2 [this.btnUpdate]));
- w14.Position = 3;
- w14.Expand = false;
- w14.Fill = false;
- // Container child hbox2.Gtk.Box+BoxChild
- this.btnCancle = new global::Gtk.Button ();
- this.btnCancle.CanFocus = true;
- this.btnCancle.Name = "btnCancle";
- this.btnCancle.UseUnderline = true;
- this.btnCancle.Label = "Cancel";
- this.hbox2.Add (this.btnCancle);
- global::Gtk.Box.BoxChild w15 = ((global::Gtk.Box.BoxChild)(this.hbox2 [this.btnCancle]));
- w15.Position = 4;
- w15.Expand = false;
- w15.Fill = false;
- this.vbox1.Add (this.hbox2);
- global::Gtk.Box.BoxChild w16 = ((global::Gtk.Box.BoxChild)(this.vbox1 [this.hbox2]));
- w16.Position = 2;
- w16.Expand = false;
- w16.Fill = false;
- // Container child vbox1.Gtk.Box+BoxChild
- this.table1 = new global::Gtk.Table (((uint)(2)), ((uint)(10)), false);
- this.table1.Name = "table1";
- this.table1.RowSpacing = ((uint)(6));
- this.table1.ColumnSpacing = ((uint)(6));
- this.table1.BorderWidth = ((uint)(12));
- // Container child table1.Gtk.Table+TableChild
- this.colorbutton1 = new global::Gtk.ColorButton ();
- this.colorbutton1.CanDefault = true;
- this.colorbutton1.CanFocus = true;
- this.colorbutton1.Events = ((global::Gdk.EventMask)(788));
- this.colorbutton1.Name = "colorbutton1";
- this.colorbutton1.Relief = ((global::Gtk.ReliefStyle)(1));
- this.table1.Add (this.colorbutton1);
- global::Gtk.Table.TableChild w17 = ((global::Gtk.Table.TableChild)(this.table1 [this.colorbutton1]));
- w17.XOptions = ((global::Gtk.AttachOptions)(4));
- w17.YOptions = ((global::Gtk.AttachOptions)(4));
- // Container child table1.Gtk.Table+TableChild
- this.colorbutton10 = new global::Gtk.ColorButton ();
- this.colorbutton10.CanFocus = true;
- this.colorbutton10.Events = ((global::Gdk.EventMask)(784));
- this.colorbutton10.Name = "colorbutton10";
- this.table1.Add (this.colorbutton10);
- global::Gtk.Table.TableChild w18 = ((global::Gtk.Table.TableChild)(this.table1 [this.colorbutton10]));
- w18.TopAttach = ((uint)(1));
- w18.BottomAttach = ((uint)(2));
- w18.LeftAttach = ((uint)(1));
- w18.RightAttach = ((uint)(2));
- w18.XOptions = ((global::Gtk.AttachOptions)(4));
- w18.YOptions = ((global::Gtk.AttachOptions)(4));
- // Container child table1.Gtk.Table+TableChild
- this.colorbutton11 = new global::Gtk.ColorButton ();
- this.colorbutton11.CanFocus = true;
- this.colorbutton11.Events = ((global::Gdk.EventMask)(784));
- this.colorbutton11.Name = "colorbutton11";
- this.table1.Add (this.colorbutton11);
- global::Gtk.Table.TableChild w19 = ((global::Gtk.Table.TableChild)(this.table1 [this.colorbutton11]));
- w19.TopAttach = ((uint)(1));
- w19.BottomAttach = ((uint)(2));
- w19.LeftAttach = ((uint)(2));
- w19.RightAttach = ((uint)(3));
- w19.XOptions = ((global::Gtk.AttachOptions)(4));
- w19.YOptions = ((global::Gtk.AttachOptions)(4));
- // Container child table1.Gtk.Table+TableChild
- this.colorbutton12 = new global::Gtk.ColorButton ();
- this.colorbutton12.CanFocus = true;
- this.colorbutton12.Events = ((global::Gdk.EventMask)(784));
- this.colorbutton12.Name = "colorbutton12";
- this.table1.Add (this.colorbutton12);
- global::Gtk.Table.TableChild w20 = ((global::Gtk.Table.TableChild)(this.table1 [this.colorbutton12]));
- w20.TopAttach = ((uint)(1));
- w20.BottomAttach = ((uint)(2));
- w20.LeftAttach = ((uint)(3));
- w20.RightAttach = ((uint)(4));
- w20.XOptions = ((global::Gtk.AttachOptions)(4));
- w20.YOptions = ((global::Gtk.AttachOptions)(4));
- // Container child table1.Gtk.Table+TableChild
- this.colorbutton13 = new global::Gtk.ColorButton ();
- this.colorbutton13.CanFocus = true;
- this.colorbutton13.Events = ((global::Gdk.EventMask)(784));
- this.colorbutton13.Name = "colorbutton13";
- this.table1.Add (this.colorbutton13);
- global::Gtk.Table.TableChild w21 = ((global::Gtk.Table.TableChild)(this.table1 [this.colorbutton13]));
- w21.TopAttach = ((uint)(1));
- w21.BottomAttach = ((uint)(2));
- w21.LeftAttach = ((uint)(4));
- w21.RightAttach = ((uint)(5));
- w21.XOptions = ((global::Gtk.AttachOptions)(4));
- w21.YOptions = ((global::Gtk.AttachOptions)(4));
- // Container child table1.Gtk.Table+TableChild
- this.colorbutton14 = new global::Gtk.ColorButton ();
- this.colorbutton14.CanFocus = true;
- this.colorbutton14.Events = ((global::Gdk.EventMask)(784));
- this.colorbutton14.Name = "colorbutton14";
- this.table1.Add (this.colorbutton14);
- global::Gtk.Table.TableChild w22 = ((global::Gtk.Table.TableChild)(this.table1 [this.colorbutton14]));
- w22.TopAttach = ((uint)(1));
- w22.BottomAttach = ((uint)(2));
- w22.LeftAttach = ((uint)(5));
- w22.RightAttach = ((uint)(6));
- w22.XOptions = ((global::Gtk.AttachOptions)(4));
- w22.YOptions = ((global::Gtk.AttachOptions)(4));
- // Container child table1.Gtk.Table+TableChild
- this.colorbutton15 = new global::Gtk.ColorButton ();
- this.colorbutton15.CanFocus = true;
- this.colorbutton15.Events = ((global::Gdk.EventMask)(784));
- this.colorbutton15.Name = "colorbutton15";
- this.table1.Add (this.colorbutton15);
- global::Gtk.Table.TableChild w23 = ((global::Gtk.Table.TableChild)(this.table1 [this.colorbutton15]));
- w23.TopAttach = ((uint)(1));
- w23.BottomAttach = ((uint)(2));
- w23.LeftAttach = ((uint)(6));
- w23.RightAttach = ((uint)(7));
- w23.XOptions = ((global::Gtk.AttachOptions)(4));
- w23.YOptions = ((global::Gtk.AttachOptions)(4));
- // Container child table1.Gtk.Table+TableChild
- this.colorbutton16 = new global::Gtk.ColorButton ();
- this.colorbutton16.CanFocus = true;
- this.colorbutton16.Events = ((global::Gdk.EventMask)(784));
- this.colorbutton16.Name = "colorbutton16";
- this.table1.Add (this.colorbutton16);
- global::Gtk.Table.TableChild w24 = ((global::Gtk.Table.TableChild)(this.table1 [this.colorbutton16]));
- w24.TopAttach = ((uint)(1));
- w24.BottomAttach = ((uint)(2));
- w24.LeftAttach = ((uint)(7));
- w24.RightAttach = ((uint)(8));
- w24.XOptions = ((global::Gtk.AttachOptions)(4));
- w24.YOptions = ((global::Gtk.AttachOptions)(4));
- // Container child table1.Gtk.Table+TableChild
- this.colorbutton2 = new global::Gtk.ColorButton ();
- this.colorbutton2.CanFocus = true;
- this.colorbutton2.Events = ((global::Gdk.EventMask)(784));
- this.colorbutton2.Name = "colorbutton2";
- this.table1.Add (this.colorbutton2);
- global::Gtk.Table.TableChild w25 = ((global::Gtk.Table.TableChild)(this.table1 [this.colorbutton2]));
- w25.LeftAttach = ((uint)(1));
- w25.RightAttach = ((uint)(2));
- w25.XOptions = ((global::Gtk.AttachOptions)(4));
- w25.YOptions = ((global::Gtk.AttachOptions)(4));
- // Container child table1.Gtk.Table+TableChild
- this.colorbutton3 = new global::Gtk.ColorButton ();
- this.colorbutton3.CanFocus = true;
- this.colorbutton3.Events = ((global::Gdk.EventMask)(784));
- this.colorbutton3.Name = "colorbutton3";
- this.table1.Add (this.colorbutton3);
- global::Gtk.Table.TableChild w26 = ((global::Gtk.Table.TableChild)(this.table1 [this.colorbutton3]));
- w26.LeftAttach = ((uint)(2));
- w26.RightAttach = ((uint)(3));
- w26.XOptions = ((global::Gtk.AttachOptions)(4));
- w26.YOptions = ((global::Gtk.AttachOptions)(4));
- // Container child table1.Gtk.Table+TableChild
- this.colorbutton4 = new global::Gtk.ColorButton ();
- this.colorbutton4.CanFocus = true;
- this.colorbutton4.Events = ((global::Gdk.EventMask)(784));
- this.colorbutton4.Name = "colorbutton4";
- this.table1.Add (this.colorbutton4);
- global::Gtk.Table.TableChild w27 = ((global::Gtk.Table.TableChild)(this.table1 [this.colorbutton4]));
- w27.LeftAttach = ((uint)(3));
- w27.RightAttach = ((uint)(4));
- w27.XOptions = ((global::Gtk.AttachOptions)(4));
- w27.YOptions = ((global::Gtk.AttachOptions)(4));
- // Container child table1.Gtk.Table+TableChild
- this.colorbutton5 = new global::Gtk.ColorButton ();
- this.colorbutton5.CanFocus = true;
- this.colorbutton5.Events = ((global::Gdk.EventMask)(784));
- this.colorbutton5.Name = "colorbutton5";
- this.table1.Add (this.colorbutton5);
- global::Gtk.Table.TableChild w28 = ((global::Gtk.Table.TableChild)(this.table1 [this.colorbutton5]));
- w28.LeftAttach = ((uint)(4));
- w28.RightAttach = ((uint)(5));
- w28.XOptions = ((global::Gtk.AttachOptions)(4));
- w28.YOptions = ((global::Gtk.AttachOptions)(4));
- // Container child table1.Gtk.Table+TableChild
- this.colorbutton6 = new global::Gtk.ColorButton ();
- this.colorbutton6.CanFocus = true;
- this.colorbutton6.Events = ((global::Gdk.EventMask)(784));
- this.colorbutton6.Name = "colorbutton6";
- this.table1.Add (this.colorbutton6);
- global::Gtk.Table.TableChild w29 = ((global::Gtk.Table.TableChild)(this.table1 [this.colorbutton6]));
- w29.LeftAttach = ((uint)(5));
- w29.RightAttach = ((uint)(6));
- w29.XOptions = ((global::Gtk.AttachOptions)(4));
- w29.YOptions = ((global::Gtk.AttachOptions)(4));
- // Container child table1.Gtk.Table+TableChild
- this.colorbutton7 = new global::Gtk.ColorButton ();
- this.colorbutton7.CanFocus = true;
- this.colorbutton7.Events = ((global::Gdk.EventMask)(784));
- this.colorbutton7.Name = "colorbutton7";
- this.table1.Add (this.colorbutton7);
- global::Gtk.Table.TableChild w30 = ((global::Gtk.Table.TableChild)(this.table1 [this.colorbutton7]));
- w30.LeftAttach = ((uint)(6));
- w30.RightAttach = ((uint)(7));
- w30.XOptions = ((global::Gtk.AttachOptions)(4));
- w30.YOptions = ((global::Gtk.AttachOptions)(4));
- // Container child table1.Gtk.Table+TableChild
- this.colorbutton8 = new global::Gtk.ColorButton ();
- this.colorbutton8.CanFocus = true;
- this.colorbutton8.Events = ((global::Gdk.EventMask)(784));
- this.colorbutton8.Name = "colorbutton8";
- this.table1.Add (this.colorbutton8);
- global::Gtk.Table.TableChild w31 = ((global::Gtk.Table.TableChild)(this.table1 [this.colorbutton8]));
- w31.LeftAttach = ((uint)(7));
- w31.RightAttach = ((uint)(8));
- w31.XOptions = ((global::Gtk.AttachOptions)(4));
- w31.YOptions = ((global::Gtk.AttachOptions)(4));
- // Container child table1.Gtk.Table+TableChild
- this.colorbutton9 = new global::Gtk.ColorButton ();
- this.colorbutton9.CanFocus = true;
- this.colorbutton9.Events = ((global::Gdk.EventMask)(784));
- this.colorbutton9.Name = "colorbutton9";
- this.table1.Add (this.colorbutton9);
- global::Gtk.Table.TableChild w32 = ((global::Gtk.Table.TableChild)(this.table1 [this.colorbutton9]));
- w32.TopAttach = ((uint)(1));
- w32.BottomAttach = ((uint)(2));
- w32.XOptions = ((global::Gtk.AttachOptions)(4));
- w32.YOptions = ((global::Gtk.AttachOptions)(4));
- // Container child table1.Gtk.Table+TableChild
- this.entry2 = new global::Gtk.Entry ();
- this.entry2.CanFocus = true;
- this.entry2.Name = "entry2";
- this.entry2.IsEditable = false;
- this.entry2.WidthChars = 8;
- this.entry2.InvisibleChar = '•';
- this.table1.Add (this.entry2);
- global::Gtk.Table.TableChild w33 = ((global::Gtk.Table.TableChild)(this.table1 [this.entry2]));
- w33.TopAttach = ((uint)(1));
- w33.BottomAttach = ((uint)(2));
- w33.LeftAttach = ((uint)(9));
- w33.RightAttach = ((uint)(10));
- w33.YOptions = ((global::Gtk.AttachOptions)(4));
- // Container child table1.Gtk.Table+TableChild
- this.entry4 = new global::Gtk.Entry ();
- this.entry4.CanFocus = true;
- this.entry4.Name = "entry4";
- this.entry4.IsEditable = false;
- this.entry4.WidthChars = 8;
- this.entry4.MaxLength = 8;
- this.entry4.InvisibleChar = '•';
- this.table1.Add (this.entry4);
- global::Gtk.Table.TableChild w34 = ((global::Gtk.Table.TableChild)(this.table1 [this.entry4]));
- w34.LeftAttach = ((uint)(9));
- w34.RightAttach = ((uint)(10));
- w34.YOptions = ((global::Gtk.AttachOptions)(4));
- // Container child table1.Gtk.Table+TableChild
- this.label2 = new global::Gtk.Label ();
- this.label2.Name = "label2";
- this.label2.LabelProp = "WebSnap";
- this.table1.Add (this.label2);
- global::Gtk.Table.TableChild w35 = ((global::Gtk.Table.TableChild)(this.table1 [this.label2]));
- w35.TopAttach = ((uint)(1));
- w35.BottomAttach = ((uint)(2));
- w35.LeftAttach = ((uint)(8));
- w35.RightAttach = ((uint)(9));
- w35.XOptions = ((global::Gtk.AttachOptions)(4));
- w35.YOptions = ((global::Gtk.AttachOptions)(4));
- // Container child table1.Gtk.Table+TableChild
- this.label3 = new global::Gtk.Label ();
- this.label3.Name = "label3";
- this.label3.LabelProp = "#";
- this.table1.Add (this.label3);
- global::Gtk.Table.TableChild w36 = ((global::Gtk.Table.TableChild)(this.table1 [this.label3]));
- w36.LeftAttach = ((uint)(8));
- w36.RightAttach = ((uint)(9));
- w36.XOptions = ((global::Gtk.AttachOptions)(4));
- w36.YOptions = ((global::Gtk.AttachOptions)(4));
- this.vbox1.Add (this.table1);
- global::Gtk.Box.BoxChild w37 = ((global::Gtk.Box.BoxChild)(this.vbox1 [this.table1]));
- w37.Position = 3;
- w37.Expand = false;
- w37.Fill = false;
- // Container child vbox1.Gtk.Box+BoxChild
- this.colorselection1 = new global::Gtk.ColorSelection ();
- this.colorselection1.Name = "colorselection1";
- this.colorselection1.HasOpacityControl = true;
- this.vbox1.Add (this.colorselection1);
- global::Gtk.Box.BoxChild w38 = ((global::Gtk.Box.BoxChild)(this.vbox1 [this.colorselection1]));
- w38.Position = 4;
- this.Add (this.vbox1);
- if ((this.Child != null)) {
- this.Child.ShowAll ();
- }
- this.DefaultHeight = 511;
- this.btnUpdate.Hide ();
- this.hbox2.Hide ();
- this.Show ();
- this.DeleteEvent += new global::Gtk.DeleteEventHandler (this.OnDeleteEvent);
- this.quit.Activated += new global::System.EventHandler (this.OnQuitActionActivated);
- this.quit1.Activated += new global::System.EventHandler (this.QuitClicked);
- this.selectColor1.Activated += new global::System.EventHandler (this.AboutusClicked);
- this.comboboxentry1.Changed += new global::System.EventHandler (this.Cmb_Changed);
- this.btnNew.Clicked += new global::System.EventHandler (this.OnBtnNewClicked);
- this.button2.Clicked += new global::System.EventHandler (this.onBtnEditClicked);
- this.btnDelete.Clicked += new global::System.EventHandler (this.onBtnDeleteClicked);
- this.btnAdd.Clicked += new global::System.EventHandler (this.add_Click);
- this.btnUpdate.Clicked += new global::System.EventHandler (this.btnUpdateClick);
- this.btnCancle.Clicked += new global::System.EventHandler (this.OnBtnCancleClicked);
- this.colorbutton9.ColorSet += new global::System.EventHandler (this.OnColorbutton9ColorSet);
- this.colorbutton8.ColorSet += new global::System.EventHandler (this.OnColorbutton8ColorSet);
- this.colorbutton7.ColorSet += new global::System.EventHandler (this.OnColorbutton7ColorSet);
- this.colorbutton6.ColorSet += new global::System.EventHandler (this.OnColorbutton6ColorSet);
- this.colorbutton5.ColorSet += new global::System.EventHandler (this.OnColorbutton5ColorSet);
- this.colorbutton4.ColorSet += new global::System.EventHandler (this.OnColorbutton4ColorSet);
- this.colorbutton3.ColorSet += new global::System.EventHandler (this.OnColorbutton3ColorSet);
- this.colorbutton2.ColorSet += new global::System.EventHandler (this.OnColorbutton2ColorSet);
- this.colorbutton16.ColorSet += new global::System.EventHandler (this.OnColorbutton16ColorSet);
- this.colorbutton15.ColorSet += new global::System.EventHandler (this.OnColorbutton15ColorSet);
- this.colorbutton14.ColorSet += new global::System.EventHandler (this.OnColorbutton14ColorSet);
- this.colorbutton13.ColorSet += new global::System.EventHandler (this.OnColorbutton13ColorSet);
- this.colorbutton12.ColorSet += new global::System.EventHandler (this.OnColorbutton12ColorSet);
- this.colorbutton11.ColorSet += new global::System.EventHandler (this.OnColorbutton11ColorSet);
- this.colorbutton10.ColorSet += new global::System.EventHandler (this.OnColorbutton10ColorSet);
- this.colorbutton1.Clicked += new global::System.EventHandler (this.OnCbtnClick);
- this.colorbutton1.ColorSet += new global::System.EventHandler (this.OnColorbutton1ColorSet);
- this.colorbutton1.Released += new global::System.EventHandler (this.cbtn_Released);
- }
-}
diff --git a/ColorManager/gtk-gui/generated.cs b/ColorManager/gtk-gui/generated.cs
deleted file mode 100644
index 3287ab2..0000000
--- a/ColorManager/gtk-gui/generated.cs
+++ /dev/null
@@ -1,63 +0,0 @@
-
-// This file has been generated by the GUI designer. Do not modify.
-namespace Stetic
-{
- internal class Gui
- {
- private static bool initialized;
-
- internal static void Initialize (Gtk.Widget iconRenderer)
- {
- if ((Stetic.Gui.initialized == false)) {
- Stetic.Gui.initialized = true;
- }
- }
- }
-
- internal class IconLoader
- {
- public static Gdk.Pixbuf LoadIcon (Gtk.Widget widget, string name, Gtk.IconSize size)
- {
- // Try rendering the icon from the widget first
- Gdk.Pixbuf res = null;
- try {
- res = widget.RenderIcon (name, size, null);
- } catch {
- res = null;
- }
- if (res != null) {
- return res;
- }
- int sz;
- int sy;
- global::Gtk.Icon.SizeLookup (size, out sz, out sy);
- try {
- return Gtk.IconTheme.Default.LoadIcon (name, sz, 0);
- } catch (System.Exception) {
- if (name != "gtk-missing-image") {
- return Stetic.IconLoader.LoadIcon (widget, "gtk-missing-image", size);
- } else {
- // Create a plain empty Pixbuf as a fallback instead of using deprecated Gdk.Pixmap/GC
- try {
- return new Gdk.Pixbuf (Gdk.Colorspace.Rgb, false, 8, sz, sz);
- } catch {
- return null;
- }
- }
- }
- }
- }
-
- internal class ActionGroups
- {
- public static Gtk.ActionGroup GetActionGroup (System.Type type)
- {
- return Stetic.ActionGroups.GetActionGroup (type.FullName);
- }
-
- public static Gtk.ActionGroup GetActionGroup (string name)
- {
- return null;
- }
- }
-}
diff --git a/ColorManager/gtk-gui/gui.stetic b/ColorManager/gtk-gui/gui.stetic
deleted file mode 100644
index 2178dd6..0000000
--- a/ColorManager/gtk-gui/gui.stetic
+++ /dev/null
@@ -1,1234 +0,0 @@
-
-
-
- ..
- 2.12
-
-
-
-
-
-
-
- Action
- Help
- Help
-
-
- Action
- About us
- About us
-
-
- Action
- About us
- _Help
- gtk-help
-
-
- Action
-
- gtk-color-picker
-
-
- Action
- _Color
- _Color
- gtk-select-color
-
-
- Action
- _Quit
- _Quit
- gtk-quit
-
-
- Action
- File
- File
-
-
- Action
- _Quit
- _Quit
- gtk-quit
-
-
-
- Action
- Help
- Help
-
-
- Action
- Help
- Help
-
-
- Action
- About Us
- About Us
- gtk-dialog-info
-
-
-
-
- ColorPicker
- stock:gtk-select-color Menu
- CenterOnParent
- 13
-
-
-
-
- 6
-
-
-
- 0
- True
- False
- False
-
-
-
-
-
- 6
-
-
-
- True
-
-
-
-
- 0
- True
- False
- False
-
-
-
-
- btn_New
- True
- TextAndIcon
- stock:gtk-add Menu
- New
- True
-
-
-
- 1
- True
- False
- False
-
-
-
-
- btn_Edit
- True
- TextAndIcon
- stock:gtk-edit Menu
- Edit
- True
-
-
-
- 2
- True
- False
- False
-
-
-
-
-
- True
- TextAndIcon
- stock:gtk-clear Menu
- Delete
- True
-
-
-
- 3
- True
- False
- False
-
-
-
-
- 1
- True
- False
- False
-
-
-
-
-
- False
- 6
-
-
-
- Enter name for a new Palette:
-
-
- 0
- True
- False
- False
-
-
-
-
-
- 0
- 28
- True
- True
- •
-
-
- 1
- True
-
-
-
-
-
- True
- TextOnly
- Add
- True
-
-
-
- 2
- True
- False
- False
-
-
-
-
-
- False
- True
- TextOnly
- Update
- True
-
-
-
- 3
- True
- False
- False
-
-
-
-
-
- True
- TextOnly
- Cancel
- True
-
-
-
- 4
- True
- False
- False
-
-
-
-
- 2
- True
- False
- False
-
-
-
-
-
- 2
- 10
- 6
- 6
- 12
-
-
-
- True
- True
- PointerMotionMask, ButtonMotionMask, ButtonPressMask, ButtonReleaseMask
- -1
- Half
-
-
-
-
-
- False
- Fill
- Fill
- False
- True
- False
- False
- True
- False
-
-
-
-
-
- True
- ButtonMotionMask, ButtonPressMask, ButtonReleaseMask
- -1
-
-
-
- 1
- 2
- 1
- 2
- True
- Fill
- Fill
- False
- True
- False
- False
- True
- False
-
-
-
-
-
- True
- ButtonMotionMask, ButtonPressMask, ButtonReleaseMask
- -1
-
-
-
- 1
- 2
- 2
- 3
- True
- Fill
- Fill
- False
- True
- False
- False
- True
- False
-
-
-
-
-
- True
- ButtonMotionMask, ButtonPressMask, ButtonReleaseMask
- -1
-
-
-
- 1
- 2
- 3
- 4
- True
- Fill
- Fill
- False
- True
- False
- False
- True
- False
-
-
-
-
-
- True
- ButtonMotionMask, ButtonPressMask, ButtonReleaseMask
- -1
-
-
-
- 1
- 2
- 4
- 5
- True
- Fill
- Fill
- False
- True
- False
- False
- True
- False
-
-
-
-
-
- True
- ButtonMotionMask, ButtonPressMask, ButtonReleaseMask
- -1
-
-
-
- 1
- 2
- 5
- 6
- True
- Fill
- Fill
- False
- True
- False
- False
- True
- False
-
-
-
-
-
- True
- ButtonMotionMask, ButtonPressMask, ButtonReleaseMask
- -1
-
-
-
- 1
- 2
- 6
- 7
- True
- Fill
- Fill
- False
- True
- False
- False
- True
- False
-
-
-
-
-
- True
- ButtonMotionMask, ButtonPressMask, ButtonReleaseMask
- -1
-
-
-
- 1
- 2
- 7
- 8
- True
- Fill
- Fill
- False
- True
- False
- False
- True
- False
-
-
-
-
-
- True
- ButtonMotionMask, ButtonPressMask, ButtonReleaseMask
- -1
-
-
-
- 1
- 2
- True
- Fill
- Fill
- False
- True
- False
- False
- True
- False
-
-
-
-
-
- True
- ButtonMotionMask, ButtonPressMask, ButtonReleaseMask
- -1
-
-
-
- 2
- 3
- True
- Fill
- Fill
- False
- True
- False
- False
- True
- False
-
-
-
-
-
- True
- ButtonMotionMask, ButtonPressMask, ButtonReleaseMask
- -1
-
-
-
- 3
- 4
- True
- Fill
- Fill
- False
- True
- False
- False
- True
- False
-
-
-
-
-
- True
- ButtonMotionMask, ButtonPressMask, ButtonReleaseMask
- -1
-
-
-
- 4
- 5
- True
- Fill
- Fill
- False
- True
- False
- False
- True
- False
-
-
-
-
-
- True
- ButtonMotionMask, ButtonPressMask, ButtonReleaseMask
- -1
-
-
-
- 5
- 6
- True
- Fill
- Fill
- False
- True
- False
- False
- True
- False
-
-
-
-
-
- True
- ButtonMotionMask, ButtonPressMask, ButtonReleaseMask
- -1
-
-
-
- 6
- 7
- True
- Fill
- Fill
- False
- True
- False
- False
- True
- False
-
-
-
-
-
- True
- ButtonMotionMask, ButtonPressMask, ButtonReleaseMask
- -1
-
-
-
- 7
- 8
- True
- Fill
- Fill
- False
- True
- False
- False
- True
- False
-
-
-
-
-
- True
- ButtonMotionMask, ButtonPressMask, ButtonReleaseMask
- -1
-
-
-
- 1
- 2
- True
- Fill
- Fill
- False
- True
- False
- False
- True
- False
-
-
-
-
-
- True
- False
- 8
- •
-
-
- 1
- 2
- 9
- 10
- True
- Fill
- True
- True
- False
- False
- True
- False
-
-
-
-
-
- True
- False
- 8
- 8
- •
-
-
- 9
- 10
- True
- Fill
- True
- True
- False
- False
- True
- False
-
-
-
-
-
- WebSnap
-
-
- 1
- 2
- 8
- 9
- True
- Fill
- Fill
- False
- True
- False
- False
- True
- False
-
-
-
-
-
- #
-
-
- 8
- 9
- True
- Fill
- Fill
- False
- True
- False
- False
- True
- False
-
-
-
-
- 3
- True
- False
- False
-
-
-
-
-
- True
-
-
- 4
- True
-
-
-
-
-
-
-
-
- Action
- _File
- _File
-
-
- Action
- _Quit
- _Quit
- gtk-quit
-
-
- Action
- _Help
- _Help
-
-
-
- False
- Color Manager
- CenterOnParent
-
-
-
- 6
-
-
-
- 0
- True
- False
- False
-
-
-
-
-
- 6
-
-
-
- Select Palette
-
-
- 0
- True
- False
- False
-
-
-
-
-
- True
-
-
-
-
- 1
- True
- False
- False
-
-
-
-
-
-
-
-
- True
- TextAndIcon
- stock:gtk-add Menu
- Create Palette
- True
-
-
-
- 3
- True
- False
- False
-
-
-
-
-
- True
- TextAndIcon
- stock:gtk-close Menu
- Delete
- True
-
-
-
- 4
- True
- False
- False
-
-
-
-
- 1
- True
- False
- False
-
-
-
-
-
- 6
-
-
-
- Enter palette name
-
-
- 0
- True
- False
- False
-
-
-
-
-
- True
- True
- ●
-
-
- 1
- True
-
-
-
-
-
- True
- TextOnly
- Create
- True
-
-
-
- 2
- True
- False
- False
-
-
-
-
- 2
- True
- False
- False
-
-
-
-
-
- 2
- 7
- 6
- 6
-
-
-
-
-
-
-
-
-
- True
- ButtonMotionMask, ButtonPressMask, ButtonReleaseMask
- -1
-
-
-
- True
- Fill
- Fill
- False
- True
- False
- False
- True
- False
-
-
-
-
-
- True
- ButtonMotionMask, ButtonPressMask, ButtonReleaseMask
- -1
-
-
-
- 1
- 2
- 4
- 5
- True
- Fill
- Fill
- False
- True
- False
- False
- True
- False
-
-
-
-
-
- True
- ButtonMotionMask, ButtonPressMask, ButtonReleaseMask
- -1
-
-
-
- 1
- 2
- True
- Fill
- Fill
- False
- True
- False
- False
- True
- False
-
-
-
-
-
- True
- ButtonMotionMask, ButtonPressMask, ButtonReleaseMask
- -1
-
-
-
- 2
- 3
- True
- Fill
- Fill
- False
- True
- False
- False
- True
- False
-
-
-
-
-
- True
- ButtonMotionMask, ButtonPressMask, ButtonReleaseMask
- -1
-
-
-
- 3
- 4
- True
- Fill
- Fill
- False
- True
- False
- False
- True
- False
-
-
-
-
-
- True
- ButtonMotionMask, ButtonPressMask, ButtonReleaseMask
- -1
-
-
-
- 4
- 5
- True
- Fill
- Fill
- False
- True
- False
- False
- True
- False
-
-
-
-
-
- True
- ButtonMotionMask, ButtonPressMask, ButtonReleaseMask
- -1
-
-
-
- 1
- 2
- True
- Fill
- Fill
- False
- True
- False
- False
- True
- False
-
-
-
-
-
- True
- ButtonMotionMask, ButtonPressMask, ButtonReleaseMask
- -1
-
-
-
- 1
- 2
- 1
- 2
- True
- Fill
- Fill
- False
- True
- False
- False
- True
- False
-
-
-
-
-
- True
- ButtonMotionMask, ButtonPressMask, ButtonReleaseMask
- -1
-
-
-
- 1
- 2
- 2
- 3
- True
- Fill
- Fill
- False
- True
- False
- False
- True
- False
-
-
-
-
-
- True
- ButtonMotionMask, ButtonPressMask, ButtonReleaseMask
- -1
-
-
-
- 1
- 2
- 3
- 4
- True
- Fill
- Fill
- False
- True
- False
- False
- True
- False
-
-
-
-
-
- Color Code
-
-
- 5
- 6
- True
- Fill
- Fill
- False
- True
- False
- False
- True
- False
-
-
-
-
-
- True
- True
- •
-
-
- 6
- 7
- True
- Fill
- True
- True
- False
- False
- True
- False
-
-
-
-
- 3
- True
- False
- False
-
-
-
-
-
- True
-
-
- 4
- True
-
-
-
-
-
- Ready
- True
-
-
- 5
- True
- False
- False
-
-
-
-
-
-
\ No newline at end of file