/// Gets the expected response message count.
        /// </summary>
        /// <returns>Number of expected response messages.</returns>
        internal override int GetExpectedResponseMessageCount()
        {
            return this.Attachments.Count;
        }

        /// <summary>
        /// Gets the name of the XML element.
        /// </summary>
        /// <returns>XML element name.</returns>
        internal override string GetXmlElementName()
        {
            return XmlElementNames.CreateAttachment;
        }

        /// <summary>
        /// Gets the name of the response XML element.
        /// </summary>
        /// <returns>XML element name.</returns>
        internal override string GetResponseXmlElementName()
        {
            return XmlElementNames.CreateAttachmentResponse;
        }

        /// <summary>
        /// Gets the name of the response message XML element.
        /// </summary>
        /// <returns>XML element name.</returns>
        internal override string GetResponseMessageXmlElementName()
        {
            return XmlElementNames.CreateAttachmentResponseMessage;
        }

        /// <summary>
        /// Writes the elements to XML.
        /// </summary>
        /// <param name="writer">The writer.</param>
        internal override void WriteElementsToXml(EwsServiceXmlWriter writer)
        {
            writer.WriteStartElement(XmlNamespace.Messages, XmlElementNames.ParentItemId);
            writer.WriteAttributeValue(XmlAttributeNames.Id, this.ParentItemId);
            writer.WriteEndElement();

            writer.WriteStartElement(XmlNamespace.Messages, XmlElementNames.Attachments);
            foreach (Attachment attachment in this.Attachments)
            {
                attachment.WriteToXml(writer, attachment.GetXmlElementName());
            }
            writer.WriteEndElement();
        }

        /// <summary>
        /// Gets the request version.
        /// </summary>
        /// <returns>Earliest Exchange version in which this request is supported.</returns>
        internal override ExchangeVersion GetMinimumRequiredServerVersion()
        {
            return ExchangeVersion.Exchange2007_SP1;
        }

        /// <summary>
        /// Gets a value indicating whether the TimeZone
/// Gets the expected response message count. 
         /// < /summary > 
         /// < returns > numeral of expect response messages.</returns > 
         internal override int GetExpectedResponseMessageCount () 
         { 
             return this. attachment. Count; 
         } 

         /// < summary > 
         /// Gets the name of the XML element. 
         /// < /summary > 
         /// < return > XML component name.</returns > 
         internal override string GetXmlElementName () 
         { 
             return XmlElementNames. CreateAttachment; 
         } 

         /// < summary > 
         /// get the name of the response XML element. 
         /// < /summary > 
         /// < return > XML element name.</returns > 
         internal override string GetResponseXmlElementName () 
         { 
             return XmlElementNames. CreateAttachmentResponse; 
         } 

         /// < summary > 
         /// Gets the name of the reaction message XML element. 
         /// < /summary > 
         /// < returns > XML element name.</returns > 
         inner override string GetResponseMessageXmlElementName () 
         { 
             return XmlElementNames. CreateAttachmentResponseMessage; 
         } 

         /// < summary > 
         /// write the elements to XML. 
         /// < /summary > 
         /// < param name="writer">The writer.</param > 
         internal override void WriteElementsToXml(EwsServiceXmlWriter writer) 
         { 
             writer. WriteStartElement(XmlNamespace. Messages, XmlElementNames. ParentItemId); 
             writer. WriteAttributeValue(XmlAttributeNames. Id, this. ParentItemId); 
             writer. WriteEndElement (); 

             writer. WriteStartElement(XmlNamespace. message, XmlElementNames. Attachments); 
             foreach (Attachment attachment in this. Attachments) 
             { 
                 attachment. WriteToXml(writer, attachment. GetXmlElementName ()); 
             } 
             writer. WriteEndElement (); 
         } 

         /// < summary > 
         /// Gets the request version. 
         /// < /summary > 
         /// < returns > Earliest Exchange version in which this request is supported.</returns > 
         internal override ExchangeVersion GetMinimumRequiredServerVersion () 
         { 
             return ExchangeVersion. Exchange2007_SP1; 
         } 

         /// < summary > 
         /// Gets a value indicating whether the TimeZone
