public override void TestsInitialize() { base.TestsInitialize(); WcfServiceHost.StartService <TestService, ITestService>(); ServiceAdapter = new ServiceAdapter <ITestService>(); ClientServiceLocator.Instance().CommandDispatcher = new WcfServiceHost(); }
public override void TestCleanUp() { WcfServiceHost.StopService <ICustomerService>(); WcfServiceHost.StopService <IAddressService>(); ClientServiceLocator.Instance().CommandDispatcher = _originalCommandDispatcher; base.TestCleanUp(); }
public override void TestsInitialize() { base.TestsInitialize(); this.DesignationService = ClientServiceLocator.Instance().ContractLocator.DesignationServices; this.UserService = ClientServiceLocator.Instance().ContractLocator.UserServices; CurrentUserInstance = UserService.GetById(SuperAdminId); }
public void CustomerServiceTestsInitialize() { ClientServiceLocator.Instance().CommandDispatcher = new DirectCommandDispatcher(); GlobalContext.Instance().TransFactory = new TransManagerEntityStoreFactory(); Container.RequestContext = new RequestContextNaive(); ServiceAdapter = new ServiceAdapter <ICustomerService>(); }
public void Init() { mocks = new MockRepository(); config = mocks.StrictMock <IUserConfiguration>(); factory = mocks.Stub <IViewFactory>(); view = MockRepository.GenerateStub <ISettingsView>(); ClientServiceLocator.Register(config); }
public override void TestsInitialize() { base.TestsInitialize(); WcfServiceHost.StartService <CustomerService, ICustomerService>(); WcfServiceHost.StartService <AddressService, IAddressService>(); _originalCommandDispatcher = ClientServiceLocator.Instance().CommandDispatcher; ClientServiceLocator.Instance().CommandDispatcher = new WcfTestCommandDispatcher(); }
public void ResetLanguage() { Text = ClientServiceLocator.GetService <ILanguage>().GetText("Settings"); checkBoxRunAuto.Text = ClientServiceLocator.GetService <ILanguage>().GetText("RunAuto"); label6.Text = ClientServiceLocator.GetService <ILanguage>().GetText("Language"); buttonOk.Text = ClientServiceLocator.GetService <ILanguage>().GetText("Ok"); buttonCancel.Text = ClientServiceLocator.GetService <ILanguage>().GetText("Cancel"); }
private void ResetLanguage() { label1.Text = ClientServiceLocator.GetService <ILanguage>().GetText("ZetSwitch") + " " + Properties.Resources.Version; button1.Text = ClientServiceLocator.GetService <ILanguage>().GetText("Ok"); lblEmail.Text = ClientServiceLocator.GetService <ILanguage>().GetText("Email"); lblAuthor.Text = ClientServiceLocator.GetService <ILanguage>().GetText("Author"); Text = ClientServiceLocator.GetService <ILanguage>().GetText("Welcome"); }
public void Init() { mocks = new MockRepository(); config = mocks.StrictMock <IUserConfiguration>(); factory = mocks.Stub <IViewFactory>(); view = mocks.DynamicMock <IWelcomeView>(); ClientServiceLocator.Register(config); }
public void Init() { mocks = new MockRepository(); config = mocks.StrictMock <IUserConfiguration>(); view = mocks.DynamicMock <IProfileView>(); manager = mocks.DynamicMock <IDataManager>(); ClientServiceLocator.Register(config); }
public void ResetLanguage() { Text = ClientServiceLocator.GetService <ILanguage>().GetText("ProfileSettings"); label10.Text = ClientServiceLocator.GetService <ILanguage>().GetText("Browsers"); groupBox1.Text = ClientServiceLocator.GetService <ILanguage>().GetText("Servers"); groupBox2.Text = ClientServiceLocator.GetService <ILanguage>().GetText("Homepage"); cbUseAll.Text = ClientServiceLocator.GetService <ILanguage>().GetText("UseForAll"); }
public override void TestsInitialize() { base.TestsInitialize(); this.UserService = ClientServiceLocator.Instance().ContractLocator.UserServices; this.AddressService = ClientServiceLocator.Instance().ContractLocator.AddressServices; this.UserGroupService = ClientServiceLocator.Instance().ContractLocator.UserGroupServices; //this.UserUserGroupService = ClientServiceLocator.Instance().ContractLocator.UserUserGroupServices; }
public override void TestsInitialize() { base.TestsInitialize(); this.LabourChargeTypeService = ClientServiceLocator.Instance().ContractLocator.LabourChargeTypeServices; this.UserService = ClientServiceLocator.Instance().ContractLocator.UserServices; this.ChargesPayableToService = ClientServiceLocator.Instance().ContractLocator.ChargesPayableToServices; this.MeasuringUnitService = ClientServiceLocator.Instance().ContractLocator.MeasuringUnitServices; CurrentUserInstance = UserService.GetById(SuperAdminId); }
public CustomerViewModel() { CustomerServiceInstance = ClientServiceLocator.Instance().ContractLocator.CustomerServices; Refresh(); View = new CustomerView { DataContext = this }; View.ShowDialog(); }
private void ResetLanguage() { CButton.Text = ClientServiceLocator.GetService <ILanguage>().GetText("Cancel"); OkButton.Text = ClientServiceLocator.GetService <ILanguage>().GetText("Ok"); foreach (var panel in panels) { panel.ResetLanguage(); } }
private void OnOpenSettings(object sender, EventArgs e) { var controler = ClientServiceLocator.GetService <ISettingsController>(); if (controler.Show()) { view.ResetLanguage(); } }
public void ShowError(IList <string> messages) { if (messages.Count != 0) { var message = new StringBuilder(); message.Append(ClientServiceLocator.GetService <ILanguage>().GetText("ProfileError")); message.Append(String.Join("\n -", messages.ToArray())); MessageBox.Show(message.ToString(), ClientServiceLocator.GetService <ILanguage>().GetText("Error"), MessageBoxButtons.OK, MessageBoxIcon.Exclamation); } }
public void ResetLanguage() { IPDHCPManual.Text = ClientServiceLocator.GetService <ILanguage>().GetText("TextUseThisSetting"); DNSDHCPManual.Text = ClientServiceLocator.GetService <ILanguage>().GetText("TextUseThisSetting"); label3.Text = ClientServiceLocator.GetService <ILanguage>().GetText("TextDefGate"); IPDHCPAuto.Text = ClientServiceLocator.GetService <ILanguage>().GetText("TextOtainDNS"); label2.Text = ClientServiceLocator.GetService <ILanguage>().GetText("TextMask"); label7.Text = ClientServiceLocator.GetService <ILanguage>().GetText("TextConSelect"); DNSDHCPAuto.Text = ClientServiceLocator.GetService <ILanguage>().GetText("TextOtainDNS"); }
public void ResetLanguage() { lblName.Text = ClientServiceLocator.GetService <ILanguage>().GetText("ZetSwitch") + " " + Properties.Resources.Version; btnOk.Text = ClientServiceLocator.GetService <ILanguage>().GetText("Ok"); checkBoxShowAgain.Text = ClientServiceLocator.GetService <ILanguage>().GetText("DontShowAgain"); lblLanguage.Text = ClientServiceLocator.GetService <ILanguage>().GetText("Language"); lblEmail.Text = ClientServiceLocator.GetService <ILanguage>().GetText("Email"); lblAuthor.Text = ClientServiceLocator.GetService <ILanguage>().GetText("Author"); Text = ClientServiceLocator.GetService <ILanguage>().GetText("Welcome"); }
public AddressDetailViewModel(AddressDto operation) { AddressServiceInstance = ClientServiceLocator.Instance().ContractLocator.AddressServices; Model = new AddressDetailModel { Address = new AddressDto() }; Model.Address = operation; View = new AddressDetailView { DataContext = this }; }
private static void LoadLanguage() { try { var language = new Language(); ClientServiceLocator.Register <ILanguage>(language); var store = new LanguagesStore(); language.LoadDefault(store); } catch (Exception) { } }
public bool ComapreIPGWNet(IPAddress mask, IPAddress gw) { if (!mask.SubnetMaskValidation()) { throw new Exception(ClientServiceLocator.GetService <ILanguage>().GetText("NonValidSubNetMask")); } IPAddress gwNet = gw & mask; IPAddress ipNet = this & mask; return(gwNet.Compare(ipNet)); }
public void ShouldOpenAbout() { var evnt = new EventHelper(() => { view.OpenAbout += null; }); var about = mocks.StrictMock <IAboutController>(); ClientServiceLocator.Register(about); about.Stub(x => x.Show()).Repeat.Once(); mocks.ReplayAll(); new MainController(view, manager); evnt.Raise(); }
static void WinFormApp(Arguments arg) { InitServices(); var welcome = new WelcomeController(new ViewFactory()); welcome.TryShow(); var manager = new DataManager(); try { manager.StartDelayedLoading(); manager.LoadProfiles(); } catch (Exception e) { MessageBox.Show(e.Message, ClientServiceLocator.GetService <ILanguage>().GetText("Error"), MessageBoxButtons.OK, MessageBoxIcon.Error); UseTrace(e); } var frm = new MainForm(manager); try { new MainController(frm, manager); if (arg.Minimalize) { frm.GoToTray(); Application.Run(); manager.SaveSettings(); } else if (arg.ConsoleMode) { ApplyProfile(manager, arg.Profiles[0]); } else { Application.Run(frm); manager.SaveSettings(); } } catch (Exception e) { using (var form = new ExceptionForm(e.Message + "\n\n" + e.StackTrace)) { form.FormBorderStyle = FormBorderStyle.FixedDialog; form.StartPosition = FormStartPosition.CenterScreen; form.ShowDialog(); } UseTrace(e); } finally { manager.Dispose(); frm.Dispose(); Properties.Settings.Default.Save(); } }
private void OnSelectProfileIcon(object o, EventArgs e) { var images = ClientServiceLocator.GetService <IImageRepository>(); string path = images.GetDirectory(); string filter = Resources.imagesDialogString; string fileName = actView.AskToSelectNewIcon(path, filter); if (!String.IsNullOrEmpty(fileName)) { actProfile.IconFile = images.InitImage(fileName); actView.UpdateIcon(); } }
public override void TestsInitialize() { base.TestsInitialize(); this.UserService = ClientServiceLocator.Instance().ContractLocator.UserServices; this.AddressService = ClientServiceLocator.Instance().ContractLocator.AddressServices; this.UserGroupService = ClientServiceLocator.Instance().ContractLocator.UserGroupServices; this.RoleService = ClientServiceLocator.Instance().ContractLocator.RoleServices; this.UserRolePermissionService = ClientServiceLocator.Instance().ContractLocator.UserRolePermissionServices; this.CountryService = ClientServiceLocator.Instance().ContractLocator.CountryServices; this.StateService = ClientServiceLocator.Instance().ContractLocator.StateServices; CurrentUserInstance = UserService.GetById(SuperAdminId); CountryInstance = CountryService.GetById(CountryId); }
private void SaveHomePage(string homePage) { try { var key = Registry.CurrentUser.CreateSubKey("Software\\Microsoft\\Internet Explorer\\Main"); if (key == null) { throw new Exception(ClientServiceLocator.GetService <ILanguage>().GetText("CannotOpenRegistry")); } key.SetValue("Start Page", homePage); } catch (Exception) { } }
private static void InitServices() { IViewFactory viewFactory = new ViewFactory(); var imageRepository = new ImageRepository(); ClientServiceLocator.Register(viewFactory); ClientServiceLocator.Register <IUserConfiguration>(new UserConfiguration()); ClientServiceLocator.Register <ISettingsController>(new SettingsController(viewFactory)); ClientServiceLocator.Register <IAboutController>(new AboutController(viewFactory)); ClientServiceLocator.Register <IProfileController>(new ProfileController()); ClientServiceLocator.Register <IShortcutCreator>(new ShorcutCreator()); ClientServiceLocator.Register <IImageRepository>(imageRepository); }
void OnCreateShortcut(object sender, EventArgs e) { var profile = view.GetSelectedProfile(); if (profile == null) { return; } var p = manager.GetProfile(profile); var shortcut = ClientServiceLocator.GetService <IShortcutCreator>(); shortcut.CreateProfileLnk(p); }
public void ShouldOpenSettingsAndResetLanguage() { var evnt = new EventHelper(() => { view.OpenSettings += null; }); var settings = mocks.StrictMock <ISettingsController>(); ClientServiceLocator.Register(settings); settings.Stub(x => x.Show()).Repeat.Once().Return(true); view.Stub(x => x.ResetLanguage()).Repeat.Once(); mocks.ReplayAll(); new MainController(view, manager); evnt.Raise(); }