Beispiel #1
0
        /// <summary>
        /// Get the first response-code of the specified type.
        /// </summary>
        /// <remarks>
        /// Gets the first response-code of the specified type.
        /// </remarks>
        /// <param name="type">The type of response-code.</param>
        /// <returns>The response-code if it exists; otherwise, <c>null</c>.</returns>
        public ImapResponseCode GetResponseCode(ImapResponseCodeType type)
        {
            for (int i = 0; i < RespCodes.Count; i++)
            {
                if (RespCodes[i].Type == type)
                {
                    return(RespCodes[i]);
                }
            }

            return(null);
        }
Beispiel #2
0
 internal UidNextResponseCode(ImapResponseCodeType type) : base(type, false)
 {
 }
Beispiel #3
0
 internal NewNameResponseCode(ImapResponseCodeType type) : base(type, false)
 {
 }
Beispiel #4
0
 internal ImapResponseCode(ImapResponseCodeType type, bool isError)
 {
     IsError = isError;
     Type    = type;
 }
Beispiel #5
0
 public ImapResponseCode(ImapResponseCodeType type)
 {
     Type = type;
 }
Beispiel #6
0
 internal WebAlertResponseCode(ImapResponseCodeType type) : base(type, false)
 {
 }
Beispiel #7
0
		internal UndefinedFilterResponseCode (ImapResponseCodeType type) : base (type, true)
		{
		}
