public UserEventArgs( User u ) { this._user = u; }
/// <summary> /// Merges the properties of the given User onto this User. /// </summary> public void MergeWith( User user ) { if ( user == null ) { return; } if ( user.IsDirty( "OnlineStatus" ) && !this.IsDirty( "OnlineStatus" ) ) { this.OnlineStatus = user.OnlineStatus; } if ( user.IsDirty( "AwayMessage" ) && !this.IsDirty( "AwayMessage" ) ) { this.AwayMessage = user.AwayMessage; } if ( user.IsDirty( "HostName" ) && !this.IsDirty( "HostName" ) ) { this.HostName = user.HostName; } if ( user.IsDirty( "Nick" ) && !this.IsDirty( "Nick" ) ) { this.Nick = user.Nick; } if ( user.IsDirty( "Password" ) && !this.IsDirty( "Password" ) ) { this.Password = user.Password; } if ( user.IsDirty( "RealName" ) && !this.IsDirty( "RealName" ) ) { this.RealName = user.RealName; } if ( user.IsDirty( "UserName" ) && !this.IsDirty( "UserName" ) ) { this.UserName = user.UserName; } if ( user.IsDirty( "ServerName" ) && !this.IsDirty( "ServerName" ) ) { this.ServerName = user.ServerName; } if ( user.IsDirty( "IrcOperator" ) && !this.IsDirty( "IrcOperator" ) ) { this.IrcOperator = user.IrcOperator; } }
/// <summary> /// Creates a new instance of the <see cref="Query"/> class on the given client with the given User. /// </summary> public Query( Client client, User user ) { this.client = client; this.journal.CollectionChanged += new NotifyCollectionChangedEventHandler( journal_CollectionChanged ); this.User = user; }
/// <summary> /// Determines wether the current user mask matches the given user mask. /// </summary> /// <param name="wildcardMask">The wild-card filled mask to compare with the current.</param> /// <returns>True if this mask is described by the given wildcard Mask. False if not.</returns> public Boolean IsMatch( User wildcardMask ) { if ( wildcardMask == null ) { return false; } //Fist we'll return quickly if they are exact matches if ( this.Nick == wildcardMask.Nick && this.UserName == wildcardMask.UserName && this.HostName == wildcardMask.HostName ) { return true; } return ( true && Regex.IsMatch( this.Nick, makeRegexPattern( wildcardMask.Nick ), RegexOptions.IgnoreCase ) && Regex.IsMatch( this.UserName, makeRegexPattern( wildcardMask.UserName ), RegexOptions.IgnoreCase ) && Regex.IsMatch( this.HostName, makeRegexPattern( wildcardMask.HostName ), RegexOptions.IgnoreCase ) ); }