コード例 #1
0
        private ApptSummary ApptNodeToApptSummary(XmlNode node)
        {
            //node is the appt node
            ApptSummary summary = new ApptSummary();

            summary.ItemId   = XmlUtil.AttributeValue(node.Attributes, MailService.A_ID);
            summary.Name     = XmlUtil.AttributeValue(node.Attributes, MailService.A_NAME);
            summary.Location = XmlUtil.AttributeValue(node.Attributes, MailService.A_LOCATION);
            summary.InvId    = XmlUtil.AttributeValue(node.Attributes, MailService.A_INV_ID);
            summary.CompNum  = XmlUtil.AttributeValue(node.Attributes, MailService.A_COMP_NUM);

            XmlNode fragmentNode = node.SelectSingleNode(MailService.NS_PREFIX + ":" + MailService.E_FRAGMENT, XmlUtil.NamespaceManager);

            if (fragmentNode != null)
            {
                summary.Fragment = fragmentNode.InnerText;
            }

            ArrayList   instanceList = new ArrayList();
            XmlNodeList iNodes       = node.SelectNodes(MailService.NS_PREFIX + ":" + MailService.E_INSTANCE, XmlUtil.NamespaceManager);

            for (int i = 0; i < iNodes.Count; i++)
            {
                XmlNode             iNode   = iNodes.Item(i);
                String              s       = XmlUtil.AttributeValue(iNode.Attributes, MailService.A_START);
                Int64               seconds = Int64.Parse(s);
                DateTime            start   = DateUtil.GmtSecondsToLocalTime(seconds);
                ApptSummaryInstance asi     = new ApptSummaryInstance(start);
                instanceList.Add(asi);
            }

            summary.Instances = instanceList;
            return(summary);
        }
コード例 #2
0
		private ApptSummary ApptNodeToApptSummary( XmlNode node )
		{
			//node is the appt node
			ApptSummary summary = new ApptSummary();

			summary.ItemId = XmlUtil.AttributeValue( node.Attributes, MailService.A_ID );
			summary.Name = XmlUtil.AttributeValue( node.Attributes, MailService.A_NAME );
			summary.Location = XmlUtil.AttributeValue( node.Attributes, MailService.A_LOCATION );
			summary.InvId = XmlUtil.AttributeValue( node.Attributes, MailService.A_INV_ID );
			summary.CompNum = XmlUtil.AttributeValue( node.Attributes, MailService.A_COMP_NUM );

			XmlNode fragmentNode = node.SelectSingleNode( MailService.NS_PREFIX + ":" + MailService.E_FRAGMENT, XmlUtil.NamespaceManager );
			if( fragmentNode != null )
			{
				summary.Fragment = fragmentNode.InnerText;
			}

			ArrayList instanceList = new ArrayList();
			XmlNodeList iNodes = node.SelectNodes( MailService.NS_PREFIX + ":" + MailService.E_INSTANCE, XmlUtil.NamespaceManager );
			for( int i = 0; i < iNodes.Count; i++ )
			{
				XmlNode iNode = iNodes.Item(i);
				String s = XmlUtil.AttributeValue( iNode.Attributes, MailService.A_START );
				Int64 seconds = Int64.Parse( s );
				DateTime start = DateUtil.GmtSecondsToLocalTime( seconds );
				ApptSummaryInstance asi = new ApptSummaryInstance( start );
				instanceList.Add( asi );
			}

			summary.Instances = instanceList;
			return summary;
		}