Beispiel #8
0
 internal HighestModSeqResponseCode(ImapResponseCodeType type) : base(type, false)
 {
 }
		internal UnseenResponseCode (ImapResponseCodeType type) : base (type, false)
		{
		}
		internal UidValidityResponseCode (ImapResponseCodeType type) : base (type, false)
		{
		}
		internal UidNextResponseCode (ImapResponseCodeType type) : base (type, false)
		{
		}
		internal PermanentFlagsResponseCode (ImapResponseCodeType type) : base (type, false)
		{
		}
		internal NewNameResponseCode (ImapResponseCodeType type) : base (type, false)
		{
		}
		public static ImapResponseCode Create (ImapResponseCodeType type)
		{
			switch (type) {
			case ImapResponseCodeType.Alert:                return new ImapResponseCode (type, false);
			case ImapResponseCodeType.BadCharset:           return new ImapResponseCode (type, true);
			case ImapResponseCodeType.Capability:           return new ImapResponseCode (type, false);
			case ImapResponseCodeType.NewName:              return new NewNameResponseCode (type);
			case ImapResponseCodeType.Parse:                return new ImapResponseCode (type, true);
			case ImapResponseCodeType.PermanentFlags:       return new PermanentFlagsResponseCode (type);
			case ImapResponseCodeType.ReadOnly:             return new ImapResponseCode (type, false);
			case ImapResponseCodeType.ReadWrite:            return new ImapResponseCode (type, false);
			case ImapResponseCodeType.TryCreate:            return new ImapResponseCode (type, true);
			case ImapResponseCodeType.UidNext:              return new UidNextResponseCode (type);
			case ImapResponseCodeType.UidValidity:          return new UidValidityResponseCode (type);
			case ImapResponseCodeType.Unseen:               return new UnseenResponseCode (type);
			case ImapResponseCodeType.Referral:             return new ImapResponseCode (type, false);
			case ImapResponseCodeType.UnknownCte:           return new ImapResponseCode (type, true);
			case ImapResponseCodeType.AppendUid:            return new AppendUidResponseCode (type);
			case ImapResponseCodeType.CopyUid:              return new CopyUidResponseCode (type);
			case ImapResponseCodeType.UidNotSticky:         return new ImapResponseCode (type, false);
			case ImapResponseCodeType.UrlMech:              return new ImapResponseCode (type, false);
			case ImapResponseCodeType.BadUrl:               return new BadUrlResponseCode (type);
			case ImapResponseCodeType.TooBig:               return new ImapResponseCode (type, true);
			case ImapResponseCodeType.HighestModSeq:        return new HighestModSeqResponseCode (type);
			case ImapResponseCodeType.Modified:             return new ModifiedResponseCode (type);
			case ImapResponseCodeType.NoModSeq:             return new ImapResponseCode (type, false);
			case ImapResponseCodeType.CompressionActive:    return new ImapResponseCode (type, true);
			case ImapResponseCodeType.Closed:               return new ImapResponseCode (type, false);
			case ImapResponseCodeType.NotSaved:             return new ImapResponseCode (type, true);
			case ImapResponseCodeType.BadComparator:        return new ImapResponseCode (type, true);
			case ImapResponseCodeType.Annotate:             return new ImapResponseCode (type, false);
			case ImapResponseCodeType.Annotations:          return new ImapResponseCode (type, false);
			case ImapResponseCodeType.MaxConvertMessages:   return new MaxConvertResponseCode (type);
			case ImapResponseCodeType.MaxConvertParts:      return new MaxConvertResponseCode (type);
			case ImapResponseCodeType.TempFail:             return new ImapResponseCode (type, true);
			case ImapResponseCodeType.NoUpdate:             return new NoUpdateResponseCode (type);
			case ImapResponseCodeType.Metadata:             return new ImapResponseCode (type, false); // FIXME:
			case ImapResponseCodeType.NotificationOverflow: return new ImapResponseCode (type, true);
			case ImapResponseCodeType.BadEvent:             return new ImapResponseCode (type, true);
			case ImapResponseCodeType.UndefinedFilter:      return new ImapResponseCode (type, true);
			case ImapResponseCodeType.Unavailable:          return new ImapResponseCode (type, true);
			case ImapResponseCodeType.AuthenticationFailed: return new ImapResponseCode (type, true);
			case ImapResponseCodeType.AuthorizationFailed:  return new ImapResponseCode (type, true);
			case ImapResponseCodeType.Expired:              return new ImapResponseCode (type, true);
			case ImapResponseCodeType.PrivacyRequired:      return new ImapResponseCode (type, true);
			case ImapResponseCodeType.ContactAdmin:         return new ImapResponseCode (type, true);
			case ImapResponseCodeType.NoPerm:               return new ImapResponseCode (type, true);
			case ImapResponseCodeType.InUse:                return new ImapResponseCode (type, true);
			case ImapResponseCodeType.ExpungeIssued:        return new ImapResponseCode (type, true);
			case ImapResponseCodeType.Corruption:           return new ImapResponseCode (type, true);
			case ImapResponseCodeType.ServerBug:            return new ImapResponseCode (type, true);
			case ImapResponseCodeType.ClientBug:            return new ImapResponseCode (type, true);
			case ImapResponseCodeType.CanNot:               return new ImapResponseCode (type, true);
			case ImapResponseCodeType.Limit:                return new ImapResponseCode (type, true);
			case ImapResponseCodeType.OverQuota:            return new ImapResponseCode (type, true);
			case ImapResponseCodeType.AlreadyExists:        return new ImapResponseCode (type, true);
			case ImapResponseCodeType.NonExistent:          return new ImapResponseCode (type, true);
			default:                                        return new ImapResponseCode (type, true);
			}
		}
		internal ImapResponseCode (ImapResponseCodeType type, bool isError)
		{
			IsError = isError;
			Type = type;
		}
Beispiel #16
0
 internal UnseenResponseCode(ImapResponseCodeType type) : base(type, false)
 {
 }
Beispiel #17
0
 internal CopyUidResponseCode(ImapResponseCodeType type) : base(type)
 {
 }
		internal AppendUidResponseCode (ImapResponseCodeType type) : base (type)
		{
		}
Beispiel #19
0
 internal MaxConvertResponseCode(ImapResponseCodeType type) : base(type, true)
 {
 }
		internal CopyUidResponseCode (ImapResponseCodeType type) : base (type)
		{
		}
