public void Render(EventLookupValueModel model) { Model = model; ckbUseCategory.Checked = Model.Item.UseCategory; tbCategory.Text = Model.Item.Category; ckbOnlyNetwork.Checked = Model.Item.OnlyNetworkValues; RefreshCategory(); CRUDUIService.RenderList(Model.Item.Criteria, lbCriteria); CRUDUIService.RenderList(Model.Item.ValueNames, lbValueNames); CRUDUIService.RenderList(Model.Item.Conditions, lbConditions); CRUDUIService.RenderEnumList <LookupDirection>(cbLookupDirection, Model.Item.LookupDirection); }
public void Render(EventModel model) { Model = model; var i = model.Item; tbSort.Text = i.Sort; tbDocumentation.Rtf = i.Documentation; ckbDocumentMap.Checked = i.DocumentMap; tbName.Text = i.Name; ckbGapNormal.Checked = i.GapNormal; ckbTimeFromParent.Checked = i.DisplayDurationFromParent; ckbDurationFromSibling.Checked = i.DisplayDurationFromSibling; tbRegularExpression.Text = i.RegularExpression; tbExample.Text = i.Example; clbCategory.Items.Clear(); foreach (var item in model.Categories) { clbCategory.Items.Add(item); foreach (var category in model.Item.Categories) { if (item.CategoryId == category.CategoryId) { clbCategory.SetItemChecked(clbCategory.Items.Count - 1, true); } } } UICommon.AutoColumnWidth(clbCategory); clbSourceType.Items.Clear(); clbSourceType.Items.Add(Keywords.ALL, model.Item.SourceTypes.Contains(Keywords.ALL)); foreach (var item in model.SourceTypes) { clbSourceType.Items.Add(item); foreach (var sourceType in model.Item.SourceTypes) { if (item == sourceType) { clbSourceType.SetItemChecked(clbSourceType.Items.Count - 1, true); } } } UICommon.AutoColumnWidth(clbSourceType); cbFoldingEventId.Items.Clear(); foreach (EventLR item in model.Events) { cbFoldingEventId.Items.Add(item); if (item.EventId == model.Item.FoldingEventId) { cbFoldingEventId.SelectedItem = item; } } switch (model.Mode) { case InputMode.Add: Text = @"Add EventPattern"; break; case InputMode.Edit: Text = @"Edit EventPattern"; break; } cbSourceType.Items.Clear(); cbSourceType.Items.Add(""); foreach (var item in XmlDal.DataModel.Options.FileTypes) { cbSourceType.Items.Add(item); } cbSourceType.Text = i.SourceType ?? ""; cbNetworkCommunication.Items.Clear(); cbNetworkCommunication.Items.Add(""); foreach (var item in Enum.GetNames(typeof(NetworkDirection)).ToList()) { if (item == "Na") { continue; } cbNetworkCommunication.Items.Add(item); } cbNetworkCommunication.Text = i.Network == NetworkDirection.Na ? "" : i.Network.ToString(); CRUDUIService.RenderEnumList <DocumentMapLevel>(cbLevel, i.Level); cbIgnoreDocumentation.Checked = i.IgnoreDocumentation; Type t = typeof(Color); var p = t.GetProperties(); foreach (var item in p) { if (item.PropertyType.FullName.Equals("System.Drawing.Color", StringComparison.CurrentCultureIgnoreCase)) { cbColor.Items.Add(item.Name); cbDocumentMapHighlightColor.Items.Add(item.Name); } } cbColor.Text = i.HighlightColor == Color.Transparent.Name ? "" : i.HighlightColor; cbDocumentMapHighlightColor.Text = i.DocumentMapHighlightColor == Color.Transparent.Name ? "" : i.DocumentMapHighlightColor; CRUDUIService.RenderList(i.EventValues, lbValues); CRUDUIService.RenderList(i.EventLookupValues, lbLookupValues); ckbIgnoreName.Checked = i.IgnoreName; }