示例#1
0
        /// <summary>standard ConvertTo typeconverter code</summary>
        ///<summary>Standard type converter method</summary>
        public override object ConvertTo(ITypeDescriptorContext context, CultureInfo culture, object value, System.Type destinationType)
        {
            AtomBaseLink link = value as AtomBaseLink;

            if (destinationType == typeof(System.String) && link != null)
            {
                return("Uri: " + link.Uri);
            }
            return(base.ConvertTo(context, culture, value, destinationType));
        }
 /// <summary>parses a baselink object, like AtomId, AtomLogo, or AtomIcon</summary>
 /// <param name="reader"> correctly positioned xmlreader</param>
 /// <param name="baseLink">the base object to set the property on</param>
 /// <returns> </returns>
 protected void ParseBaseLink(XmlReader reader, AtomBaseLink baseLink)
 {
     Tracing.TraceCall();
     Tracing.Assert(reader != null, "reader should not be null");
     if (reader == null)
     {
         throw new ArgumentNullException("reader");
     }
     Tracing.Assert(baseLink != null, "baseLink should not be null");
     if (baseLink == null)
     {
         throw new ArgumentNullException("baseLink");
     }
     ParseBasicAttributes(reader, baseLink);
     if (reader.NodeType == XmlNodeType.Element)
     {
         // read the element content
         baseLink.Uri = new AtomUri(Utilities.DecodedValue(reader.ReadString()));
     }
 }
示例#3
0
       /////////////////////////////////////////////////////////////////////////////

       //////////////////////////////////////////////////////////////////////
       /// <summary>compares 2 IDs</summary> 
       /// <param name="theOne">the One </param>
       /// <param name="theOther">the Other</param>
       /// <returns>true if identical </returns>
       //////////////////////////////////////////////////////////////////////
       public static bool IsBaseLinkIdentical(AtomBaseLink theOne, AtomBaseLink theOther)
       {
           if (theOne==null && theOther==null)
           {
               return true;
           }

           if (ObjectModelHelper.IsBaseIdentical(theOne, theOther)==false)
           {
               return false;
           }
           if (AtomUri.Compare(theOne.Uri, theOther.Uri)!=0)
           {
               return false;
           }

           return true;
       }
 /// <summary>parses a baselink object, like AtomId, AtomLogo, or AtomIcon</summary> 
 /// <param name="reader"> correctly positioned xmlreader</param>
 /// <param name="baseLink">the base object to set the property on</param> 
 /// <returns> </returns>
 protected void ParseBaseLink(XmlReader reader, AtomBaseLink baseLink) {
     Tracing.TraceCall();
     Tracing.Assert(reader != null, "reader should not be null");
     if (reader == null) {
         throw new ArgumentNullException("reader");
     }
     Tracing.Assert(baseLink != null, "baseLink should not be null");
     if (baseLink == null) {
         throw new ArgumentNullException("baseLink");
     }
     ParseBasicAttributes(reader, baseLink);
     if (reader.NodeType == XmlNodeType.Element) {
         // read the element content
         baseLink.Uri = new AtomUri(Utilities.DecodedValue(reader.ReadString()));
     }
 }