Exemplo n.º 1
0
 public IrcNetworkInformationViewModel(IrcNetwork network, IrcNetworkViewModel networkVM)
     : base(networkVM)
 {
     this.Network   = network;
     this.IsVisible = true;
     PropertyChangedEventManager.AddHandler(this.Network, Network_ConnectionStatusChanged, o => o.ConnectionStatus);
 }
        protected IrcConversationViewModel(IrcNetworkViewModel networkVM)
        {
            int maxItemCount = Locator.Get <ISettings>().MaximumMessagesCount;

            this.Messages   = new FixedSpaceCollection <Message>(maxItemCount, true);
            this._networkVM = networkVM;

            PropertyChangedEventManager.AddHandler(Locator.Get <ISettings>(), MaximumMessagesCountChanged, o => o.MaximumMessagesCount);
            PropertyChangedEventManager.AddHandler(this, This_IsSelectedChanged, o => o.IsSelected);
        }
        public IrcChannelViewModel(IrcChannel channel, IrcNetworkViewModel networkVM)
            : base(networkVM)
        {
            this.Channel   = channel;
            this.IsVisible = true;

            PropertyChangedEventManager.AddHandler(this.Channel, Channel_TopicChanged, o => o.Topic);
            var currentPair = this.Channel.UserModes.First(p => p.User == this.Channel.Network.CurrentUser);

            PropertyChangedEventManager.AddHandler(currentPair, (s, e) => this.CanEditTopicChanged(), o => o.Mode);
            CollectionChangedEventManager.AddHandler(this.Channel.Modes, (s, e) => this.CanEditTopicChanged());

            this.Channel.MessageReceived += Channel_MessageReceived;
            this.Channel.UserJoined      += Channel_UserJoined;
            this.Channel.UserLeft        += Channel_UserLeft;
            this.Channel.UserKicked      += Channel_UserKicked;
            this.Channel.ModeChanged     += Channel_ModeChanged;
            this.Channel.InviteReceived  += Channel_InviteReceived;

            this.Channel.Ctcp.ActionReceived += Channel_Ctcp_ActionReceived;
        }
Exemplo n.º 4
0
        public IrcUserViewModel(IrcUser user, IrcNetworkViewModel networkVM)
            : base(networkVM)
        {
            this.User = user;
            PropertyChangedEventManager.AddHandler(this.User, PartnerNicknameChanged, o => o.Nickname);

            this.User.MessageReceived     += User_MessageReceived;
            this.User.NoticeReceived      += User_NoticeReceived;
            this.User.InformationReceived += User_InformationReceived;
            this.User.ModeChanged         += User_ModeChanged;
            this.User.NicknameChanged     += User_NicknameChanged;
            this.User.Quit += User_Quit;

            this.User.Ctcp.ActionReceived             += User_Ctcp_ActionReceived;
            this.User.Ctcp.ClientCapabilitiesReceived += User_Ctcp_ClientCapabilitiesReceived;
            this.User.Ctcp.ClientInformationReceived  += User_Ctcp_ClientInformationReceived;
            this.User.Ctcp.ClientLocationReceived     += User_Ctcp_ClientLocationReceived;
            this.User.Ctcp.PingReplyReceived          += User_Ctcp_PingReplyReceived;
            this.User.Ctcp.LocalTimeReceived          += User_Ctcp_LocalTimeReceived;
            this.User.Ctcp.InformationReceived        += User_Ctcp_InformationReceived;
            this.User.Ctcp.ErrorMessageReceived       += User_Ctcp_ErrorMessageReceived;
        }