[longomatch] Add Hotkey property for tags



commit eb7dab29bd2f5af5e29d7870cf70742412d03a24
Author: Andoni Morales Alastruey <ylatuya gmail com>
Date:   Thu Nov 13 17:24:44 2014 +0100

    Add Hotkey property for tags

 LongoMatch.Core/Store/DashboardButton.cs |   13 ++++++++++++-
 LongoMatch.Core/Store/Tag.cs             |   22 +++++++++++++---------
 2 files changed, 25 insertions(+), 10 deletions(-)
---
diff --git a/LongoMatch.Core/Store/DashboardButton.cs b/LongoMatch.Core/Store/DashboardButton.cs
index 502e498..fa3d833 100644
--- a/LongoMatch.Core/Store/DashboardButton.cs
+++ b/LongoMatch.Core/Store/DashboardButton.cs
@@ -66,7 +66,7 @@ namespace LongoMatch.Core.Store
                        set;
                }
 
-               public HotKey HotKey {
+               public virtual HotKey HotKey {
                        get;
                        set;
                }
@@ -134,6 +134,17 @@ namespace LongoMatch.Core.Store
                        set;
                }
 
+               public override HotKey HotKey {
+                       get {
+                               return Tag.HotKey;
+                       }
+                       set {
+                               if (Tag != null) {
+                                       Tag.HotKey = value;
+                               }
+                       }
+               }
+
                public override string Name {
                        get {
                                return Tag != null ? Tag.Value : null;
diff --git a/LongoMatch.Core/Store/Tag.cs b/LongoMatch.Core/Store/Tag.cs
index 0d884ef..9ee2847 100644
--- a/LongoMatch.Core/Store/Tag.cs
+++ b/LongoMatch.Core/Store/Tag.cs
@@ -15,43 +15,47 @@
 //  along with this program; if not, write to the Free Software
 //  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
 //
-
 using System;
 using System.Linq;
 using System.Collections.Generic;
-
 using LongoMatch.Core.Common;
 using LongoMatch.Core.Interfaces;
 
 namespace LongoMatch.Core.Store
 {
-
        [Serializable]
        public class Tag
        {
-               public Tag (string value, string grp="Default") {
+               public Tag (string value, string grp="Default")
+               {
                        Group = grp;
                        Value = value;
+                       HotKey = new HotKey ();
                }
-               
+
                public string Group {
                        set;
                        get;
                }
-               
+
                public string Value {
                        get;
                        set;
                }
-               
+
+               public HotKey HotKey {
+                       get;
+                       set;
+               }
+
                public override bool Equals (object obj)
                {
                        Tag tag = obj as Tag;
-            if (tag == null)
+                       if (tag == null)
                                return false;
                        return Value == tag.Value && Group == tag.Group;
                }
-               
+
                public override int GetHashCode ()
                {
                        if (Value != null && Group != null) {


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]