示例#1
0
        public static void Main(string[] args)
        {
            BinaryServerFormatterSinkProvider serverProv = new BinaryServerFormatterSinkProvider();

            serverProv.TypeFilterLevel = System.Runtime.Serialization.Formatters.TypeFilterLevel.Full;
            BinaryClientFormatterSinkProvider clientProv = new BinaryClientFormatterSinkProvider();
            IDictionary props = new Hashtable();

            props["port"] = 0;
            TcpChannel channel = new TcpChannel(props, clientProv, serverProv);

            ChannelServices.RegisterChannel(channel, false);
            IChatServices services =
                (IChatServices)Activator.GetObject(typeof(IChatServices), "tcp://localhost:55555/Chat");

            Console.WriteLine("am obtinut referinta!!!");



            Application.Init();
            GTKClientCtrl ctrl = new GTKClientCtrl(services);
            Window        w    = new LoginWindow(ctrl);

            // Window w = new ChatWindow();
            w.ShowAll();
            Application.Run();

            //Console.ReadKey();
        }
 public ChatController(PblogsContext context, IUserServices userServices, IChatServices chatServices, IMemoryCache cache, IHubContext <Signalr> hubContext)
 {
     _context      = context;
     _chatServices = chatServices;
     _userServices = userServices;
     _Cache        = cache;
     _hubContext   = hubContext;
 }
示例#3
0
 public MainWindow()
 {
     InitializeComponent();
     _channelFactory = new DuplexChannelFactory <IChatServices>(new ClientCallback(), "ChatServiceEndPoint");
     Server          = _channelFactory.CreateChannel();
     webcam          = new WebCam();
     webcam.InitializeWebCam(ref imgVideo);
 }
        public ChatViewModel()
        {
            _chatServices = DependencyService.Get <IChatServices> ();
            _chatMessage  = new ChatMessageViewModel();

            _messages = new ObservableCollection <ChatMessageViewModel> ();
            _chatServices.Connect();
            _chatServices.OnMessageReceived += _chatServices_OnMessageReceived;
        }
        public MainPageViewModel(INavigationService navigationService, IChatServices chatService) : base(navigationService)
        {
            _chatService = chatService;

            Title = "SignalR Chat";

            Messages = new ObservableRangeCollection <Message>();

            SendCommand = new DelegateCommand(SendExecute);

            _chatService.OnMessageReceived += OnMessageReceived;
            _chatService.ConnectAsync();
        }
示例#6
0
 public ChatClientWorker(IChatServices server, TcpClient connection)
 {
     this.server     = server;
     this.connection = connection;
     try
     {
         stream    = connection.GetStream();
         formatter = new BinaryFormatter();
         connected = true;
     }
     catch (Exception e)
     {
         Console.WriteLine(e.StackTrace);
     }
 }
示例#7
0
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            BinaryServerFormatterSinkProvider serverProv = new BinaryServerFormatterSinkProvider();

            serverProv.TypeFilterLevel = System.Runtime.Serialization.Formatters.TypeFilterLevel.Full;
            BinaryClientFormatterSinkProvider clientProv = new BinaryClientFormatterSinkProvider();
            IDictionary props = new Hashtable();

            props["port"] = 0;
            TcpChannel channel = new TcpChannel(props, clientProv, serverProv);

            ChannelServices.RegisterChannel(channel, false);
            IChatServices services =
                (IChatServices)Activator.GetObject(typeof(IChatServices), "tcp://localhost:55555/Chat");

            ChatClientCtrl ctrl = new ChatClientCtrl(services);
            LoginWindow    win  = new LoginWindow(ctrl);

            Application.Run(win);
        }
 public ChatsController(IChatServices services)
 {
     this.services = services;
 }
示例#9
0
 public ChatController(IChatServices chatServices)
 {
     ChatServices = chatServices;
 }
示例#10
0
 public ChatController(IUsersServices userServices, IChatServices chatServices)
 {
     this._userServices = userServices;
     this._chatServices = chatServices;
 }
示例#11
0
 public GTKClientCtrl(IChatServices server)
 {
     this.server = server;
     currentUser = null;
 }
示例#12
0
 public ChatsController(UserManager <AppUser> userManager, IChatServices chatServices, IMapper mapper)
 {
     _chatServices = chatServices;
     _userManager  = userManager;
     _mapper       = mapper;
 }
示例#13
0
 public ChatClientCtrl(IChatServices services)
 {
     this.services = services;
     currentUser   = null;
 }
示例#14
0
 public SerialChatServer(string host, int port, IChatServices server) : base(host, port)
 {
     this.server = server;
     Console.WriteLine("SerialChatServer...");
 }
示例#15
0
 public UserController(IChatServices chatServices, IUserServices userServices, IMapper mapper)
 {
     _userServices = userServices;
     _mapper       = mapper;
     _chatServices = chatServices;
 }
示例#16
0
 public ChatController(IChatServices chatService, IRoomServices roomServices)
 {
     _chatService  = chatService;
     _roomServices = roomServices;
     GetUserId     = () => User.Identity.GetUserId();
 }
示例#17
0
 public ChatController(IChatServices services)
 {
     // major release
     _chatServices = services;
 }