Exemplo n.º 1
0
 public ConnectToMe(MessageHeader header, IList<string> positionalParameters, IList<string> namedParameters, string originalMessage)
     : base(header, CommandType.ConnectToMe, namedParameters, originalMessage)
 {
     Protocol = positionalParameters[0];
     Port = int.Parse(positionalParameters[1]);
     Token = positionalParameters[2];
 }
Exemplo n.º 2
0
 public ConnectToMe(MessageHeader header, string protocol, int port, string token)
     : base(header, CommandType.ConnectToMe)
 {
     Protocol = protocol;
     Port = port;
     Token = token;
 }
Exemplo n.º 3
0
 public Status(MessageHeader header, ErrorSeverity errorSeverity, ErrorCode errorCode, string description)
     : base(header, CommandType.Status)
 {
     Severity = errorSeverity;
     Code = errorCode;
     Description = description;
 }
Exemplo n.º 4
0
 public Information ToCommand(MessageHeader messageType)
 {
     return new Information(
         messageType,
         Flags.Where(pair => pair.Key != "PD").SelectMany(pair => pair.Value.Select(value => (pair.Key + value).Escape())).ToList(),
         string.Empty);
 }
Exemplo n.º 5
0
 protected Command(MessageHeader header, CommandType type, IList<string> namedParameters, string originalMessage)
 {
     Header = header;
     Type = type;
     NamedFlags = new NamedFlags(namedParameters);
     OriginalMessage = originalMessage;
 }
Exemplo n.º 6
0
 public Status(MessageHeader header, IList<string> positionalParameters, IList<string> namedParameters, string originalMessage)
     : base(header, CommandType.Status, namedParameters, originalMessage)
 {
     Severity = (ErrorSeverity)int.Parse(positionalParameters[0].Substring(0, 1));
     Code = (ErrorCode)int.Parse(positionalParameters[0].Substring(1, 2));
     Description = positionalParameters[1].Unescape();
 }
Exemplo n.º 7
0
 public Get(MessageHeader header, ItemType getItemType, string identifier, int startAt, int byteCount)
     : base(header, CommandType.Get)
 {
     GetItemType = getItemType;
     Identifier = identifier;
     StartAt = startAt;
     ByteCount = byteCount;
 }
Exemplo n.º 8
0
 public Get(MessageHeader header, IList<string> positionalParameters, IList<string> namedParameters, string originalMessage)
     : base(header, CommandType.Get, namedParameters, originalMessage)
 {
     GetItemType = positionalParameters[0] == "file" ? ItemType.File : (positionalParameters[0] == "list" ? ItemType.FileList : ItemType.TigerTreeHashList);
     Identifier = positionalParameters[1];
     StartAt = int.Parse(positionalParameters[2]);
     ByteCount = int.Parse(positionalParameters[3]);
 }
Exemplo n.º 9
0
 public Result(MessageHeader header)
     : base(header, CommandType.Result)
 {
 }
Exemplo n.º 10
0
 public Search(MessageHeader header)
     : base(header, CommandType.Search)
 {
 }
Exemplo n.º 11
0
 public Search(MessageHeader header, IList<string> namedParameters, string originalMessage)
     : base(header, CommandType.Search, namedParameters, originalMessage)
 {
 }
Exemplo n.º 12
0
 public GetFileInformation(MessageHeader header, ItemType getItemType, string identifier)
     : base(header, CommandType.GetFileInformation)
 {
     GetItemType = getItemType;
     Identifier = identifier;
 }
Exemplo n.º 13
0
 public GetFileInformation(MessageHeader header, IList<string> positionalParameters, IList<string> namedParameters, string originalMessage)
     : base(header, CommandType.GetFileInformation, namedParameters, originalMessage)
 {
     GetItemType = positionalParameters[0] == "file" ? ItemType.File : (positionalParameters[0] == "list" ? ItemType.FileList : ItemType.TigerTreeHashList);
     Identifier = positionalParameters[1];
 }
Exemplo n.º 14
0
 public Quit(MessageHeader header, string sid)
     : base(header, CommandType.Quit)
 {
     Sid = sid;
 }
Exemplo n.º 15
0
 protected Command(MessageHeader header, CommandType type)
     : this(header, type, new List<string>(), string.Empty)
 {
 }
Exemplo n.º 16
0
 public GetPassword(MessageHeader header, string randomData)
     : base(header, CommandType.GetPassword)
 {
     RandomData = randomData;
 }
Exemplo n.º 17
0
 public Result(MessageHeader header, IList<string> namedParameters, string originalMessage)
     : base(header, CommandType.Result, namedParameters, originalMessage)
 {
 }
Exemplo n.º 18
0
 public Sid(MessageHeader header, IList<string> positionalParameters, IList<string> namedParameters, string originalMessage)
     : base(header, CommandType.Sid, namedParameters, originalMessage)
 {
     Identifier = positionalParameters[0];
 }
Exemplo n.º 19
0
 public Password(MessageHeader header, IList<string> positionalParameters, IList<string> namedParameters, string originalMessage)
     : base(header, CommandType.Password, namedParameters, originalMessage)
 {
     Hash = positionalParameters[0];
 }
Exemplo n.º 20
0
 public Information(MessageHeader header, IList<string> namedParameters, string originalMessage)
     : base(header, CommandType.Information, namedParameters, originalMessage)
 {
 }
Exemplo n.º 21
0
 public Information(MessageHeader header)
     : base(header, CommandType.Information)
 {
 }
Exemplo n.º 22
0
 public Msg(MessageHeader header, IList<string> positionalParameters, IList<string> namedParameters, string originalMessage)
     : base(header, CommandType.Message, namedParameters, originalMessage)
 {
     Text = positionalParameters[0];
 }
Exemplo n.º 23
0
 public Quit(MessageHeader header, IList<string> positionalParameters, IList<string> namedParameters, string originalMessage)
     : base(header, CommandType.Quit, namedParameters, originalMessage)
 {
     Sid = positionalParameters[0];
 }
Exemplo n.º 24
0
 public ReversedConnectToMe(MessageHeader header, IList<string> positionalParameters, IList<string> namedParameters, string originalMessage)
     : base(header, CommandType.ReversedConnectToMe, namedParameters, originalMessage)
 {
     Protocol = positionalParameters[0];
     Token = positionalParameters[1];
 }
Exemplo n.º 25
0
 public Msg(MessageHeader header, string text)
     : base(header, CommandType.Message)
 {
     Text = text;
 }
Exemplo n.º 26
0
 public Password(MessageHeader header, string password)
     : base(header, CommandType.Password)
 {
     Hash = password;
 }
Exemplo n.º 27
0
 public ReversedConnectToMe(MessageHeader header, string protocol, string token)
     : base(header, CommandType.ReversedConnectToMe)
 {
     Protocol = protocol;
     Token = token;
 }
Exemplo n.º 28
0
 public Sid(MessageHeader header, string sid)
     : base(header, CommandType.Sid)
 {
     Identifier = sid;
 }
Exemplo n.º 29
0
 public Supports(MessageHeader header, HashSet<string> addFeatures, HashSet<string> removeFeatures)
     : base(header, CommandType.Supports)
 {
     AddFeatures.Value = addFeatures;
     RemoveFeatures.Value = removeFeatures;
 }