Changeset 1878


Ignore:
Timestamp:
Aug 27, 2010, 5:42:34 PM (11 years ago)
Author:
kopal
Message:
  • ModelElements like WorkspaceModel and PluginModel now have a Parent which also is a PluginModel or a WorkspaceModel
  • PluginModel now have a method to get all "children" (other PluginModels having this one as Parent)
Location:
trunk/CrypPlugins/WorkspaceManager/Model
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/CrypPlugins/WorkspaceManager/Model/ModelPersistance.cs

    r1812 r1878  
    103103                pluginModel.Plugin.OnPluginProgressChanged += pluginModel.PluginProgressChanged;               
    104104                pluginModel.Plugin.OnPluginStatusChanged += pluginModel.PluginStatusChanged;
     105                if (pluginModel.Parent == null)
     106                {
     107                    pluginModel.Parent = workspacemodel;
     108                }
    105109                if (pluginModel.Plugin.Settings != null)
    106110                {
  • trunk/CrypPlugins/WorkspaceManager/Model/PluginModel.cs

    r1872 r1878  
    428428        }
    429429
     430        /// <summary>
     431        /// Get the children of this PluginModel by iterating through all PluginModels of
     432        /// the WorkSpace this PluginModel belongs to. All Plugins having this one as Parent
     433        /// are returned in this list
     434        /// </summary>
     435        /// <returns></returns>
     436        public List<PluginModel> getChildren()
     437        {
     438            List<PluginModel> children = new List<PluginModel>();
     439         
     440            foreach (PluginModel pluginModel in this.WorkspaceModel.AllPluginModels)
     441            {
     442                if (pluginModel.Parent == this)
     443                {
     444                    children.Add(pluginModel);
     445                }
     446            }           
     447            return children;
     448        }
     449
    430450        #endregion
    431451    }
  • trunk/CrypPlugins/WorkspaceManager/Model/VisualElementModel.cs

    r1741 r1878  
    8989        [NonSerialized]
    9090        public IUpdateableView UpdateableView = null;
     91
     92        private VisualElementModel parent = null;
     93        /// <summary>
     94        /// Get/Set the Parent of this VisualElementModel
     95        /// </summary>
     96        public VisualElementModel Parent
     97        {
     98            get { return this.parent; }
     99            set { this.parent = value; }
     100        }
    91101    }
    92 
    93102}
  • trunk/CrypPlugins/WorkspaceManager/Model/WorkspaceModel.cs

    r1842 r1878  
    2929    /// </summary>
    3030    [Serializable]
    31     public class WorkspaceModel
     31    public class WorkspaceModel : VisualElementModel
    3232    {
    3333        [NonSerialized]
     
    109109            pluginModel.Plugin.OnPluginProgressChanged += pluginModel.PluginProgressChanged;
    110110            pluginModel.Plugin.OnPluginStatusChanged += pluginModel.PluginStatusChanged;
     111            pluginModel.Parent = this;
    111112            if (pluginModel.Plugin.Settings != null)
    112113            {
    113114                pluginModel.Plugin.Settings.PropertyChanged += pluginModel.SettingsPropertyChanged;
    114             }
     115            }           
    115116            this.AllPluginModels.Add(pluginModel);
    116117            this.WorkspaceManagerEditor.HasChanges = true;
Note: See TracChangeset for help on using the changeset viewer.