예제 #1
0
        public static string Binding(FieldStyle style)
        {
            switch (style)
            {
            case FieldStyle.BOUND_DATE:
                return(BINDING_DATE);

            case FieldStyle.BOUND_NAME:
                return(BINDING_NAME);

            case FieldStyle.BOUND_TITLE:
                return(BINDING_TITLE);

            case FieldStyle.BOUND_COMPANY:
                return(BINDING_COMPANY);

            case FieldStyle.UNBOUND_CUSTOM_FIELD:
            case FieldStyle.UNBOUND_TEXT_FIELD:
            case FieldStyle.UNBOUND_CHECK_BOX:
            case FieldStyle.LABEL:
                return(null);

            default:
                throw new EslException(String.Format("Unknown FieldStyle value {0}", style));
            }
        }
 public void ConvertSDKToSDK()
 {
     sdkFieldStyle1 = FieldStyle.UNBOUND_CUSTOM_FIELD;
     sdkFieldStyle2 = new FieldStyleAndSubTypeConverter(sdkFieldStyle1).ToSDKFieldStyle();
     Assert.IsNotNull(sdkFieldStyle2);
     Assert.AreEqual(sdkFieldStyle2, sdkFieldStyle1);
 }
예제 #3
0
        public FieldStyle ToSDKFieldStyle()
        {
            if (String.IsNullOrEmpty(apiFieldSubType) && apiFieldBinding == null)
            {
                return(sdkFieldStyle);
            }

            if (apiFieldBinding == null)
            {
                return(FieldStyle.valueOf(apiFieldSubType));
            }
            else
            {
                if (apiFieldBinding == BINDING_DATE)
                {
                    return(FieldStyle.BOUND_DATE);
                }
                else if (apiFieldBinding == BINDING_TITLE)
                {
                    return(FieldStyle.BOUND_TITLE);
                }
                else if (apiFieldBinding == BINDING_NAME)
                {
                    return(FieldStyle.BOUND_NAME);
                }
                else if (apiFieldBinding == BINDING_COMPANY)
                {
                    return(FieldStyle.BOUND_COMPANY);
                }
                else
                {
                    return(FieldStyle.valueOf(apiFieldBinding));
                }
            }
        }
 public void ConvertSDKToSDK()
 {
     sdkFieldStyle1 = FieldStyle.UNBOUND_CUSTOM_FIELD;
     sdkFieldStyle2 = new FieldStyleAndSubTypeConverter(sdkFieldStyle1).ToSDKFieldStyle();
     Assert.IsNotNull(sdkFieldStyle2);
     Assert.AreEqual(sdkFieldStyle2, sdkFieldStyle1);
 }
예제 #5
0
        public static string Binding(FieldStyle style)
        {
            switch (style.getSdkValue())
            {
            case "BOUND_DATE":
                return(BINDING_DATE);

            case "BOUND_NAME":
                return(BINDING_NAME);

            case "BOUND_TITLE":
                return(BINDING_TITLE);

            case "BOUND_COMPANY":
                return(BINDING_COMPANY);

            case "BOUND_QRCODE":
            case "UNBOUND_CUSTOM_FIELD":
            case "UNBOUND_TEXT_FIELD":
            case "UNBOUND_CHECK_BOX":
            case "UNBOUND_RADIO_BUTTON":
            case "DROP_LIST":
            case "TEXT_AREA":
            case "LABEL":
            default:
                return(null);
            }
        }
예제 #6
0
 public FieldStyleAndSubTypeConverter(string apiFieldSubtype, String apiFieldBinding)
 {
     this.apiFieldSubType = apiFieldSubtype;
     this.apiFieldBinding = apiFieldBinding;
     sdkFieldStyle        = null;
 }
예제 #7
0
 public FieldStyleAndSubTypeConverter(FieldStyle sdkFieldStyle)
 {
     this.sdkFieldStyle = sdkFieldStyle;
     apiFieldSubType    = null;
     apiFieldBinding    = null;
 }