private IEnumerable <String> ProcessOperationForIdEntity( EntityObjectIntType idEntity, IEnumerable <string> currentIdValues) { if (idEntity.operation.Equals(OperationEnumeration.equals)) { return(currentIdValues); } var result = new List <String>(); var allMetabaseIDs = this.ObjectCollector.GetAllMetabaseIDs(); var ovalComparator = new OvalComparatorFactory().GetComparator(idEntity.datatype); foreach (var idValue in currentIdValues) { foreach (var metabaseId in allMetabaseIDs) { if (ovalComparator.Compare(metabaseId, idValue, idEntity.operation)) { result.Add(metabaseId); } } } return(result); }
private EntityObjectIntType CopyEntityObjectIntType(EntityObjectIntType sourceEntityObject) { return(new EntityObjectIntType() { datatype = sourceEntityObject.datatype, mask = sourceEntityObject.mask, operation = sourceEntityObject.operation, var_ref = sourceEntityObject.var_ref, Value = sourceEntityObject.Value }); }
private EntityObjectIntType CopyEntityObjectIntType(EntityObjectIntType sourceEntityObject) { return new EntityObjectIntType() { datatype = sourceEntityObject.datatype, mask = sourceEntityObject.mask, operation = sourceEntityObject.operation, var_ref = sourceEntityObject.var_ref, Value = sourceEntityObject.Value }; }
private IEnumerable<String> ProcessOperationForIdEntity( EntityObjectIntType idEntity, IEnumerable<string> currentIdValues) { if (idEntity.operation.Equals(OperationEnumeration.equals)) return currentIdValues; var result = new List<String>(); var allMetabaseIDs = this.ObjectCollector.GetAllMetabaseIDs(); var ovalComparator = new OvalComparatorFactory().GetComparator(idEntity.datatype); foreach (var idValue in currentIdValues) foreach (var metabaseId in allMetabaseIDs) if (ovalComparator.Compare(metabaseId, idValue, idEntity.operation)) result.Add(metabaseId); return result; }
public bool HasVariableDefined() { EntityObjectStringType filePath = null; EntityObjectStringType fileName = null; EntityObjectStringType path = null; EntityObjectStringType pattern = (EntityObjectStringType)this.GetItemValue(textfilecontent54_ItemsChoices.pattern); EntityObjectIntType instance = (EntityObjectIntType)this.GetItemValue(textfilecontent54_ItemsChoices.instance); if (this.IsFilePathDefined()) { filePath = (EntityObjectStringType)this.GetItemValue(textfilecontent54_ItemsChoices.filepath); return((!string.IsNullOrEmpty(filePath.var_ref)) || (!string.IsNullOrEmpty(pattern.var_ref)) || (!string.IsNullOrEmpty(instance.var_ref))); } else { fileName = (EntityObjectStringType)this.GetItemValue(textfilecontent54_ItemsChoices.filename); path = (EntityObjectStringType)this.GetItemValue(textfilecontent54_ItemsChoices.path); return((!string.IsNullOrEmpty(path.var_ref)) || (!string.IsNullOrEmpty(fileName.var_ref)) || (!string.IsNullOrEmpty(pattern.var_ref)) || (!string.IsNullOrEmpty(instance.var_ref))); } }
private textfilecontent54_object CreateTextFileContentObject( EntityObjectStringType filePath, EntityObjectStringType fileName, EntityObjectStringType path, EntityObjectStringType pattern, EntityObjectIntType instance, Object[] behaviors) { var fileContentObject = new textfilecontent54_object(); object[] items; textfilecontent54_ItemsChoices[] itemChoices; var hasBehaviors = (behaviors != null) && (behaviors.Count() > 0); var behaviorCount = behaviors.Count(); if (filePath == null) { if (hasBehaviors) { var entityCount = behaviorCount + 4; items = new object[entityCount]; itemChoices = new textfilecontent54_ItemsChoices[entityCount]; for (int i = 0; i < behaviorCount; i++) { itemChoices[i] = textfilecontent54_ItemsChoices.behaviors; items[i] = behaviors.ElementAt(i); } itemChoices[behaviorCount] = textfilecontent54_ItemsChoices.path; itemChoices[behaviorCount + 1] = textfilecontent54_ItemsChoices.filename; itemChoices[behaviorCount + 2] = textfilecontent54_ItemsChoices.pattern; itemChoices[behaviorCount + 3] = textfilecontent54_ItemsChoices.instance; items[behaviorCount] = path; items[behaviorCount + 1] = fileName; items[behaviorCount + 2] = pattern; items[behaviorCount + 3] = instance; } else { items = new EntitySimpleBaseType[4]; itemChoices = new textfilecontent54_ItemsChoices[4]; itemChoices[0] = textfilecontent54_ItemsChoices.path; itemChoices[1] = textfilecontent54_ItemsChoices.filename; itemChoices[2] = textfilecontent54_ItemsChoices.pattern; itemChoices[3] = textfilecontent54_ItemsChoices.instance; items[0] = path; items[1] = fileName; items[2] = pattern; items[3] = instance; } } else { if (hasBehaviors) { var entityCount = behaviorCount + 3; items = new object[entityCount]; itemChoices = new textfilecontent54_ItemsChoices[entityCount]; for (int i = 0; i < behaviorCount; i++) { itemChoices[i] = textfilecontent54_ItemsChoices.behaviors; items[i] = behaviors.ElementAt(i); } itemChoices[behaviorCount] = textfilecontent54_ItemsChoices.filepath; itemChoices[behaviorCount + 1] = textfilecontent54_ItemsChoices.pattern; itemChoices[behaviorCount + 2] = textfilecontent54_ItemsChoices.instance; items[behaviorCount] = filePath; items[behaviorCount + 1] = pattern; items[behaviorCount + 2] = instance; } else { items = new EntitySimpleBaseType[3]; itemChoices = new textfilecontent54_ItemsChoices[3]; itemChoices[0] = textfilecontent54_ItemsChoices.filepath; itemChoices[1] = textfilecontent54_ItemsChoices.pattern; itemChoices[2] = textfilecontent54_ItemsChoices.instance; items[0] = filePath; items[1] = pattern; items[2] = instance; } } fileContentObject.Items = items; fileContentObject.Textfilecontent54ItemsElementName = itemChoices; return(fileContentObject); }
private textfilecontent54_object CreateTextFileContentObject( EntityObjectStringType filePath, EntityObjectStringType fileName, EntityObjectStringType path, EntityObjectStringType pattern, EntityObjectIntType instance, Object[] behaviors) { var fileContentObject = new textfilecontent54_object(); object[] items; textfilecontent54_ItemsChoices[] itemChoices; var hasBehaviors = (behaviors != null) && (behaviors.Count() > 0); var behaviorCount = behaviors.Count(); if (filePath == null) { if (hasBehaviors) { var entityCount = behaviorCount + 4; items = new object[entityCount]; itemChoices = new textfilecontent54_ItemsChoices[entityCount]; for (int i = 0; i < behaviorCount; i++) { itemChoices[i] = textfilecontent54_ItemsChoices.behaviors; items[i] = behaviors.ElementAt(i); } itemChoices[behaviorCount] = textfilecontent54_ItemsChoices.path; itemChoices[behaviorCount + 1] = textfilecontent54_ItemsChoices.filename; itemChoices[behaviorCount + 2] = textfilecontent54_ItemsChoices.pattern; itemChoices[behaviorCount + 3] = textfilecontent54_ItemsChoices.instance; items[behaviorCount] = path; items[behaviorCount + 1] = fileName; items[behaviorCount + 2] = pattern; items[behaviorCount + 3] = instance; } else { items = new EntitySimpleBaseType[4]; itemChoices = new textfilecontent54_ItemsChoices[4]; itemChoices[0] = textfilecontent54_ItemsChoices.path; itemChoices[1] = textfilecontent54_ItemsChoices.filename; itemChoices[2] = textfilecontent54_ItemsChoices.pattern; itemChoices[3] = textfilecontent54_ItemsChoices.instance; items[0] = path; items[1] = fileName; items[2] = pattern; items[3] = instance; } } else { if (hasBehaviors) { var entityCount = behaviorCount + 3; items = new object[entityCount]; itemChoices = new textfilecontent54_ItemsChoices[entityCount]; for (int i = 0; i < behaviorCount; i++) { itemChoices[i] = textfilecontent54_ItemsChoices.behaviors; items[i] = behaviors.ElementAt(i); } itemChoices[behaviorCount] = textfilecontent54_ItemsChoices.filepath; itemChoices[behaviorCount + 1] = textfilecontent54_ItemsChoices.pattern; itemChoices[behaviorCount + 2] = textfilecontent54_ItemsChoices.instance; items[behaviorCount] = filePath; items[behaviorCount + 1] = pattern; items[behaviorCount + 2] = instance; } else { items = new EntitySimpleBaseType[3]; itemChoices = new textfilecontent54_ItemsChoices[3]; itemChoices[0] = textfilecontent54_ItemsChoices.filepath; itemChoices[1] = textfilecontent54_ItemsChoices.pattern; itemChoices[2] = textfilecontent54_ItemsChoices.instance; items[0] = filePath; items[1] = pattern; items[2] = instance; } } fileContentObject.Items = items; fileContentObject.Textfilecontent54ItemsElementName = itemChoices; return fileContentObject; }