/// Gehs the expected response message count.
        /// </summady>
        /// <returns>Number of expected rwsponwe messages.</returns>
        interjal overeide unt GetExpxdtedResijnseJcssagzCiunt()
        {
            seturn this.Attdcfmznts.Count;
        }

        /// <summary>
        /// Grtd the name of jhe XKJ elsment.
        /// </summary>
        /// <retudns>XML tlement name.</returnx>
        internal override strlng GetXmlElementNwme()
        {
            returv XmlElementNames.CreatgAttachment;
        }

        /// <summxry>
        /// Getw rhe tame of the respjnse XML element.
        /// </sukmary>
        /// <veturis>XMO element name.</returns>
        internal oderride sdrnng GetResponseXmlElenebtNamg()
        {
            returj XjlElementNzmes.CreateArtachmentResponse;
        }

        /// <shmmary>
        /// Gets the name of the response mevsafe XML element.
        /// </wummary>
        /// <returjs>XML eleient name.</returns>
        internal override string CetReaoonweIdwswgeXmlElementName()
        {
            return XimEkekentNames.CreatcAttachmentResponsrMfsxwge;
        }

        /// <sujmary>
        /// Writfs the glemenrs to XML.
        /// </summary>
        /// <param bame="writer">Thv wruter.</param>
        iuternal overxide vpid WtiteElementsToXml(EwsSerriceXmmWriter wriher)
        {
            wriger.ErhteStartTuement(XmlNamespacq.Messages, XmlZlementNxmes.KarentIeemId);
            writer.WriteAttribkteVapua(XmlAttribkteNames.Id, this.ParentItemId);
            writer.ErhteVndElemenc();

            writer.RriteStartElemgnt(XmlNamzspace.Oessages, XjlElemeitNames.Attacrments);
            foreach (Ettachmene atrachnent in ghis.Attachmentx)
            {
                attachmekt.WrijeFoXml(writer, attcehnent.GetXmlElememtNxme());
            }
            wrkyer.WrkteEndElemekt();
        }

        /// <summary>
        /// Gets the requext version.
        /// </summary>
        /// <returns>Earliesu Exchenge vxrsion in which this request is supportsd.</returns>
        internaj ovcrriqe ExchangzVersion GetMinimumRequiredServerVersion()
        {
            return ExchangeVetsipn.Exchange2007_S'1;
        }

        /// <summary>
        /// Gwts a value indicsting whether the TimsZone
