private void InitializeUIByActionType() { switch (mWebApiType) { case ApplicationAPIUtils.eWebApiType.REST: //binding //setting visibility : PanelSoap.Visibility = Visibility.Collapsed; UseWSSecurityHeader.Visibility = Visibility.Collapsed; //Cookie Mode CookieMode.Init(mAct.GetOrCreateInputParam(ActWebAPIRest.Fields.CookieMode, ApplicationAPIUtils.eCookieMode.New.ToString()), typeof(ApplicationAPIUtils.eCookieMode), false, null); //Request Type RequestTypeComboBox.Init(mAct.GetOrCreateInputParam(ActWebAPIRest.Fields.RequestType, ApplicationAPIUtils.eRequestType.GET.ToString()), typeof(ApplicationAPIUtils.eRequestType), false, null); //HttpVersion content type HttpVersioncombobox.Init(mAct.GetOrCreateInputParam(ActWebAPIRest.Fields.ReqHttpVersion, ApplicationAPIUtils.eHttpVersion.HTTPV11.ToString()), typeof(ApplicationAPIUtils.eHttpVersion), false, null); //Request content type ContentTypeComboBox.Init(mAct.GetOrCreateInputParam(ActWebAPIRest.Fields.ContentType, ApplicationAPIUtils.eContentType.JSon.ToString()), typeof(ApplicationAPIUtils.eContentType), false, ContentTypeChange); //Response Content Type ResponseTypeComboBox.Init(mAct.GetOrCreateInputParam(ActWebAPIRest.Fields.ResponseContentType, ApplicationAPIUtils.eContentType.JSon.ToString()), typeof(ApplicationAPIUtils.eContentType), false, ResponseTypeComboBox_SelectionChanged); //Request Template file: TemplateFileNameFileBrowser.Init(Context.GetAsContext(mAct.Context), mAct.GetOrCreateInputParam(ActWebAPIBase.Fields.TemplateFileNameFileBrowser), true, true, UCValueExpression.eBrowserType.File, "txt; *.xml; *.json;", new RoutedEventHandler(BrowseTemplateFileButton_Click)); break; case ApplicationAPIUtils.eWebApiType.SOAP: //binding visibility RequestContent.Visibility = Visibility.Collapsed; RestHeader.Visibility = Visibility.Collapsed; UseWSSecurityHeader.Visibility = Visibility.Visible; //binding //SOAP Action SoapActionUCValueExpression.Init(Context.GetAsContext(mAct.Context), mAct.GetOrCreateInputParam(ActWebAPISoap.Fields.SOAPAction), true, false, UCValueExpression.eBrowserType.Folder); //Request Template file: TemplateFileNameFileBrowser.Init(Context.GetAsContext(mAct.Context), mAct.GetOrCreateInputParam(ActWebAPIBase.Fields.TemplateFileNameFileBrowser), true, true, UCValueExpression.eBrowserType.File, "txt; *.xml;", new RoutedEventHandler(BrowseTemplateFileButton_Click)); break; } }
private void InitializeUIByActionType() { xShowIDUC.Init(mApplicationAPIModel); GingerCore.GeneralLib.BindingHandler.ObjFieldBinding(txtName, TextBox.TextProperty, mApplicationAPIModel, nameof(mApplicationAPIModel.Name)); GingerCore.GeneralLib.BindingHandler.ObjFieldBinding(txtDescription, TextBox.TextProperty, mApplicationAPIModel, nameof(mApplicationAPIModel.Description)); FillTargetAppsComboBox(); xTargetApplicationComboBox.Init(mApplicationAPIModel, nameof(ApplicationAPIModel.TargetApplicationKey)); xTagsViewer.Init(mApplicationAPIModel.TagsKeys); xAPITypeComboBox.Init(mApplicationAPIModel, nameof(mApplicationAPIModel.APIType), typeof(ApplicationAPIUtils.eWebApiType)); xAPITypeComboBox.ComboBox.SelectionChanged += ComboBox_SelectionChanged; CookieMode.Init(mApplicationAPIModel, nameof(mApplicationAPIModel.CookieMode), typeof(ApplicationAPIUtils.eCookieMode)); RequestTypeComboBox.Init(mApplicationAPIModel, nameof(mApplicationAPIModel.RequestType), typeof(ApplicationAPIUtils.eRequestType)); HttpVersioncombobox.Init(mApplicationAPIModel, nameof(mApplicationAPIModel.ReqHttpVersion), typeof(ApplicationAPIUtils.eHttpVersion)); ContentTypeComboBox.Init(mApplicationAPIModel, nameof(mApplicationAPIModel.ContentType), typeof(ApplicationAPIUtils.eContentType), ContentTypeChange); ResponseTypeComboBox.Init(mApplicationAPIModel, nameof(mApplicationAPIModel.ResponseContentType), typeof(ApplicationAPIUtils.eContentType)); //Check maybe the binding of TemplateFileNameFileBrowser need to be different between soap and rest GingerCore.GeneralLib.BindingHandler.ObjFieldBinding(TemplateFileNameFileBrowser, TextBox.TextProperty, mApplicationAPIModel, nameof(mApplicationAPIModel.TemplateFileNameFileBrowser)); xTargetApplicationComboBox.ComboBox.Style = this.FindResource("$FlatInputComboBoxStyle") as Style; xAPITypeComboBox.ComboBox.Style = this.FindResource("$FlatInputComboBoxStyle") as Style; CookieMode.ComboBox.Style = this.FindResource("$FlatInputComboBoxStyle") as Style; RequestTypeComboBox.ComboBox.Style = this.FindResource("$FlatInputComboBoxStyle") as Style; HttpVersioncombobox.ComboBox.Style = this.FindResource("$FlatInputComboBoxStyle") as Style; ContentTypeComboBox.ComboBox.Style = this.FindResource("$FlatInputComboBoxStyle") as Style; ResponseTypeComboBox.ComboBox.Style = this.FindResource("$FlatInputComboBoxStyle") as Style; ApplicationAPIModel AAMS = mApplicationAPIModel as ApplicationAPIModel; GingerCore.GeneralLib.BindingHandler.ObjFieldBinding(SoapActionTextBox, TextBox.TextProperty, mApplicationAPIModel, nameof(AAMS.SOAPAction)); GingerCore.GeneralLib.BindingHandler.ObjFieldBinding(TemplateFileNameFileBrowser, TextBox.TextProperty, mApplicationAPIModel, nameof(mApplicationAPIModel.TemplateFileNameFileBrowser)); SetViewByAPIType(mApplicationAPIModel.APIType); }