Beispiel #21
0
 internal MailboxIdResponseCode(ImapResponseCodeType type) : base(type, false)
 {
 }
		internal BadUrlResponseCode (ImapResponseCodeType type) : base (type, true)
		{
		}
Beispiel #23
0
 public ImapResponseCode(ImapResponseCodeType type)
 {
     Type = type;
 }
		internal HighestModSeqResponseCode (ImapResponseCodeType type) : base (type, false)
		{
		}
		internal ModifiedResponseCode (ImapResponseCodeType type) : base (type, false)
		{
		}
		internal MaxConvertResponseCode (ImapResponseCodeType type) : base (type, true)
		{
		}
Beispiel #27
0
        public static ImapResponseCode Create(ImapResponseCodeType type)
        {
            switch (type)
            {
            case ImapResponseCodeType.Alert:                return(new ImapResponseCode(type, false));

            case ImapResponseCodeType.BadCharset:           return(new ImapResponseCode(type, true));

            case ImapResponseCodeType.Capability:           return(new ImapResponseCode(type, false));

            case ImapResponseCodeType.NewName:              return(new NewNameResponseCode(type));

            case ImapResponseCodeType.Parse:                return(new ImapResponseCode(type, true));

            case ImapResponseCodeType.PermanentFlags:       return(new PermanentFlagsResponseCode(type));

            case ImapResponseCodeType.ReadOnly:             return(new ImapResponseCode(type, false));

            case ImapResponseCodeType.ReadWrite:            return(new ImapResponseCode(type, false));

            case ImapResponseCodeType.TryCreate:            return(new ImapResponseCode(type, true));

            case ImapResponseCodeType.UidNext:              return(new UidNextResponseCode(type));

            case ImapResponseCodeType.UidValidity:          return(new UidValidityResponseCode(type));

            case ImapResponseCodeType.Unseen:               return(new UnseenResponseCode(type));

            case ImapResponseCodeType.Referral:             return(new ImapResponseCode(type, false));

            case ImapResponseCodeType.UnknownCte:           return(new ImapResponseCode(type, true));

            case ImapResponseCodeType.AppendUid:            return(new AppendUidResponseCode(type));

            case ImapResponseCodeType.CopyUid:              return(new CopyUidResponseCode(type));

            case ImapResponseCodeType.UidNotSticky:         return(new ImapResponseCode(type, false));

            case ImapResponseCodeType.UrlMech:              return(new ImapResponseCode(type, false));

            case ImapResponseCodeType.BadUrl:               return(new BadUrlResponseCode(type));

            case ImapResponseCodeType.TooBig:               return(new ImapResponseCode(type, true));

            case ImapResponseCodeType.HighestModSeq:        return(new HighestModSeqResponseCode(type));

            case ImapResponseCodeType.Modified:             return(new ModifiedResponseCode(type));

            case ImapResponseCodeType.NoModSeq:             return(new ImapResponseCode(type, false));

            case ImapResponseCodeType.CompressionActive:    return(new ImapResponseCode(type, true));

            case ImapResponseCodeType.Closed:               return(new ImapResponseCode(type, false));

            case ImapResponseCodeType.NotSaved:             return(new ImapResponseCode(type, true));

            case ImapResponseCodeType.BadComparator:        return(new ImapResponseCode(type, true));

            case ImapResponseCodeType.Annotate:             return(new ImapResponseCode(type, false));

            case ImapResponseCodeType.Annotations:          return(new ImapResponseCode(type, false));

            case ImapResponseCodeType.MaxConvertMessages:   return(new MaxConvertResponseCode(type));

            case ImapResponseCodeType.MaxConvertParts:      return(new MaxConvertResponseCode(type));

            case ImapResponseCodeType.TempFail:             return(new ImapResponseCode(type, true));

            case ImapResponseCodeType.NoUpdate:             return(new NoUpdateResponseCode(type));

            case ImapResponseCodeType.Metadata:             return(new ImapResponseCode(type, false));             // FIXME:

            case ImapResponseCodeType.NotificationOverflow: return(new ImapResponseCode(type, true));

            case ImapResponseCodeType.BadEvent:             return(new ImapResponseCode(type, true));

            case ImapResponseCodeType.UndefinedFilter:      return(new ImapResponseCode(type, true));

            case ImapResponseCodeType.Unavailable:          return(new ImapResponseCode(type, true));

            case ImapResponseCodeType.AuthenticationFailed: return(new ImapResponseCode(type, true));

            case ImapResponseCodeType.AuthorizationFailed:  return(new ImapResponseCode(type, true));

            case ImapResponseCodeType.Expired:              return(new ImapResponseCode(type, true));

            case ImapResponseCodeType.PrivacyRequired:      return(new ImapResponseCode(type, true));

            case ImapResponseCodeType.ContactAdmin:         return(new ImapResponseCode(type, true));

            case ImapResponseCodeType.NoPerm:               return(new ImapResponseCode(type, true));

            case ImapResponseCodeType.InUse:                return(new ImapResponseCode(type, true));

            case ImapResponseCodeType.ExpungeIssued:        return(new ImapResponseCode(type, true));

            case ImapResponseCodeType.Corruption:           return(new ImapResponseCode(type, true));

            case ImapResponseCodeType.ServerBug:            return(new ImapResponseCode(type, true));

            case ImapResponseCodeType.ClientBug:            return(new ImapResponseCode(type, true));

            case ImapResponseCodeType.CanNot:               return(new ImapResponseCode(type, true));

            case ImapResponseCodeType.Limit:                return(new ImapResponseCode(type, true));

            case ImapResponseCodeType.OverQuota:            return(new ImapResponseCode(type, true));

            case ImapResponseCodeType.AlreadyExists:        return(new ImapResponseCode(type, true));

            case ImapResponseCodeType.NonExistent:          return(new ImapResponseCode(type, true));

            default:                                        return(new ImapResponseCode(type, true));
            }
        }
		internal NoUpdateResponseCode (ImapResponseCodeType type) : base (type, true)
		{
		}
