public static API.ReferencedField ToAPI(ReferencedField sdkReferencedField)
        {
            if (sdkReferencedField == null)
            {
                return(null);
            }

            ReferencedFieldConditions sdkReferencedFieldConditions = sdkReferencedField.Conditions;
            List <API.FieldCondition> apiReferencedInCondition     = new List <API.FieldCondition>();

            foreach (FieldCondition sdkFieldCondition in sdkReferencedFieldConditions.ReferencedInCondition)
            {
                FieldConditionConverter converter = new FieldConditionConverter(sdkFieldCondition);
                apiReferencedInCondition.Add(converter.ToAPIFieldCondition());
            }

            List <API.FieldCondition> apiReferencedInAction = new List <API.FieldCondition>();

            foreach (FieldCondition sdkFieldCondition in sdkReferencedFieldConditions.ReferencedInAction)
            {
                FieldConditionConverter converter = new FieldConditionConverter(sdkFieldCondition);
                apiReferencedInAction.Add(converter.ToAPIFieldCondition());
            }

            API.ReferencedFieldConditions apiReferencedFieldConditions = new API.ReferencedFieldConditions();
            apiReferencedFieldConditions.ReferencedInCondition = apiReferencedInCondition;
            apiReferencedFieldConditions.ReferencedInAction    = apiReferencedInAction;

            API.ReferencedField apiReferencedField = new API.ReferencedField();
            apiReferencedField.FieldId    = sdkReferencedField.FieldId;
            apiReferencedField.Conditions = apiReferencedFieldConditions;
            return(apiReferencedField);
        }
示例#2
0
        public static API.ReferencedFieldConditions ToAPI(ReferencedFieldConditions sdkReferencedFieldConditions)
        {
            if (sdkReferencedFieldConditions == null)
            {
                return(null);
            }

            List <API.FieldCondition> apiFieldConditionsInCondition = new List <API.FieldCondition>();

            foreach (FieldCondition sdkFieldCondition in sdkReferencedFieldConditions.ReferencedInCondition)
            {
                FieldConditionConverter fieldConditionConverter = new FieldConditionConverter(sdkFieldCondition);
                apiFieldConditionsInCondition.Add(fieldConditionConverter.ToAPIFieldCondition());
            }

            List <API.FieldCondition> apiFieldConditionsInAction = new List <API.FieldCondition>();

            foreach (FieldCondition sdkFieldCondition in sdkReferencedFieldConditions.ReferencedInAction)
            {
                FieldConditionConverter fieldConditionConverter = new FieldConditionConverter(sdkFieldCondition);
                apiFieldConditionsInAction.Add(fieldConditionConverter.ToAPIFieldCondition());
            }

            API.ReferencedFieldConditions apiReferencedFieldConditions = new API.ReferencedFieldConditions();
            apiReferencedFieldConditions.ReferencedInCondition = apiFieldConditionsInCondition;
            apiReferencedFieldConditions.ReferencedInAction    = apiFieldConditionsInAction;
            return(apiReferencedFieldConditions);
        }
        public static ReferencedField ToSDK(API.ReferencedField apiReferencedField)
        {
            if (apiReferencedField == null)
            {
                return(null);
            }

            API.ReferencedFieldConditions apiReferencedFieldConditions = apiReferencedField.Conditions;
            List <FieldCondition>         sdkReferencedInCondition     = new List <FieldCondition>();

            foreach (API.FieldCondition apiFieldCondition in apiReferencedFieldConditions.ReferencedInCondition)
            {
                FieldConditionConverter converter = new FieldConditionConverter(apiFieldCondition);
                sdkReferencedInCondition.Add(converter.ToSDKFieldCondition());
            }

            List <FieldCondition> sdkReferencedInAction = new List <FieldCondition>();

            foreach (API.FieldCondition apiFieldCondition in apiReferencedFieldConditions.ReferencedInAction)
            {
                FieldConditionConverter converter = new FieldConditionConverter(apiFieldCondition);
                sdkReferencedInAction.Add(converter.ToSDKFieldCondition());
            }

            ReferencedFieldConditions sdkReferencedFieldConditions = new ReferencedFieldConditions();

            sdkReferencedFieldConditions.ReferencedInCondition = sdkReferencedInCondition;
            sdkReferencedFieldConditions.ReferencedInAction    = sdkReferencedInAction;

            ReferencedField sdkReferencedField = new ReferencedField();

            sdkReferencedField.FieldId    = apiReferencedField.FieldId;
            sdkReferencedField.Conditions = sdkReferencedFieldConditions;
            return(sdkReferencedField);
        }
示例#4
0
        public static ReferencedFieldConditions ToSDK(API.ReferencedFieldConditions apiReferencedFieldConditions)
        {
            if (apiReferencedFieldConditions == null)
            {
                return(null);
            }

            List <FieldCondition> apiFieldConditionsInCondition = new List <FieldCondition>();

            foreach (API.FieldCondition sdkFieldCondition in apiReferencedFieldConditions.ReferencedInCondition)
            {
                FieldConditionConverter fieldConditionConverter = new FieldConditionConverter(sdkFieldCondition);
                apiFieldConditionsInCondition.Add(fieldConditionConverter.ToSDKFieldCondition());
            }

            List <FieldCondition> apiFieldConditionsInAction = new List <FieldCondition>();

            foreach (API.FieldCondition sdkFieldCondition in apiReferencedFieldConditions.ReferencedInAction)
            {
                FieldConditionConverter fieldConditionConverter = new FieldConditionConverter(sdkFieldCondition);
                apiFieldConditionsInAction.Add(fieldConditionConverter.ToSDKFieldCondition());
            }

            ReferencedFieldConditions sdkReferencedFieldConditions = new ReferencedFieldConditions();

            sdkReferencedFieldConditions.ReferencedInCondition = apiFieldConditionsInCondition;
            sdkReferencedFieldConditions.ReferencedInAction    = apiFieldConditionsInAction;
            return(sdkReferencedFieldConditions);
        }