private registry_item GetFakeRegistryItem(string key, string name, eValueTypes dataType, string dataValue) { string hive = Enum.GetName(typeof(eHiveNames), eHiveNames.HKEY_LOCAL_MACHINE); string keyCollectedSuccessfully = "The Key, which fullPath is '{0}\\{1}\\{2}', was collected sucessfully."; registry_item registryItem = new registry_item(); registryItem.hive = new EntityItemRegistryHiveType() { Value = hive }; registryItem.key = new EntityItemStringType() { Value = key }; registryItem.name = new EntityItemStringType() { Value = name }; registryItem.type = new EntityItemRegistryTypeType() { Value = RegistryHelper.GetValueTypeAsString(dataType) }; registryItem.value = new EntityItemAnySimpleType[] { new EntityItemAnySimpleType() { Value = dataValue } }; registryItem.status = StatusEnumeration.exists; registryItem.message = MessageType.FromString(string.Format(keyCollectedSuccessfully, hive, key, name)); return(registryItem); }
private static ItemType CreateRegistryItem(string hiveName, string ovalId, string message, string keyName, string name, string value) { registry_item registry_item = new registry_item() { hive = new EntityItemRegistryHiveType() { datatype = SimpleDatatypeEnumeration.@string, Value = hiveName }, id = ovalId, message = MessageType.FromString(message), key = new EntityItemStringType() { datatype = SimpleDatatypeEnumeration.@string, Value = keyName }, name = new EntityItemStringType() { datatype = SimpleDatatypeEnumeration.@string, Value = name }, value = new EntityItemAnySimpleType[1] { new EntityItemAnySimpleType() { datatype = SimpleDatatypeEnumeration.@string, Value = name } } }; return(registry_item); }
/// <summary> /// Set the status and message for the current building item type. /// </summary> /// <param name="collectStatus">The status of collection item (Exists, Does not Exist, Not collected, Error...).</param> /// <param name="errorMessage">Optional message error. If this parameter is passed as null, it will be ignored.</param> /// <remarks></remarks> public virtual void SetItemTypeStatus(StatusEnumeration itemTypeStatus, string itemTypeMessage) { if (this.BuildingItemType != null) { this.BuildingItemType.status = itemTypeStatus; this.BuildingItemType.message = MessageType.FromString(itemTypeMessage); this.BuildItemType(); } }
private file_item CreateFakeFileItem(string filepath, string path, string filename) { string fullFilePath = filepath; string collectSuccessfully = "The File, which fullPath is '{0}', was collected sucessfully."; file_item newFileItem = new file_item(); newFileItem.status = StatusEnumeration.exists; newFileItem.message = MessageType.FromString(string.Format(collectSuccessfully, fullFilePath)); return(newFileItem); }
private static family_item CreateFamilySpecificItem(string id) { family_item familyItem = new family_item() { family = new EntityItemFamilyType() { datatype = SimpleDatatypeEnumeration.@string }, id = id, message = MessageType.FromString(""), status = StatusEnumeration.exists }; return(familyItem); }
protected MessageType[] PrepareErrorMessage(string errorMessage) { return(MessageType.FromString(errorMessage, MessageLevelEnumeration.error)); }