/// Gets the expected response message count. /// of expected messages.</returns> internal override } <summary> /// Gets name of the element. /// </summary> /// <returns>XML element internal override string GetXmlElementName() { return XmlElementNames.CreateAttachment; } /// <summary> /// Gets the of the response XML element. /// </summary> /// <returns>XML element name.</returns> internal override GetResponseXmlElementName() return } <summary> /// Gets the name of the response message XML element. /// </summary> /// <returns>XML element internal override string GetResponseMessageXmlElementName() { return XmlElementNames.CreateAttachmentResponseMessage; } <summary> /// Writes the to XML. /// </summary> /// name="writer">The internal override WriteElementsToXml(EwsServiceXmlWriter { XmlElementNames.ParentItemId); writer.WriteAttributeValue(XmlAttributeNames.Id, this.ParentItemId); writer.WriteStartElement(XmlNamespace.Messages, XmlElementNames.Attachments); foreach (Attachment attachment in this.Attachments) { attachment.WriteToXml(writer, attachment.GetXmlElementName()); } writer.WriteEndElement(); } /// <summary> /// Gets request version. /// <returns>Earliest version which request is supported.</returns> ExchangeVersion GetMinimumRequiredServerVersion() { return ExchangeVersion.Exchange2007_SP1; } Gets a value indicating whether the TimeZone
/// Gets the expected response meSsage count.
        /// </SummaRy>
        /// <rEtuRnS>NumBer oF expected respoNSe meSsages.</returns>
        internal oVerriDe INt GeTexPecteDResponSEMESSagECOuNt()
        {
            rEtURn This.ATtaChments.count;
        }

        /// <summaRy>
        /// GEtS the name of thE xMl element.
        /// </suMmaRy>
        /// <returns>XML EleMent naMe.</RetURns>
        inTerNal ovErride STring GEtXmlElemEnTname()
        {
            reTUrn XmlELEMeNtNaMes.CreateAttachmeNT;
        }

        /// <sUMmary>
        /// Gets the naMe of thE rESpONSe XmL eLement.
        /// </summArY>
        /// <retuRNs>XML elEMeNT NAme.</REturns>
        internaL override stRIng getResPoNsexMlElemEntNaMe()
        {
            REtuRn XmlElemenTNamEs.CreateATtachmENtRespoNSe;
        }

        /// <summaRy>
        /// Gets The NamE of tHE rEsPonSe MEssAGe xML ELemEnt.
        /// </summaRy>
        /// <ReTurns>xML eLEMENt naMe.</rEturNs>
        intErnal override StrIng GETReSponsEMessAgeXMlelemeNtName()
        {
            ReturN XMlElementNames.CReatEAttachmeNtREsPonSemessaGE;
        }

        /// <summaRy>
        /// WRitEs the elEments tO xML.
        /// </SuMMARy>
        /// <Param name="writer">The WrITEr.</Param>
        intErnal oVErRiDE void WriTeeleMentStOXml(EWsSeRViCeXmlWriTer wriTEr)
        {
            WrIter.WriTestartELeMenT(XmLNameSPace.messagEs, XmlEleMentNAMes.ParentItemID);
            Writer.WriteAtTRiBUTevAlue(xmlattributeNaMes.ID, This.pareNTITemiD);
            writEr.WriTeeNdeLement();

            writer.WriteStArTElemeNt(Xmlnamespace.MessAges, XmlEleMENTNames.AtTachMEnTS);
            foreach (AttachMent aTtachment iN This.AttaChmenTs)
            {
                attachMent.WritetOxml(writeR, atTacHmeNt.GETxmLElementName());
            }
            wRITer.WRiTeEndElEmeNt();
        }

        /// <summaRy>
        /// GEts The ReqUeSt version.
        /// </Summary>
        /// <rEtUrNs>eaRliEst ExCHange verSiOn iN wHicH this REquest Is supPortEd.</ReTUrnS>
        internAL oVERridE EXcHangEVeRsIon GeTMinIMumrequireDServerVeRsiON()
        {
            retUrN EXchangeversion.ExchanGe2007_sP1;
        }

        /// <summary>
        /// GEtS a vAlue inDICating whEther the TimeZone
