Esempio n. 1
0
        private file_object CreateFileObject(EntityObjectStringType filePath, EntityObjectStringType path, EntityObjectStringType fileName)
        {
            file_object fileObject = new file_object();

            EntityObjectStringType[]   items;
            file_object_ItemsChoices[] itemChoices;
            if (filePath != null)
            {
                items          = new EntityObjectStringType[1];
                itemChoices    = new file_object_ItemsChoices[1];
                items[0]       = filePath;
                itemChoices[0] = file_object_ItemsChoices.filepath;
            }
            else
            {
                items          = new EntityObjectStringType[2];
                itemChoices    = new file_object_ItemsChoices[2];
                items[0]       = path;
                items[1]       = fileName;
                itemChoices[0] = file_object_ItemsChoices.path;
                itemChoices[1] = file_object_ItemsChoices.filename;
            }
            fileObject.Items = items;
            fileObject.FileObjectItemsElementName = itemChoices;
            return(fileObject);
        }
Esempio n. 2
0
 private file_object CreateFileObject(EntityObjectStringType filePath, EntityObjectStringType path, EntityObjectStringType fileName)
 {
     file_object fileObject = new file_object();
     EntityObjectStringType[] items;
     file_object_ItemsChoices[] itemChoices;
     if (filePath != null)
     {
         items = new EntityObjectStringType[1];
         itemChoices = new file_object_ItemsChoices[1];
         items[0] = filePath;
         itemChoices[0] = file_object_ItemsChoices.filepath;
     }
     else
     {
         items = new EntityObjectStringType[2];
         itemChoices = new file_object_ItemsChoices[2];
         items[0] = path;
         items[1] = fileName;
         itemChoices[0] = file_object_ItemsChoices.path;
         itemChoices[1] = file_object_ItemsChoices.filename;
     }
     fileObject.Items = items;
     fileObject.FileObjectItemsElementName = itemChoices;
     return fileObject;
 }
Esempio n. 3
0
 /// <summary>
 /// Gets the item value from the items array.
 /// This method makes the combination between ItemsElementName and Items array
 /// to the get value.
 /// </summary>
 /// <param name="itemName">Name of the item.</param>
 /// <returns></returns>
 public Object GetItemValue(file_object_ItemsChoices itemName)
 {
     for (int i = 0; i <= this.FileObjectItemsElementName.Count() - 1; i++)
     {
         if (this.FileObjectItemsElementName[i] == itemName)
         {
             return(this.Items[i]);
         }
     }
     return(null);
 }
Esempio n. 4
0
 /// <summary>
 /// Gets the item value from the items array.
 /// This method makes the combination between ItemsElementName and Items array
 /// to the get value.
 /// </summary>
 /// <param name="itemName">Name of the item.</param>
 /// <returns></returns>
 public Object GetItemValue(file_object_ItemsChoices itemName)
 {
     for (int i = 0; i <= this.FileObjectItemsElementName.Count() - 1; i++)
     {
         if (this.FileObjectItemsElementName[i] == itemName)
         {
             return this.Items[i];
         }
     }
     return null;
 }
Esempio n. 5
0
        private IEnumerable <String> evaluateVariableForFileEntity(OVAL.Definitions.Windows.file_object fileObject, file_object_ItemsChoices fileObjectEntityItem)
        {
            var fileObjectEntity = (EntityObjectStringType)fileObject.GetItemValue(fileObjectEntityItem);
            var evaluatedEntity  = this.FilePathVarEvaluator.EvaluateEntityVariable(fileObjectEntity);

            return(evaluatedEntity == null ? null : evaluatedEntity.Distinct().ToArray());
        }
 private IEnumerable<String> evaluateVariableForFileEntity(OVAL.Definitions.Windows.file_object fileObject, file_object_ItemsChoices fileObjectEntityItem)
 {
     var fileObjectEntity = (EntityObjectStringType)fileObject.GetItemValue(fileObjectEntityItem);
     var evaluatedEntity = this.FilePathVarEvaluator.EvaluateEntityVariable(fileObjectEntity);
     return evaluatedEntity == null ? null : evaluatedEntity.Distinct().ToArray();
 }