Exemplo n.º 1
0
 public LoginViewModel(IWindowManager windowManager)
 {
     _windowManager = windowManager;
     _connection = FowaConnection.Instance;
     _connection.ConnectionFailed += OnConnectionFailed;
     FowaMetaData data = new FowaMetaData { OnIncomingFriendlistMessageCallback = OnIncomingFriendlistMessage, OnIncomingErrorMessageCallback = OnIncomingErrorMessage};
     _connection.FowaMetaData = data;
 }
Exemplo n.º 2
0
 public ContactViewModel(IWindowManager windowManager, IEnumerable<IContact> friends)
 {
     _connection = FowaConnection.Instance;
     FowaMetaData metaData = new FowaMetaData { OnIncomingUserMessageCallback = OnIncomingUserMessage };
     _connection.FowaMetaData = metaData;
     _windowManager = windowManager;
     Friends = new BindableCollection<IContact>(friends);
     OpenTabs = new Dictionary<int, int>();
     StartListeningAsync();
 }
Exemplo n.º 3
0
        public MainWindow()
        {
            _metaData = new FowaMetaData
                            {
                                OnIncomingLoginMessageCallback = OnIncomingLoginMessage,
                                OnIncomingUserMessageCallback = OnIncomingUserMessage,
                                OnIncomingRegisterMessageeCallback = OnIncomingRegisterMessage
                            };

            _service = new FowaService(_metaData, 55555);
            _service.UserDisconnected += OnUserDiconnected;
            _userFriendService = new UserFriendsService();

            InitializeComponent();
            _service.StartServer();
        }
Exemplo n.º 4
0
 public RegisterViewModel(IWindowManager windowManager)
 {
     FowaMetaData metaData = new FowaMetaData
                                 {
                                     OnIncomingErrorMessageCallback = OnIncomingErrorMessage,
                                     OnIncomingFriendlistMessageCallback = OnIncomingFriendListMessage
                                 };
     Info = "Register info\n\tFill in the fields and register to be cool :D\n\t...";
     _windowManager = windowManager;
     _connection = FowaConnection.Instance;
     _connection.FowaMetaData = metaData;
 }