private ObjectType CreateObjectTypeFrom(fileeffectiverights_object fileEffectiveRights, string path, string fileName, string trustee_name) { EntityObjectStringType fileNameFrom = (EntityObjectStringType)fileEffectiveRights.GetItemValue(fileeffectiverights_object_ItemsChoices.filename); EntityObjectStringType pathFrom = (EntityObjectStringType)fileEffectiveRights.GetItemValue(fileeffectiverights_object_ItemsChoices.path); EntityObjectStringType trustee_nameFrom = (EntityObjectStringType)fileEffectiveRights.GetItemValue(fileeffectiverights_object_ItemsChoices.trustee_name); EntityObjectStringType newFileName = entityBaseTypeFactory.CreateEntityBasedOn<EntityObjectStringType>(fileNameFrom); newFileName.Value = !string.IsNullOrEmpty(fileName) ? fileName : newFileName.Value; EntityObjectStringType newPath = entityBaseTypeFactory.CreateEntityBasedOn<EntityObjectStringType>(pathFrom); newPath.Value = !string.IsNullOrEmpty(path) ? path : newPath.Value; EntityObjectStringType newTrustee_name = entityBaseTypeFactory.CreateEntityBasedOn<EntityObjectStringType>(trustee_nameFrom); newTrustee_name.Value = !string.IsNullOrEmpty(trustee_name) ? trustee_name : newTrustee_name.Value; return this.CreateFileEffectiveRights(newFileName, newPath, newTrustee_name); }
private bool IsVariablesWasProcessed(fileeffectiverights_object fileEffectiveRights,IEnumerable<string> fileNames, IEnumerable<string> paths, IEnumerable<string> trustee_names) { EntitySimpleBaseType path = (EntitySimpleBaseType)fileEffectiveRights.GetItemValue(fileeffectiverights_object_ItemsChoices.path); EntitySimpleBaseType fileName = (EntitySimpleBaseType)fileEffectiveRights.GetItemValue(fileeffectiverights_object_ItemsChoices.filename); EntitySimpleBaseType trustee_name = (EntitySimpleBaseType)fileEffectiveRights.GetItemValue(fileeffectiverights_object_ItemsChoices.trustee_name); bool result = true; if (!string.IsNullOrEmpty(path.var_ref)) result = result && ((paths.Count() > 0) && (!string.IsNullOrEmpty(paths.First()))); if (!string.IsNullOrEmpty(fileName.var_ref)) result = result && ((fileNames.Count() > 0) && (!string.IsNullOrEmpty(fileNames.First()))); if (!string.IsNullOrEmpty(trustee_name.var_ref)) result = result && ((trustee_names.Count() > 0) && (!string.IsNullOrEmpty(trustee_names.First()))); return result; }
private IEnumerable<string> processVariablesFromEntity(fileeffectiverights_object fileEffectiveRights,fileeffectiverights_object_ItemsChoices itemChoice) { List<string> values = new List<string>(); EntityObjectStringType entity = (EntityObjectStringType)fileEffectiveRights.GetItemValue(itemChoice); if (entity != null) { values.AddRange(this.processVariableForEntity(entity)); } return values; }