Exemplo n.º 1
0
 /// <summary>
 /// Write attached property syntax
 /// </summary>
 /// <param name="reflection">The reflection data used to produce the syntax</param>
 /// <param name="writer">The writer to which the syntax is written</param>
 public virtual void WriteAttachedPropertySyntax(XPathNavigator reflection, SyntaxWriter writer)
 {
     string getterId = (string)reflection.Evaluate(attachedPropertyGetterExpression);
     string setterId = (string)reflection.Evaluate(attachedPropertySetterExpression);
     if(!string.IsNullOrEmpty(getterId))
     {
         writer.WriteString("See ");
         writer.WriteReferenceLink(getterId);
     }
     if(!string.IsNullOrEmpty(setterId))
     {
         if(!string.IsNullOrEmpty(getterId))
             writer.WriteString(", ");
         writer.WriteReferenceLink(setterId);
     }
 }
Exemplo n.º 2
0
 /// <summary>
 /// Write attached event syntax
 /// </summary>
 /// <param name="reflection">The reflection data used to produce the syntax</param>
 /// <param name="writer">The writer to which the syntax is written</param>
 public virtual void WriteAttachedEventSyntax(XPathNavigator reflection, SyntaxWriter writer)
 {
     string adderId = (string)reflection.Evaluate(attachedEventAdderExpression);
     string removerId = (string)reflection.Evaluate(attachedEventRemoverExpression);
     if(!(string.IsNullOrEmpty(adderId) && string.IsNullOrEmpty(removerId)))
     {
         writer.WriteString("See ");
         writer.WriteReferenceLink(adderId);
         writer.WriteString(", ");
         writer.WriteReferenceLink(removerId);
     }
 }
        /// <summary>
        /// Write out a normal type reference
        /// </summary>
        /// <param name="api">The type reference to output</param>
        /// <param name="writer">The syntax writer to which the type reference is written</param>
        protected virtual void WriteNormalTypeReference(string api, SyntaxWriter writer)
        {
            switch(api)
            {
                case "T:System.Void":
                    writer.WriteReferenceLink(api, "void");
                    break;

                case "T:System.String":
                    writer.WriteReferenceLink(api, "string");
                    break;

                case "T:System.Boolean":
                    writer.WriteReferenceLink(api, "bool");
                    break;

                case "T:System.Byte":
                    writer.WriteReferenceLink(api, "byte");
                    break;

                case "T:System.SByte":
                    writer.WriteReferenceLink(api, "sbyte");
                    break;

                case "T:System.Char":
                    writer.WriteReferenceLink(api, "char");
                    break;

                case "T:System.Int16":
                    writer.WriteReferenceLink(api, "short");
                    break;

                case "T:System.Int32":
                    writer.WriteReferenceLink(api, "int");
                    break;

                case "T:System.Int64":
                    writer.WriteReferenceLink(api, "long");
                    break;

                case "T:System.UInt16":
                    writer.WriteReferenceLink(api, "ushort");
                    break;

                case "T:System.UInt32":
                    writer.WriteReferenceLink(api, "uint");
                    break;

                case "T:System.UInt64":
                    writer.WriteReferenceLink(api, "ulong");
                    break;

                case "T:System.Single":
                    writer.WriteReferenceLink(api, "float");
                    break;

                case "T:System.Double":
                    writer.WriteReferenceLink(api, "double");
                    break;

                case "T:System.Decimal":
                    writer.WriteReferenceLink(api, "decimal");
                    break;

                default:
                    writer.WriteReferenceLink(api);
                    break;
            }
        }