Example #1
0
        private static void BuildMethodCall(ElementFactory aml, Innovator.Client.IElement element, OperationElement operation)
        {
            foreach (var attribute in operation.Attributes)
            {
                element.Add(aml.Attribute(attribute.Name, TryGetConstant(attribute, out var constValue) ? constValue : ""));
            }

            foreach (var child in operation.Elements)
            {
                var newElement = default(Innovator.Client.IElement);
                switch (child.Name)
                {
                case "Relationships":
                    newElement = aml.Relationships();
                    break;

                case "Item":
                    newElement = aml.Item();
                    break;

                default:
                    newElement = aml.Property(child.Name);
                    if (TryGetConstant(child, out var constValue))
                    {
                        newElement.Add(constValue);
                    }
                    break;
                }
                BuildMethodCall(aml, newElement, child);
                element.Add(newElement);
            }
        }