本文整理汇总了C#中IrcDotNet.IrcUser类的典型用法代码示例。如果您正苦于以下问题:C# IrcUser类的具体用法?C# IrcUser怎么用?C# IrcUser使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
IrcUser类属于IrcDotNet命名空间,在下文中一共展示了IrcUser类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: IRCCommandEventArgs
public IRCCommandEventArgs(string text, IrcUser sender, IIrcMessageTarget target)
{
parameters = IRCCommands.ParseParameters(text);
RawText = text;
Sender = sender;
Target = target;
}
示例2: Execute
public void Execute(IrcClient Client, string channel, IrcUser Sender, string message)
{
message = message.Trim();
if (message == "")
{
Client.LocalUser.SendMessage(channel, horoscopeHelpMsg());
}
else
{
if (!signs.ContainsKey(message))
{
Client.LocalUser.SendMessage(channel, "Why won't you give me a sign~");
return;
}
string html = getHTML(signs[message]);
string horoscope = dropHtmlPrecedingHoroscope(html, message);
horoscope = dropHtmlTailingHoroscope(horoscope);
horoscope = html2Txt(horoscope);
Client.LocalUser.SendMessage(channel, horoscope);
}
}
示例3: TwitterBotUser
public TwitterBotUser(IrcUser ircUser)
: this()
{
Debug.Assert(ircUser != null);
this.IrcUser = ircUser;
}
示例4: IrcChannelInvitationEventArgs
/// <summary>
/// Initializes a new instance of the <see cref="IrcChannelInvitationEventArgs"/> class.
/// </summary>
/// <param name="channel">The channel to which the recipient user is invited.</param>
/// <param name="inviter">The user inviting the recipient user to the channel.</param>
public IrcChannelInvitationEventArgs(IrcChannel channel, IrcUser inviter)
: base(channel)
{
if (inviter == null)
throw new ArgumentNullException("inviter");
this.Inviter = inviter;
}
示例5: IrcChannelUser
internal IrcChannelUser(IrcUser user, IEnumerable<char> modes = null)
{
this.user = user;
this.modes = new HashSet<char>();
this.modesReadOnly = new ReadOnlySet<char>(this.modes);
if (modes != null)
this.modes.AddRange(modes);
}
示例6: OnChannelModeChanged
protected override void OnChannelModeChanged(IrcChannel channel, IrcUser source, string newModes, IEnumerable<string> newModeParameters) {
// Twitch doesn't actually send JOIN messages. This means we need to add users
// to the channel when changing their mode if we haven't already.
foreach (string username in newModeParameters)
{
IrcUser user = GetUserFromNickName(username);
if (channel.GetChannelUser(user) == null)
channel.HandleUserJoined(new IrcChannelUser(user));
}
}
示例7: IrcQueryViewModel
public IrcQueryViewModel(IrcUser user, IrcClient client, Settings settings)
{
this.Settings = settings;
this.User = user;
this.client = client;
this.DisplayName = user.NickName;
this.Messages = new BindableCollection<Message>();
this.Closable = true;
// TODO
this.client.LocalUser.MessageReceived += this.messageReceived;
}
示例8: Run
public void Run(IrcClient client, IIrcMessageSource source, IList<IIrcMessageTarget> targets, string command, IList<string> parameters)
{
Client = client;
SourceUser = (IrcUser)source;
Command = command;
Parameters = parameters;
if (targets.Contains(Client.LocalUser) && source != null)
ReplyTargets = new[] { (IIrcMessageTarget)source };
else
{
ReplyTargets = targets;
}
Run();
}
示例9: LevelSubmission
public LevelSubmission(string levelID, IrcUser user, bool forceAdd)
{
//If you are force adding the level, bypass error checking, formatting and API call.
if (!forceAdd)
{
if (!IsValidLevelCode(levelID))
throw new ArgumentException("Invalid level code format");
LevelID = FormatLevelCode(levelID);
Level = SMMApi.GetLevel(LevelID);
if (Level == null)
throw new ArgumentException("Level does not exist");
}
else
LevelID = levelID;
//Initiaze variables
User = user;
IsPlayed = false;
IsQueued = false;
}
示例10: HandleTopicChanged
internal void HandleTopicChanged(IrcUser source, string newTopic)
{
this.Topic = newTopic;
OnTopicChanged(new IrcUserEventArgs(source));
}
示例11: HandleModesChanged
internal void HandleModesChanged(IrcUser source, string newModes, IEnumerable<string> newModeParameters)
{
lock (((ICollection)this.modesReadOnly).SyncRoot)
this.modes.UpdateModes(newModes, newModeParameters, this.client.ChannelUserModes,
(add, mode, modeParameter) => this.users.Single(
cu => cu.User.NickName == modeParameter).HandleModeChanged(add, mode));
OnModesChanged(new IrcUserEventArgs(source));
}
示例12: HandleUserInvited
internal void HandleUserInvited(IrcUser user)
{
lock (this.modesReadOnly)
OnUserInvited(new IrcUserEventArgs(user));
}
示例13: IrcUserEventArgs
/// <inheritdoc/>
/// <summary>
/// Initializes a new instance of the <see cref="IrcUserEventArgs"/> class.
/// </summary>
/// <param name="user">The user that the event concerns.</param>
public IrcUserEventArgs(IrcUser user, string comment = null)
: base(comment)
{
if (user == null)
throw new ArgumentNullException("user");
this.User = user;
}
示例14: GetUserFromNickName
/// <summary>
/// Gets the user with the specified nick name, creating it if necessary.
/// </summary>
/// <param name="nickName">The nick name of the user.</param>
/// <param name="isOnline">
/// <see langword="true" /> if the user is currently online;
/// <see langword="false" />, if the user is currently offline.
/// The <see cref="IrcUser.IsOnline" /> property of the user object is set to this value.
/// </param>
/// <param name="createdNew">
/// <see langword="true" /> if the user object was created during the call;
/// <see langword="false" />, otherwise.
/// </param>
/// <returns>The user object that corresponds to the specified nick name.</returns>
protected IrcUser GetUserFromNickName(string nickName, bool isOnline, out bool createdNew)
{
if (nickName == null)
throw new ArgumentNullException("nickName");
if (nickName.Length == 0)
throw new ArgumentException(Resources.MessageValueCannotBeEmptyString, "nickName");
// Search for user with given nick name in list of known users. If it does not exist, add it.
IrcUser user;
lock (((ICollection) Users).SyncRoot)
{
user = users.SingleOrDefault(u => u.NickName == nickName);
if (user == null)
{
user = new IrcUser
{
Client = this,
NickName = nickName
};
users.Add(user);
createdNew = true;
}
else
{
createdNew = false;
}
}
user.IsOnline = isOnline;
return user;
}
示例15: IrcUserEventArgs
/// <inheritdoc/>
/// <summary>
/// Initializes a new instance of the <see cref="IrcUserEventArgs"/> class.
/// </summary>
/// <param name="user">The user that the event concerns, or <see langword="null"/> for no user.</param>
public IrcUserEventArgs(IrcUser user, string comment = null)
: base(comment)
{
this.User = user;
}