Exemplo n.º 1
0
        /// <summary>
        /// Find and get the Subkey object if not found create a new instance
        /// </summary>
        /// <param name="uniqueName">The unique name of the value</param>
        public ModelRegistryKey GetSubKeyObject(string uniqueName)
        {
            ModelRegistryKey subkey = null;

            if (this.SubKeys != null)
            {
                subkey = this.SubKeys
                         .FirstOrDefault(x => x != null && x.RegsitryPath != null &&
                                         (x.RegsitryPath.IsSubKeyFound(uniqueName) == true));
            }
            else
            {
                this.SubKeys = new List <ModelRegistryKey>();
            }

            if (subkey == null)
            {
                subkey = new ModelRegistryKey(this, uniqueName, this.TreeLevel + 1);
                this.SubKeys.Add(subkey);
            }

            return(subkey);
        }
Exemplo n.º 2
0
 /// <summary>
 /// Default constructor to initialize the model from a parent model and subkey name and tree level
 /// </summary>
 /// <param name="parentKey">The parent subkey object</param>
 /// <param name="uniqueName">The unique name of the subkey</param>
 /// <param name="level">The level relative to the top root node.</param>
 public ModelRegistryKey(ModelRegistryKey parentKey, string uniqueName, uint level)
 {
     this.RegsitryPath = new ModelRegistryPath(parentKey.RegsitryPath, uniqueName);
     this.TreeLevel    = level;
 }