public UiDescription Design(IEnumerable<IModel> models) { var data = new UiDescription(); foreach (var model in models) data.Add("DataRadioButton", model.GetDescription(), model.GetDescription(), false); return data; }
public UiDescription GetUserData() { var data = new UiDescription(); foreach (Control control in form1.Controls) { Data cData = GetControlData(control); if (cData == null) continue; data.Add(cData); } return data; }
private static UiDescription Question(string question, string rightAnswer, IEnumerable<string> wrongAnsers) { var data = new UiDescription(); var tmp = new UiDescription(); var qData = new UiDescriptionItem { Name = "question", ControlType = "Label", Value = question }; data.Add(qData); var rData = new UiDescriptionItem { Name = rightAnswer, Text = rightAnswer, ControlType = "DataRadioButton", Value = true, CheckRequired = true }; data.Add(rData); foreach (var wAnswer in wrongAnsers) { var wData = new UiDescriptionItem { Name = wAnswer, Text = wAnswer, ControlType = "DataRadioButton", Value = false, CheckRequired = true }; tmp.Add(wData); } foreach (var dataItem in tmp) data.Add(dataItem); return data; }
/// <summary> /// Gets entered by user informaition from form /// </summary> /// <returns></returns> public UiDescription GetUserData() { var data = new UiDescription(); foreach (Control control in UserControls) { var dataControl = GetDataControl(control); data.Add(dataControl.ControlType, dataControl.ControlName, dataControl.Value); } return data; }
private UiDescription InitialProblemResultEnteringStep(UiDescription userData) { SetNextStep(InitialStep); IsEnd = true; var prevResult = _simplex.GetNormalizedProblemResult(CurrentSimplexTable, CurrentProblem); var result = _simplex.GetInitialProblemResult(CurrentSimplexTable, CurrentProblem); var data = new UiDescription { {"Label", "lab1", "Ф-ція цілі допоміжної задачі:"}, {"TargetFunctionBox", "targetFunction", CurrentProblem.TargetFunction}, {"Label", "lab2", "Результат розв’язку допоміжної задачі:"}, {"LppResultView", "prevResult", prevResult}, {"Label", "lab3", "Ф-ція цілі вихідної задачі:"}, {"TargetFunctionBox", "initialProblemTF", CurrentProblem.InitialProblem.TargetFunction}, {"Label", "lab4", "Заміни введені у допоміжну задачу:"} }; foreach (var replacement in CurrentProblem.Replacements) data.Add("Label", replacement.Key + "Lab", replacement.Key + " = " + replacement.Value.Key + " - " + replacement.Value.Value); data.Add("Label", "lab5", "Введіть результат розв’язку вихідної задачі:"); data.Add("LppResultView", "result", "", result, true, true, CurrentProblem.InitialProblem.TargetFunction.Arguments); return data; }