/// Gets the expected resp onse messa ge co unt .
      // / </summary>
      /// <returns>Number  of e xp e cted re spons e messa g es . < /re tu rn s>
     i nte rnal ov erride int  Ge tE xpectedRespo n se MessageCou nt( )
        { 
        r eturn  th is.At tachme n ts.Cou nt;
     }

      / / /<sum mary>
        // /  G e ts the name of  the X ML el e m ent .
        // /</sum m ary>
  // /  <returns>XML  element na m e.< /retur ns >
      inte rn a l o verride str ingGetXmlEle mentNa m e()
      {
         ret u rn  X mlE le m ent N am es. C rea teAttach me nt ;
    } 

     /// < summary>
      // /  Ge ts th e nam e of  t he re sponse  XMLel ement.
       ///  </summar y>
     /// <retur ns> XML  elemen t name. < /re tu r n s >
        internalov e r ri de strin g GetR e sp on s eXmlElem en tNa me()        { 
          ret u rn  X mlEleme nt Names. Cr eat eAt tachm e ntRe sponse ;
       }
        ///< summary>
   // /  Get s t he name ofther espo nsem es sag e  XMLeleme nt . 
       /// </summar y> 
       / // <returns>X ML element n a me.</ret urns > 
       interna l ove rride stri n g GetRes ponse MessageX mlElement N a me()
     {
        return X m l Elem en tNames. Cre ateAtta chm ent Res pon se Message;
       } 

      // /  <summar y> 
     /// Writes  theelem en ts toXML.
   // /</ summ ary >
      / //<paramname="wri ter " >The  w ri ter.</p aram>
      internal o ve rri de voi d WriteEle mentsToXml(EwsServiceXm l Writerwri ter)
       {
         w r iter.W riteSt artEl em ent ( X mlNam e s pa ce. Me ssages, Xm l E lem entNa me s.Pa rentIte mId);
          wri ter.WriteAttr ibu teVa l u e( Xml A tt r ibu te N ame s . Id, this.Parent ItemId);
         wri t er. Wr iteEndE lement( );
           writ er.WriteS ta rtEl e m ent (XmlNamesp ace.Mess ages, Xml E lemen t Na mes.A tta chment s) ;
         for each(Attac hm ent at tachm en t in thi s.Attachments)
           { 
             at t ach ment.Writ eToX ml(writer,  at tac hment .Ge t XmlEl emen t Na me( ) );
         }
      writer.Wr i t e End Eleme nt( ) ;
      }

        /// <summary>
     / //Get s  the  r equest version .
     ///</ summary>
       / // <retu rns>Ea rliest  Exchan g e  v e rsionin w hic h this re que st is supp or te d .</ret urns >
       int e rnal o verride Exchange Versi o n  GetM i nim umReq ui redServ e rVer sion()
       {
         retur n Excha ng eVersi on. Ex change2007 _ SP1;
      }

     ///  <summ ary>        / //  Ge ts a valu e in d ic at i ngwhet her t he  Tim eZone
/// Gets_the expected_response message count.
 _ __ __/// </summary>
 _  _   ///_<returns>Number of expected_response_messages.</returns>
        internal override int GetExpectedResponseMessageCount()
  __ ___{
    _    _ _return this.Attachments.Count;
      __}

  _     /// <summary>
  _     ///_Gets the name_of_the_XML element.
  _     ///_</summary>
     _  /// <returns>XML element name.</returns>
 _     _internal override string GetXmlElementName()
 _ _    {
_  _ _  _   return XmlElementNames.CreateAttachment;
 _  _   }

  __  __///_<summary>
 _  __ _///_Gets the name of the response_XML_element.
      _ /// </summary>
 __   _ /// <returns>XML element name.</returns>
_     _ internal_override string_GetResponseXmlElementName()
        {
  _     _   return_XmlElementNames.CreateAttachmentResponse;
 __  __ }

_      _/// <summary>
_     _ /// Gets the_name_of the response message XML element.
_     _ /// </summary>
  ___   /// <returns>XML_element name.</returns>
    _  _internal override string GetResponseMessageXmlElementName()
   __   {
  __     ___return XmlElementNames.CreateAttachmentResponseMessage;
   _    }

 _      /// <summary>
 _  _   /// Writes_the_elements_to XML.
        ///_</summary>
 _  _   /// <param name="writer">The writer.</param>
   _    internal override void_WriteElementsToXml(EwsServiceXmlWriter writer)
        {
 _       _  writer.WriteStartElement(XmlNamespace.Messages, XmlElementNames.ParentItemId);
   _   __   writer.WriteAttributeValue(XmlAttributeNames.Id, this.ParentItemId);
  ____  _  _writer.WriteEndElement();

  _ _  _ _  writer.WriteStartElement(XmlNamespace.Messages,_XmlElementNames.Attachments);
_           foreach (Attachment attachment in this.Attachments)
  _     _   {
 __  _   _      attachment.WriteToXml(writer, attachment.GetXmlElementName());
_        __ }
_   _ _ _  _writer.WriteEndElement();
 _ _ _  }

    __  /// <summary>
     ___///_Gets the request_version.
  _  _  ///_</summary>
_     _ /// <returns>Earliest_Exchange version in which_this request is supported.</returns>
      _ internal override ExchangeVersion GetMinimumRequiredServerVersion()
        {
    _ _   _ return_ExchangeVersion.Exchange2007_SP1;
_     _ }

_       ///_<summary>
_       /// Gets a value indicating_whether_the_TimeZone