Beispiel #29
0
 internal PermanentFlagsResponseCode(ImapResponseCodeType type) : base(type, false)
 {
 }
Beispiel #30
0
 internal PermanentFlagsResponseCode(ImapResponseCodeType type) : base(type, false)
 {
     Keywords = new HashSet <string> (StringComparer.Ordinal);
 }
Beispiel #31
0
 internal UidValidityResponseCode(ImapResponseCodeType type) : base(type, false)
 {
 }
Beispiel #32
0
 internal AnnotateResponseCode(ImapResponseCodeType type) : base(type, true)
 {
 }
Beispiel #33
0
 internal AppendUidResponseCode(ImapResponseCodeType type) : base(type)
 {
 }
Beispiel #34
0
 internal AnnotationsResponseCode(ImapResponseCodeType type) : base(type, false)
 {
 }
Beispiel #35
0
 internal BadUrlResponseCode(ImapResponseCodeType type) : base(type, true)
 {
 }
Beispiel #36
0
 internal MetadataResponseCode(ImapResponseCodeType type) : base(type, true)
 {
 }
Beispiel #37
0
 internal ModifiedResponseCode(ImapResponseCodeType type) : base(type, false)
 {
 }
Beispiel #38
0
 internal UndefinedFilterResponseCode(ImapResponseCodeType type) : base(type, true)
 {
 }
Beispiel #39
0
 internal NoUpdateResponseCode(ImapResponseCodeType type) : base(type, true)
 {
 }
Beispiel #40
0
		// FIXME: the LONGENTRIES code is not an error
		internal MetadataResponseCode (ImapResponseCodeType type) : base (type, true)
		{
		}