public IEnumerable <ItemType> CreateRegistryItemTypesByCombinationOfEntitiesFrom( IEnumerable <string> hives, IEnumerable <string> keys, IEnumerable <string> names, RegistryObject registryObjectSource) { List <ItemType> registryObjects = new List <ItemType>(); registryObjects.AddRange(this.VerifyErrorsInTheListOfRegistryEntities(hives, keys, names, registryObjectSource)); if (registryObjects.Count == 0) { foreach (string hiveValue in hives) { foreach (string keyValue in keys) { foreach (string nameValue in names) { registryObjects.Add(this.CreateRegistryItem(hiveValue, keyValue, nameValue)); } } } } return(registryObjects); }
/// <summary> /// Creates the registry objects by combination of entities. /// This method combines the entities for the create multiples RegistryObjects given a other RegistryObject as source. /// Ex. We can have the hives [HKEY_LOCAL_MACHINE], the keys [Microsoft\Windows,Microsoft\Windows NT] /// and the names [CurrentVersion,CurrentBuild]. /// With these wqlParameters will be created 4 registryObjects: /// 1 - RegistryObject {hive = HKEY_LOCAL_MACHINE, key = Microsoft\Windows, name = CurrentVersion} /// 2 - RegistryObject {hive = HKEY_LOCAL_MACHINE, key = Microsoft\Windows, name = CurrentBuild} /// 3 - RegistryObject {hive = HKEY_LOCAL_MACHINE, key = Microsoft\Windows NT, name = CurrentVersion} /// 4 - RegistryObject {hive = HKEY_LOCAL_MACHINE, key = Microsoft\Windows NT, name = CurrentBuild} /// The information of Variables and Operations for each entity, will be copied from source RegistryObject. /// </summary> /// <param name="hives">The hives.</param> /// <param name="keys">The keys.</param> /// <param name="names">The names.</param> /// <param name="registryObjectSource"> the source registry object </param> /// <returns></returns> public static IEnumerable<RegistryObject> CreateRegistryObjectsByCombinationOfEntitiesFrom(IEnumerable<string> hives, IEnumerable<string> keys, IEnumerable<string> names, RegistryObject registryObjectSource) { List<RegistryObject> registryObjects = CreateResgistryObjectByCombination(hives, keys, names, registryObjectSource); return registryObjects; }
public IEnumerable<ItemType> CreateRegistryItemTypesByCombinationOfEntitiesFrom( IEnumerable<string> hives, IEnumerable<string> keys, IEnumerable<string> names, RegistryObject registryObjectSource) { List<ItemType> registryObjects = new List<ItemType>(); registryObjects.AddRange(this.VerifyErrorsInTheListOfRegistryEntities(hives,keys,names,registryObjectSource)); if (registryObjects.Count == 0) foreach (string hiveValue in hives) foreach (string keyValue in keys) foreach (string nameValue in names) registryObjects.Add(this.CreateRegistryItem(hiveValue, keyValue, nameValue)); return registryObjects; }
private static List <RegistryObject> CreateResgistryObjectByCombination( IEnumerable <string> hives, IEnumerable <string> keys, IEnumerable <string> names, RegistryObject registryObjectSource) { List <RegistryObject> registryObjects = new List <RegistryObject>(); foreach (string hiveValue in hives) { foreach (string keyValue in keys) { foreach (string nameValue in names) { RegistryObject registry = RegistryObjectFactory.CreateRegistryObjectFrom(hiveValue, keyValue, nameValue, registryObjectSource); registryObjects.Add(registry); } } } return(registryObjects); }
private static List<RegistryObject> CreateResgistryObjectByCombination( IEnumerable<string> hives, IEnumerable<string> keys, IEnumerable<string> names, RegistryObject registryObjectSource) { List<RegistryObject> registryObjects = new List<RegistryObject>(); foreach (string hiveValue in hives) { foreach (string keyValue in keys) { foreach (string nameValue in names) { RegistryObject registry = RegistryObjectFactory.CreateRegistryObjectFrom(hiveValue, keyValue, nameValue, registryObjectSource); registryObjects.Add(registry); } } } return registryObjects; }
private static EntityObjectStringType CreateEntityObjectStringType(string entityName, string value, RegistryObject source) { return new EntityObjectStringType() { Value = value, var_ref = source.GetVariableId(entityName), operation = source.GetOperationOfEntity(entityName) }; }
private static RegistryObject CreateRegistryObjectFrom(string hive, string key, string name, RegistryObject source) { Dictionary<string, EntityObjectStringType> registryEntities = new Dictionary<string, EntityObjectStringType>(); registryEntities.Add(registry_object_ItemsChoices.hive.ToString(), CreateEntityObjectStringType(registry_object_ItemsChoices.hive.ToString(),hive,source)); registryEntities.Add(registry_object_ItemsChoices.key.ToString(), CreateEntityObjectStringType(registry_object_ItemsChoices.key.ToString(), key, source)); registryEntities.Add(registry_object_ItemsChoices.name.ToString(), CreateEntityObjectStringType(registry_object_ItemsChoices.name.ToString(), name, source)); return new RegistryObject(registryEntities); }
private IEnumerable<ItemType> VerifyErrorsInTheListOfRegistryEntities( IEnumerable<string> hives, IEnumerable<string> keys, IEnumerable<string> names, RegistryObject registryObjectSource) { List<ItemType> registryObjects = new List<ItemType>(); if ((hives == null) || (hives.Count() == 0)) { registry_item registry = this.CreateRegistryItem(registryObjectSource.Hive, "", "",StatusEnumeration.doesnotexist); registry.hive.status = StatusEnumeration.doesnotexist; registryObjects.Add(registry); return registryObjects; } if ((keys == null) || (keys.Count() == 0)) { registry_item registry = this.CreateRegistryItem(registryObjectSource.Hive, registryObjectSource.Key, "", StatusEnumeration.doesnotexist); registry.key.status = StatusEnumeration.doesnotexist; registryObjects.Add(registry); return registryObjects; } if ((names == null) || (names.Count() == 0)) { registry_item registry = this.CreateRegistryItem(registryObjectSource.Hive, registryObjectSource.Key, registryObjectSource.Name,StatusEnumeration.doesnotexist); registry.name.status = StatusEnumeration.doesnotexist; registryObjects.Add(registry); return registryObjects; } return registryObjects; }
/// <summary> /// Creates the registry objects by combination of entities. /// This method combines the entities for the create multiples RegistryObjects given a other RegistryObject as source. /// Ex. We can have the hives [HKEY_LOCAL_MACHINE], the keys [Microsoft\Windows,Microsoft\Windows NT] /// and the names [CurrentVersion,CurrentBuild]. /// With these wqlParameters will be created 4 registryObjects: /// 1 - RegistryObject {hive = HKEY_LOCAL_MACHINE, key = Microsoft\Windows, name = CurrentVersion} /// 2 - RegistryObject {hive = HKEY_LOCAL_MACHINE, key = Microsoft\Windows, name = CurrentBuild} /// 3 - RegistryObject {hive = HKEY_LOCAL_MACHINE, key = Microsoft\Windows NT, name = CurrentVersion} /// 4 - RegistryObject {hive = HKEY_LOCAL_MACHINE, key = Microsoft\Windows NT, name = CurrentBuild} /// The information of Variables and Operations for each entity, will be copied from source RegistryObject. /// </summary> /// <param name="hives">The hives.</param> /// <param name="keys">The keys.</param> /// <param name="names">The names.</param> /// <param name="registryObjectSource"> the source registry object </param> /// <returns></returns> public static IEnumerable <RegistryObject> CreateRegistryObjectsByCombinationOfEntitiesFrom(IEnumerable <string> hives, IEnumerable <string> keys, IEnumerable <string> names, RegistryObject registryObjectSource) { List <RegistryObject> registryObjects = CreateResgistryObjectByCombination(hives, keys, names, registryObjectSource); return(registryObjects); }
private static EntityObjectStringType CreateEntityObjectStringType(string entityName, string value, RegistryObject source) { return(new EntityObjectStringType() { Value = value, var_ref = source.GetVariableId(entityName), operation = source.GetOperationOfEntity(entityName) }); }
private static RegistryObject CreateRegistryObjectFrom(string hive, string key, string name, RegistryObject source) { Dictionary <string, EntityObjectStringType> registryEntities = new Dictionary <string, EntityObjectStringType>(); registryEntities.Add(registry_object_ItemsChoices.hive.ToString(), CreateEntityObjectStringType(registry_object_ItemsChoices.hive.ToString(), hive, source)); registryEntities.Add(registry_object_ItemsChoices.key.ToString(), CreateEntityObjectStringType(registry_object_ItemsChoices.key.ToString(), key, source)); registryEntities.Add(registry_object_ItemsChoices.name.ToString(), CreateEntityObjectStringType(registry_object_ItemsChoices.name.ToString(), name, source)); return(new RegistryObject(registryEntities)); }
private IEnumerable <ItemType> VerifyErrorsInTheListOfRegistryEntities( IEnumerable <string> hives, IEnumerable <string> keys, IEnumerable <string> names, RegistryObject registryObjectSource) { List <ItemType> registryObjects = new List <ItemType>(); if ((hives == null) || (hives.Count() == 0)) { registry_item registry = this.CreateRegistryItem(registryObjectSource.Hive, "", "", StatusEnumeration.doesnotexist); registry.hive.status = StatusEnumeration.doesnotexist; registryObjects.Add(registry); return(registryObjects); } if ((keys == null) || (keys.Count() == 0)) { registry_item registry = this.CreateRegistryItem(registryObjectSource.Hive, registryObjectSource.Key, "", StatusEnumeration.doesnotexist); registry.key.status = StatusEnumeration.doesnotexist; registryObjects.Add(registry); return(registryObjects); } if ((names == null) || (names.Count() == 0)) { registry_item registry = this.CreateRegistryItem(registryObjectSource.Hive, registryObjectSource.Key, registryObjectSource.Name, StatusEnumeration.doesnotexist); registry.name.status = StatusEnumeration.doesnotexist; registryObjects.Add(registry); return(registryObjects); } return(registryObjects); }