public PortalForm(IPortal prtl, Login lgn, IFTserver ftsrvr) { InitializeComponent(); portal = prtl; ftserver = ftsrvr; login = lgn; //portal.portalEvent += new PortalEvent(HandlePortalEvent); SetWindowTheme(treeView1.Handle, "explorer", null); SetWindowTheme(listView1.Handle, "explorer", null); SetWindowTheme(listView2.Handle, "explorer", null); this.treeView1.HotTracking = true; this.treeView1.FullRowSelect = true; }
private void RegisterRemoting() { { try { BinaryServerFormatterSinkProvider server_provider = new BinaryServerFormatterSinkProvider(); server_provider.TypeFilterLevel = System.Runtime.Serialization.Formatters.TypeFilterLevel.Full; BinaryClientFormatterSinkProvider client_provider = new BinaryClientFormatterSinkProvider(); IDictionary properties = new Hashtable(); properties["port"] = "0"; TcpChannel channel = new TcpChannel(properties, client_provider, server_provider); ChannelServices.RegisterChannel(channel, false); user = (IUser)Activator.GetObject(typeof(IUser), "tcp://localhost:9998/UserHandeling"); portal = (IPortal)Activator.GetObject(typeof(IPortal), "tcp://localhost:9998/PortalHandeling"); ftserver = (IFTserver)Activator.GetObject(typeof(IFTserver), "tcp://localhost:9998/TransferHandeling"); } catch (RemotingException e) { MessageBox.Show("Connection Error"); } } }