void loginCommand() { if (CacheManager.Instance.LoginUser.UserName.Equals("未知用户")) { LoginWindow loginWin = new LoginWindow(); loginWin.Closed += (s, arg) => { if (loginWin.DialogResult.Value) { this.UserName = CacheManager.Instance.LoginUser.UserName; } }; loginWin.ShowDialog(); } else { OSKernel.Presentation.Login.Summary.IndexView userInfo = new OSKernel.Presentation.Login.Summary.IndexView("userInfo"); userInfo.ShowDialog(); } }
static void Main() { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); BinaryServerFormatterSinkProvider serverProvider = new BinaryServerFormatterSinkProvider(); serverProvider.TypeFilterLevel = System.Runtime.Serialization.Formatters.TypeFilterLevel.Full; BinaryClientFormatterSinkProvider clientProvider = new BinaryClientFormatterSinkProvider(); IDictionary properties = new Hashtable(); properties["port"] = 0; TcpChannel tcpChannel = new TcpChannel(properties, clientProvider, serverProvider); ChannelServices.RegisterChannel(tcpChannel, false); IServices server = (IServices)Activator.GetObject(typeof(IServices), "tcp://localhost:55555/Triathlon"); //IServices server = new ServerProxy("127.0.0.1", 55555); ClientController ctrl = new ClientController(server); LoginWindow window = new LoginWindow(ctrl); Application.Run(window); }
//Closing事件 private void Window_Closing(object sender, System.ComponentModel.CancelEventArgs e) { LoginWindow LW = new LoginWindow(); LW.Show(); }
public void set(LoginController loginController, LoginWindow loginWindow, AppWindow appWindow) { this.loginController = loginController; this.loginWindow = loginWindow; this.appWindow = appWindow; }
private void personalInitalize() { loginUI = new LoginWindow(this); loginUI.ShowDialog(); }
void Application_Startup(object sender, StartupEventArgs e) { LoginWindow window = new LoginWindow(); window.Show(); }