Ejemplo n.º 1
0
        private DirectoryResponse ConstructElement(XmlElement node)
        {
            DirectoryResponse el = null;

            Debug.Assert(node != null);

            switch (node.LocalName)
            {
            case DsmlConstants.DsmlErrorResponse:
                el = new DsmlErrorResponse(node);
                break;

            case DsmlConstants.DsmlSearchResponse:
                el = new SearchResponse(node);
                break;

            case DsmlConstants.DsmlModifyResponse:
                el = new ModifyResponse(node);
                break;

            case DsmlConstants.DsmlAddResponse:
                el = new AddResponse(node);
                break;

            case DsmlConstants.DsmlDelResponse:
                el = new DeleteResponse(node);
                break;

            case DsmlConstants.DsmlModDNResponse:
                el = new ModifyDNResponse(node);
                break;

            case DsmlConstants.DsmlCompareResponse:
                el = new CompareResponse(node);
                break;

            case DsmlConstants.DsmlExtendedResponse:
                el = new ExtendedResponse(node);
                break;

            case DsmlConstants.DsmlAuthResponse:
                el = new DsmlAuthResponse(node);
                break;

            default:
                throw new DsmlInvalidDocumentException(Res.GetString(Res.UnknownResponseElement));
            }

            Debug.Assert(el != null);

            return(el);
        }
Ejemplo n.º 2
0
        private DirectoryResponse ConstructElement(XmlElement node)
        {
            DirectoryResponse dsmlErrorResponse = null;
            string            localName         = node.LocalName;
            string            str = localName;

            if (localName != null)
            {
                if (str == "errorResponse")
                {
                    dsmlErrorResponse = new DsmlErrorResponse(node);
                }
                else if (str == "searchResponse")
                {
                    dsmlErrorResponse = new SearchResponse(node);
                }
                else if (str == "modifyResponse")
                {
                    dsmlErrorResponse = new ModifyResponse(node);
                }
                else if (str == "addResponse")
                {
                    dsmlErrorResponse = new AddResponse(node);
                }
                else if (str == "delResponse")
                {
                    dsmlErrorResponse = new DeleteResponse(node);
                }
                else if (str == "modDNResponse")
                {
                    dsmlErrorResponse = new ModifyDNResponse(node);
                }
                else if (str == "compareResponse")
                {
                    dsmlErrorResponse = new CompareResponse(node);
                }
                else if (str == "extendedResponse")
                {
                    dsmlErrorResponse = new ExtendedResponse(node);
                }
                else if (str == "authResponse")
                {
                    dsmlErrorResponse = new DsmlAuthResponse(node);
                }
                else
                {
                    throw new DsmlInvalidDocumentException(Res.GetString("UnknownResponseElement"));
                }
                return(dsmlErrorResponse);
            }
            throw new DsmlInvalidDocumentException(Res.GetString("UnknownResponseElement"));
        }
Ejemplo n.º 3
0
        private DirectoryResponse ConstructElement(XmlElement node)
        {
            DirectoryResponse el = null;

            Debug.Assert(node != null);

            switch (node.LocalName)
            {
                case DsmlConstants.DsmlErrorResponse:
                    el = new DsmlErrorResponse(node);
                    break;

                case DsmlConstants.DsmlSearchResponse:
                    el = new SearchResponse(node);
                    break;

                case DsmlConstants.DsmlModifyResponse:
                    el = new ModifyResponse(node);
                    break;

                case DsmlConstants.DsmlAddResponse:
                    el = new AddResponse(node);
                    break;

                case DsmlConstants.DsmlDelResponse:
                    el = new DeleteResponse(node);
                    break;

                case DsmlConstants.DsmlModDNResponse:
                    el = new ModifyDNResponse(node);
                    break;

                case DsmlConstants.DsmlCompareResponse:
                    el = new CompareResponse(node);
                    break;

                case DsmlConstants.DsmlExtendedResponse:
                    el = new ExtendedResponse(node);
                    break;

                case DsmlConstants.DsmlAuthResponse:
                    el = new DsmlAuthResponse(node);
                    break;
                default:
                    throw new DsmlInvalidDocumentException(Res.GetString(Res.UnknownResponseElement));
            }

            Debug.Assert(el != null);

            return el;
        }
Ejemplo n.º 4
0
		private DirectoryResponse ConstructElement(XmlElement node)
		{
			DirectoryResponse dsmlErrorResponse = null;
			string localName = node.LocalName;
			string str = localName;
			if (localName != null)
			{
				if (str == "errorResponse")
				{
					dsmlErrorResponse = new DsmlErrorResponse(node);
				}
				else if (str == "searchResponse")
				{
					dsmlErrorResponse = new SearchResponse(node);
				}
				else if (str == "modifyResponse")
				{
					dsmlErrorResponse = new ModifyResponse(node);
				}
				else if (str == "addResponse")
				{
					dsmlErrorResponse = new AddResponse(node);
				}
				else if (str == "delResponse")
				{
					dsmlErrorResponse = new DeleteResponse(node);
				}
				else if (str == "modDNResponse")
				{
					dsmlErrorResponse = new ModifyDNResponse(node);
				}
				else if (str == "compareResponse")
				{
					dsmlErrorResponse = new CompareResponse(node);
				}
				else if (str == "extendedResponse")
				{
					dsmlErrorResponse = new ExtendedResponse(node);
				}
				else if (str == "authResponse")
				{
					dsmlErrorResponse = new DsmlAuthResponse(node);
				}
				else
				{
					throw new DsmlInvalidDocumentException(Res.GetString("UnknownResponseElement"));
				}
				return dsmlErrorResponse;
			}
			throw new DsmlInvalidDocumentException(Res.GetString("UnknownResponseElement"));
		}