private static async Task RunScriptAgainstForm(IEnumerable <EntityRecommendation> entities, params string[] script) { IFormTarget target = new FormTarget(); using (var container = Build(Options.ResolveDialogFromContainer, target)) { { var root = new FormDialog <IFormTarget>(target, entities: entities); var builder = new ContainerBuilder(); builder .RegisterInstance(root) .AsSelf() .As <IDialog <object> >(); builder.Update(container); } await AssertScriptAsync(container, script); { Assert.AreEqual(Input.Text, target.Text); Assert.AreEqual(Input.Integer, target.Integer); Assert.AreEqual(Input.Float, target.Float); } } }
/// <summary> /// 속성 중 Attribute Node로 표현해야 한다. /// </summary> /// <param name="writer"></param> public override void GenerateXmlAttributes(System.Xml.XmlWriter writer) { base.GenerateXmlAttributes(writer); if (ViewMode.HasValue) { writer.WriteAttributeString("ViewMode", ViewMode.Value.GetHashCode().ToString()); } if (EnableLink.HasValue) { writer.WriteAttributeString("EnableLink", EnableLink.Value.GetHashCode().ToString()); } if (ShowFormBtn.HasValue) { writer.WriteAttributeString("ShowFormBtn", ShowFormBtn.Value.GetHashCode().ToString()); } if (FormAction.IsNotWhiteSpace()) { writer.WriteAttributeString("FormAction", FormAction); } if (FormMethod.IsNotWhiteSpace()) { writer.WriteAttributeString("FormMethod", FormMethod); } if (FormTarget.IsNotWhiteSpace()) { writer.WriteAttributeString("FormTarget", FormTarget); } if (FormBtnTitle.IsNotWhiteSpace()) { writer.WriteAttributeString("FormBtnTitle", FormBtnTitle); } if (FormBtnWidth.HasValue) { writer.WriteAttributeString("FormBtnWidth", FormBtnWidth.Value.ToString()); } if (FormBtnBorderColor.HasValue) { writer.WriteAttributeString("FormBtnBorderColor", FormBtnBorderColor.Value.ToHexString()); } if (FormBtnBgColor.HasValue) { writer.WriteAttributeString("FormBtnBgColor", FormBtnBgColor.Value.ToHexString()); } if (BtnPadding.HasValue) { writer.WriteAttributeString("BtnPadding", BtnPadding.Value.ToString()); } }
private static async Task RunScriptAgainstForm(IEnumerable<EntityRecommendation> entities, params string[] script) { IFormTarget target = new FormTarget(); using (var container = Build(Options.ResolveDialogFromContainer, target)) { { var root = new FormDialog<IFormTarget>(target, entities: entities); var builder = new ContainerBuilder(); builder .RegisterInstance(root) .AsSelf() .As<IDialog<object>>(); builder.Update(container); } await AssertScriptAsync(container, script); { Assert.AreEqual(Input.Text, target.Text); Assert.AreEqual(Input.Integer, target.Integer); Assert.AreEqual(Input.Float, target.Float); } } }
public override string GetStringAttributes() { if (string.IsNullOrWhiteSpace(CacheAttributes)) { if (FormMethod != null) { SetAttribute("method", FormMethod.ToString()); } else { RemoveAttribute("method"); } if (EncTypeData != null) { SetAttribute("enctype", GetEnctypeHtmlForm(EncTypeData)); } else { RemoveAttribute("enctype"); } if (!string.IsNullOrWhiteSpace(FormAction)) { SetAttribute("action", FormAction); } else { RemoveAttribute("action"); } if (!string.IsNullOrWhiteSpace(AcceptCharset)) { SetAttribute("accept-charset", AcceptCharset); } else { RemoveAttribute("accept-charset"); } if (FormTarget != hmFormTargetsEnum.NULL) { SetAttribute("target", FormTarget.ToString("g")); } else { RemoveAttribute("target"); } if (NoValidate) { SetAttribute("novalidate", null); } else { RemoveAttribute("novalidate"); } if (!(AutoComplete is null)) { SetAttribute("autocomplete", AutoComplete == true ? "on" : "off"); } else { RemoveAttribute("autocomplete"); } }