📄 iprotocol.cs
字号:
using System;
using System.Collections.Generic;
using System.Text;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Drawing;
using GPCore.Args;
namespace GPCore.Protocols
{
/// <summary>
/// A default implementation of the <see cref="IProtocol"/> interface.
/// </summary>
public abstract class Protocol : IProtocol
{
/// <summary>
/// An AccountList with a copy of all of the accounts associated with this protocol
/// </summary>
public abstract SqlProtocolAccountList Accounts { get;}
/// <summary>
/// The username of the person connecting to this protocol.
/// </summary>
public abstract string Username { get; set;}
/// <summary>
/// Any Protocol Creation Arguments for this IProtocol
/// </summary>
public virtual object[] Args { get { return null; } set { } }
/// <summary>
/// The version of this assembly.
/// </summary>
public abstract string Version { get;}
/// <summary>
/// Gets whether or not the user is connected.
/// </summary>
public abstract bool Connected { get;}
/// <summary>
/// Returns the BuddyIcon an Account will have if a person did
/// not set a BuddyIcon for themselves
/// </summary>
public abstract Image DefaultBuddyIcon { get;}
/// <summary>
/// An Event that is fired when an error is Received from this IProtocol
/// </summary>
public static Event<IProtocol, ExceptionEventArgs> Error = new Event<IProtocol, ExceptionEventArgs>("Error");
}
/// <summary>
/// A template for creating classes that provide support for the use of a given protocol.
/// Do not use any constructors other than the default constructor.
/// </summary>
public interface IProtocol
{
/// <summary>
/// An AccountList with a copy of all of the accounts associated with this protocol
/// </summary>
SqlProtocolAccountList Accounts { get;}
/// <summary>
/// The username of the person connecting to this protocol.
/// </summary>
string Username { get; set;}
/// <summary>
/// Any Protocol Creation Arguments for this IProtocol
/// </summary>
object[] Args { get; set;}
/// <summary>
/// The version of this assembly.
/// </summary>
string Version { get;}
/// <summary>
/// Gets whether or not the user is connected.
/// </summary>
bool Connected { get;}
/// <summary>
/// Returns the BuddyIcon an Account will have if a person did
/// not set a BuddyIcon for themselves
/// </summary>
Image DefaultBuddyIcon { get;}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -