예제 #1
0
 private Type[] GetParamTypes(ICommonPropertyNode func)
 {
     Type[] tt = null;
     int num = 0;
     IParameterNode[] parameters = func.parameters;
     tt = new Type[parameters.Length];
     for (int i = 0; i < func.parameters.Length; i++)
     {
         Type tp = helper.GetTypeReference(parameters[i].type).tp;
         if (func.parameters[i].parameter_type == parameter_type.value)
             tt[i + num] = tp;
         else
         {
             tt[i + num] = tp.MakeByRefType();
             //Type t = tp.Module.GetType(tp.FullName + "&");
             //if (t != null)
             //    tt[i + num] = t;
             //else
             //    tt[i + num] = mb.GetType(tp.FullName + "&");
         }
     }
     return tt;
 }
 public virtual void visit(ICommonPropertyNode value)
 {
     // TODO:  Add AbstractVisitor.SemanticTree.ISemanticVisitor.visit implementation
 }
예제 #3
0
        public void visit(ICommonPropertyNode value)
        {
            string s = value.GetType().ToString() + ".";
            prepare_string_node(value.name, s + "name");
            //value.common_comprehensive_type
            //value.comperehensive_type
            //value.comprehensive_type

            prepare_up_link_node(value.comperehensive_type.name.ToString(), s + "comperehensive_type", value.comperehensive_type);

            myTreeNode from = treeView.SelectedNode.Nodes[1] as myTreeNode;
            myTreeNode to = table_subnodes[value.comperehensive_type] as myTreeNode;
            table_for_up_links.Add(from, to);
            
            prepare_string_node(value.field_access_level.ToString(), s + "field_access_level");
            prepare_node(value.get_function, s + "get_function");
            prepare_string_node(value.node_kind.ToString(), s + "node_kind");
            prepare_collection(value.parameters, s + "parameters", "parameters", value.parameters.Length);
            prepare_string_node(value.polymorphic_state.ToString(), s + "polymorphic_state");
            prepare_node(value.property_type, s + "property_type");
            prepare_node(value.set_function, s + "set_function");
        }
예제 #4
0
 private void MakeAttribute(ICommonPropertyNode prop)
 {
     PropertyBuilder pb = (PropertyBuilder)helper.GetProperty(prop).prop;
     IAttributeNode[] attrs = prop.Attributes;
     for (int i = 0; i < attrs.Length; i++)
     {
         CustomAttributeBuilder cab = new CustomAttributeBuilder
             ((attrs[i].AttributeConstructor is ICompiledConstructorNode) ? (attrs[i].AttributeConstructor as ICompiledConstructorNode).constructor_info : helper.GetConstructor(attrs[i].AttributeConstructor).cnstr, get_constants(attrs[i].Arguments),
             get_named_properties(attrs[i].PropertyNames), get_constants(attrs[i].PropertyInitializers),
             get_named_fields(attrs[i].FieldNames), get_constants(attrs[i].FieldInitializers));
         pb.SetCustomAttribute(cab);
     }
 }
예제 #5
0
		public virtual void visit(ICommonPropertyNode value)
		{
			// TODO:  Add AbstractVisitor.SemanticTree.ISemanticVisitor.visit implementation
		}
예제 #6
0
 public void visit(ICommonPropertyNode value)
 {
     throw new System.NotSupportedException(value.GetType().ToString());
 }
예제 #7
0
		public static string get_prop_name(ICommonPropertyNode p)
		{
			return get_type_name(p.comperehensive_type) + "." + p.name;
		}
예제 #8
0
		public static bool can_write(ICommonPropertyNode t)
		{
			return !(string.IsNullOrEmpty(t.Documentation) && !builder.options.ShowNoCommentedElements || t.name.Contains("$")
			        || user_doc_disabled(t.Documentation));
		}
예제 #9
0
		public static string get_property_header(ICommonPropertyNode p)
		{
			StringBuilder sb = new StringBuilder();
			string hdr = HelpUtils.extract_user_defined_header(p.Documentation);
			if (!string.IsNullOrEmpty(hdr))
			{
				sb.Append("<div>"+hdr+"</div>");
				return sb.ToString();
			}
			sb.Append("<div>");
			sb.Append(get_span_for_keyword(get_text_for_access_level(p.field_access_level))+" ");
			if (p.polymorphic_state == polymorphic_state.ps_static)
				sb.Append(get_span_for_keyword("class")+" ");
			sb.Append(get_span_for_keyword("property")+" ");
			sb.Append(get_span_for_identifier(p.name));
			sb.Append(get_property_parameters(p.parameters));
			sb.Append(" : "+get_type_html_text(p.property_type));
			if (p.get_function != null)
				sb.Append(" read");
			if (p.set_function != null)
				sb.Append(" write");
			if (p.polymorphic_state == polymorphic_state.ps_virtual)
				sb.Append("; "+get_span_for_keyword("virtual"));
			else if (p.polymorphic_state == polymorphic_state.ps_virtual_abstract)
				sb.Append("; "+get_span_for_keyword("abstract"));
			sb.Append("</div>");
			return sb.ToString();
		}