コード例 #1
0
        protected override IEnumerable<CollectedItem> collectDataForSystemItem(ItemType systemItem)
        {
            var registryItem = (registry_item)systemItem;
            var fullKeyPath = Path.Combine(registryItem.hive.Value, registryItem.key.Value, registryItem.name.Value);
            var itemBuilder = new RegistryItemTypeBuilder(registryItem);
            
            try
            {
                base.ExecutionLogBuilder.CollectingDataFrom(fullKeyPath);
                if (this.IsAllEntitiesIsSet(systemItem))
                {
                    var collectedSystemData = this.collectSystemDataForRegistryItem(registryItem);
                    itemBuilder.FillItemTypeWithData(collectedSystemData);
                }
            }
            catch (RegistryKeyNotFoundException)
            {
                base.ExecutionLogBuilder.Warning(string.Format("The registry key {0} is not found ", registryItem.key.Value));
                itemBuilder.SetRegistryKeyStatus(StatusEnumeration.doesnotexist);
                itemBuilder.SetItemTypeStatus(StatusEnumeration.doesnotexist, null);
                itemBuilder.ClearRegistryName();
            }
            catch (RegistryNameNotFoundException)
            {
                base.ExecutionLogBuilder.Warning(string.Format("The registry name {0} is not found ", registryItem.name.Value));
                itemBuilder.SetRegistryNameStatus(StatusEnumeration.doesnotexist);
                itemBuilder.SetItemTypeStatus(StatusEnumeration.doesnotexist, null);
            }

            itemBuilder.BuildItemType();
            itemBuilder.ClearEntitiesWithEmptyValueIfStatusDoesNotExists();
            return new ItemTypeHelper().CreateCollectedItemsWithOneItem(itemBuilder.BuiltItemType, BuildExecutionLog());
        }
コード例 #2
0
        protected override IEnumerable <CollectedItem> collectDataForSystemItem(ItemType systemItem)
        {
            var registryItem = (registry_item)systemItem;
            var fullKeyPath  = Path.Combine(registryItem.hive.Value, registryItem.key.Value, registryItem.name.Value);
            var itemBuilder  = new RegistryItemTypeBuilder(registryItem);

            try
            {
                base.ExecutionLogBuilder.CollectingDataFrom(fullKeyPath);
                if (this.IsAllEntitiesIsSet(systemItem))
                {
                    var collectedSystemData = this.collectSystemDataForRegistryItem(registryItem);
                    itemBuilder.FillItemTypeWithData(collectedSystemData);
                }
            }
            catch (RegistryKeyNotFoundException)
            {
                base.ExecutionLogBuilder.Warning(string.Format("The registry key {0} is not found ", registryItem.key.Value));
                itemBuilder.SetRegistryKeyStatus(StatusEnumeration.doesnotexist);
                itemBuilder.SetItemTypeStatus(StatusEnumeration.doesnotexist, null);
                itemBuilder.ClearRegistryName();
            }
            catch (RegistryNameNotFoundException)
            {
                base.ExecutionLogBuilder.Warning(string.Format("The registry name {0} is not found ", registryItem.name.Value));
                itemBuilder.SetRegistryNameStatus(StatusEnumeration.doesnotexist);
                itemBuilder.SetItemTypeStatus(StatusEnumeration.doesnotexist, null);
            }

            itemBuilder.BuildItemType();
            itemBuilder.ClearEntitiesWithEmptyValueIfStatusDoesNotExists();
            return(new ItemTypeHelper().CreateCollectedItemsWithOneItem(itemBuilder.BuiltItemType, BuildExecutionLog()));
        }