//Тест простой вьюхи public void ViewSimpleTest(string type, string fieldName, string id, string result) { _rootPanel.Children.Add(new ModalViewModel(_rootPanel) { Type = type, FieldInDb = fieldName, RuDescription = "Комент", ControlIdView = id }); _helper.Construct(_rootPanel.Children, false); Assert.AreEqual(result, _helper.ToString()); }
/// <summary> /// Получить код страницы /// </summary> /// <param name="parametr"></param> public void GetPage(string parametr) { if (!EnterResourcePath()) { return; } PageConstructotHelper helper = new PageConstructotHelper(); helper.ResourceNamespace = ResourceNameSpace; switch (parametr) { case "e": helper.Construct(Properties, true); Clipboard.SetText(helper.ToString()); _aggregator.PublishOnUIThread("[Инфо]:Скопированно в буфер"); return; case "v": helper.Construct(Properties, true); Clipboard.SetText(helper.ToString()); _aggregator.PublishOnUIThread("[Инфо]:Скопированно в буфер"); return; case "ef": helper.Construct(Properties, true); helper.FullPage = true; if (_diskPath.GetPath("EditPage")) { string file = _diskPath.Path; string csfile = file + ".cs"; string designerfile = file + ".designer.cs"; File.WriteAllText(file, helper.ToString()); File.WriteAllText(csfile, helper.GetCodebehind(true)); File.WriteAllText(designerfile, ""); _aggregator.PublishOnUIThread("[Инфо]:Записан файл"); } return; case "vf": if (_diskPath.GetPath("EditPage")) { EnterNameViewModel model = EnterNameViewModel.CreateEnterNamespace(); //ModalView window = new ModalView { DataContext = model }; if (_windowManager.ShowDialog(model) == true && model.IsValid) { helper.ClassName = model.Value; helper.FullPage = true; helper.Construct(Properties, false); string file = _diskPath.Path; string csfile = file + ".cs"; string designerfile = file + ".designer.cs"; File.WriteAllText(file, helper.ToString()); File.WriteAllText(csfile, helper.GetCodebehind(false)); File.WriteAllText(designerfile, ""); _aggregator.PublishOnUIThread("[Инфо]:Записан файл"); } } return; } }