private Dictionary <string, EntityObjectStringType> GetDictionaryWithElement(textfilecontent54_ItemsChoices item, Dictionary <string, EntitySimpleBaseType> entities)
        {
            var newEntities = new Dictionary <string, EntityObjectStringType>();

            var itemChoice = (EntityObjectStringType)entities[item.ToString()];

            newEntities.Add(item.ToString(), itemChoice);

            return(newEntities);
        }
        private void AssertTextFileContentObjectEntity(
            textfilecontent54_object textFileContentObject,
            textfilecontent54_ItemsChoices entityName,
            string expectedEntityValue)
        {
            var entityToAssert = (EntitySimpleBaseType)textFileContentObject.GetItemValue(entityName);

            Assert.IsNotNull(entityToAssert, "The entity cannot be null");
            Assert.AreEqual(expectedEntityValue, entityToAssert.Value, "An unexpected entity value was found.");
        }
Ejemplo 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(textfilecontent54_ItemsChoices itemName)
 {
     for (int i = 0; i <= this.Textfilecontent54ItemsElementName.Count() - 1; i++)
     {
         if (this.Textfilecontent54ItemsElementName[i] == itemName)
         {
             return this.Items[i];
         }
     }
     return null;
 }
Ejemplo 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(textfilecontent54_ItemsChoices itemName)
 {
     for (int i = 0; i <= this.Textfilecontent54ItemsElementName.Count() - 1; i++)
     {
         if (this.Textfilecontent54ItemsElementName[i] == itemName)
         {
             return(this.Items[i]);
         }
     }
     return(null);
 }
        private Dictionary<string, EntityObjectStringType> GetDictionaryWithElement(textfilecontent54_ItemsChoices item, Dictionary<string, EntitySimpleBaseType> entities)
        {
            var newEntities = new Dictionary<string, EntityObjectStringType>();

            var itemChoice = (EntityObjectStringType)entities[item.ToString()];
            newEntities.Add(item.ToString(), itemChoice);

            return newEntities;
        }
 private void AssertTextFileContentObjectEntity(
     textfilecontent54_object textFileContentObject,
     textfilecontent54_ItemsChoices entityName,
     string expectedEntityValue)
 {
     var entityToAssert = (EntitySimpleBaseType)textFileContentObject.GetItemValue(entityName);
     Assert.IsNotNull(entityToAssert, "The entity cannot be null");
     Assert.AreEqual(expectedEntityValue, entityToAssert.Value, "An unexpected entity value was found.");
 }
        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);
        }
 public IEnumerable<String> EvaluateVariableForEntity(textfilecontent54_object fileContentObj, textfilecontent54_ItemsChoices entityName)
 {
     var fileObjectEntity = (EntitySimpleBaseType)fileContentObj.GetItemValue(entityName);
     var evaluatedEntity = this.FilePathVarEvaluator.EvaluateEntityVariable(fileObjectEntity);
     return evaluatedEntity == null ? null : evaluatedEntity.Distinct().ToArray();
 }
Ejemplo n.º 9
0
        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;
        }
        public IEnumerable <String> EvaluateVariableForEntity(textfilecontent54_object fileContentObj, textfilecontent54_ItemsChoices entityName)
        {
            var fileObjectEntity = (EntitySimpleBaseType)fileContentObj.GetItemValue(entityName);
            var evaluatedEntity  = this.FilePathVarEvaluator.EvaluateEntityVariable(fileObjectEntity);

            return(evaluatedEntity == null ? null : evaluatedEntity.Distinct().ToArray());
        }