From: <nic...@us...> - 2014-05-11 12:58:34
|
Revision: 4802 http://sourceforge.net/p/mp-plugins/code/4802 Author: nicsergio Date: 2014-05-11 12:58:31 +0000 (Sun, 11 May 2014) Log Message: ----------- Modified Paths: -------------- trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuts.cs Modified: trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuts.cs =================================================================== --- trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuts.cs 2014-05-09 22:39:13 UTC (rev 4801) +++ trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuts.cs 2014-05-11 12:58:31 UTC (rev 4802) @@ -159,12 +159,22 @@ } public WindowLink Clone() //Clonazione collegamento { - WindowLink lnk = new WindowLink(); + WindowLink lnk = new WindowLink(); lnk.Caption = _caption; lnk.WindowID = _windowID; lnk.LoadParameter = _loadParameter; return lnk; } + public WindowLink GetData(WindowLink lnk) //Copiatura dati da un'altro collegamento + { + if (lnk != null) + { + _caption = lnk.Caption; + _windowID = lnk.WindowID; + _loadParameter = lnk.LoadParameter; + } + return this; + } public void Reset() //Reset destinazione (invalidazione) { _windowID = InvalidID; //--> invalidazione Id finestra @@ -315,16 +325,15 @@ public void Play() { Play(false); } //Manda effetto sonoro dello shortcut public ShortCut Clone() //Clonazione shortcut { - ShortCut sc = new ShortCut(); - sc.Caption = _caption; - sc.Key = _keys.Key; - sc.Ctrl = _keys.Ctrl; - sc.Alt = _keys.Alt; - sc.Shift = _keys.Shift; - sc.WindowID = _destination.WindowID; - sc.LoadParameter = _destination.LoadParameter; - sc.Return = _return; - sc.SoundEffect = _soundEffect; + ShortCut sc = new ShortCut(); + sc.Caption = _caption; + sc.Key = _keys.Key; + sc.Ctrl = _keys.Ctrl; + sc.Alt = _keys.Alt; + sc.Shift = _keys.Shift; + sc._destination = _destination.Clone(); + sc.Return = _return; + sc.SoundEffect = _soundEffect; return sc; } public override string ToString() //Override metodo ToString per stampare le proprietà dello shortcut @@ -338,17 +347,18 @@ #endregion #region Proprietà - public bool IsValid { get { return this._destination.IsValid && this._keys.IsValid; } } - public bool IsNavigator { get { return this._destination.IsNavigator; } } - public string Caption { get { return this._caption; } set { this._caption = value; this.NotifyPropertyChanged("Caption"); } } - public string Key { get { return this._keys.Key; } set { this._keys.Key = value; this.NotifyPropertyChanged("Key"); } } - public bool Ctrl { get { return this._keys.Ctrl; } set { this._keys.Ctrl = value; this.NotifyPropertyChanged("Ctrl"); } } - public bool Alt { get { return this._keys.Alt; } set { this._keys.Alt = value; this.NotifyPropertyChanged("Alt"); } } - public bool Shift { get { return this._keys.Shift; } set { this._keys.Shift = value; this.NotifyPropertyChanged("Shift"); } } - public int WindowID { get { return this._destination.WindowID; } set { this._destination.WindowID = value; this.NotifyPropertyChanged("WindowID"); } } - public string LoadParameter { get { return this._destination.LoadParameter; } set { this._destination.LoadParameter = value; this.NotifyPropertyChanged("LoadParameter"); } } - public bool Return { get { return this._return; } set { this._return = value; this.NotifyPropertyChanged("Return"); } } - public string SoundEffect { get { return this._soundEffect; } set { this._soundEffect = value; this.NotifyPropertyChanged("SoundEffect"); } } + public bool IsValid { get { return this._destination.IsValid && this._keys.IsValid; } } + public bool IsNavigator { get { return this._destination.IsNavigator; } } + public string Caption { get { return this._caption; } set { this._caption = value; this.NotifyPropertyChanged("Caption"); } } + public string Key { get { return this._keys.Key; } set { this._keys.Key = value; this.NotifyPropertyChanged("Key"); } } + public bool Ctrl { get { return this._keys.Ctrl; } set { this._keys.Ctrl = value; this.NotifyPropertyChanged("Ctrl"); } } + public bool Alt { get { return this._keys.Alt; } set { this._keys.Alt = value; this.NotifyPropertyChanged("Alt"); } } + public bool Shift { get { return this._keys.Shift; } set { this._keys.Shift = value; this.NotifyPropertyChanged("Shift"); } } + public int WindowID { get { return this._destination.WindowID; } set { this._destination.WindowID = value; this.NotifyPropertyChanged("WindowID"); } } + public string LoadParameter { get { return this._destination.LoadParameter; } set { this._destination.LoadParameter = value; this.NotifyPropertyChanged("LoadParameter"); } } + public bool Return { get { return this._return; } set { this._return = value; this.NotifyPropertyChanged("Return"); } } + public string SoundEffect { get { return this._soundEffect; } set { this._soundEffect = value; this.NotifyPropertyChanged("SoundEffect"); } } + public WindowLink Destination { get { return this._destination.Clone(); } } #endregion } internal class ShortCuts //Classe di gestione degli shortcuts configurati @@ -422,7 +432,9 @@ #endregion #region Proprietà - public bool Force { get { return this._force; } set { this._force = value; } } + public new bool IsValid { get { return (base.IsValid && !base.IsNavigator); } } + private new bool IsNavigator { get { return false; } } + public bool Force { get { return this._force; } set { this._force = value; } } #endregion } #endregion @@ -527,12 +539,7 @@ dlgLinks.Add(null); } dlgMenu.Add(dst.Caption); //--> aggiunta voce di menu - - WindowLink lnk = new WindowLink(); - lnk.WindowID = dst.WindowID; - lnk.Caption = dst.Caption; - lnk.LoadParameter = dst.LoadParameter; - dlgLinks.Add(lnk); //--> aggiunta destinazione corrispondente + dlgLinks.Add(new WindowLink().GetData(dst)); //--> aggiunta destinazione corrispondente (classe WindowLink) first = false; } } @@ -859,12 +866,7 @@ if (sc != null) //Se combinazione di tasti corrispondente a Skin Navigator { sc.Play(); //--> eventuale effetto sonoro - WindowLink dst = Navigator.Go(Log); //--> gestione navigazione alla destinazione selezionata - if (dst != null) //Se attivata correttamente una destinazione - { - lastDestination.WindowID = dst.WindowID; //--> memorizzazione id finestra - lastDestination.LoadParameter = dst.LoadParameter; //--> memorizzazione parametri di caricamento utilizzati - } + lastDestination.GetData(Navigator.Go(Log)); //--> gestione navigazione alla destinazione selezionata (ed eventuale memorizzazione) } else //Shortcuts normali if (scList.Count == 1) //Shortcut a destinazione singola @@ -873,10 +875,7 @@ scList[0].GoPrevious(Log); //--> visualizzazione finestra precedente else if (scList[0].Go(Log)) //--> visualizzazione finestra di destinazione shortcut - { - lastDestination.WindowID = scList[0].WindowID; //--> memorizzazione id finestra - lastDestination.LoadParameter = scList[0].LoadParameter; //--> memorizzazione parametri di caricamento utilizzati - } + lastDestination.GetData(scList[0].Destination); //--> aggiornamento ultima destinazione } else //Shortcut a destinazione multipla (ciclico) { @@ -890,10 +889,7 @@ } } if (scList[scIndex].Go(Log)) //--> visualizzazione finestra di destinazione shortcut - { - lastDestination.WindowID = scList[scIndex].WindowID; //--> memorizzazione id finestra - lastDestination.LoadParameter = scList[scIndex].LoadParameter; //--> memorizzazione parametri di caricamento utilizzati - } + lastDestination.GetData(scList[0].Destination); //--> aggiornamento ultima destinazione } } else //Combinazione di tasti non corrispondente a nessuno shortcut This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |