コード例 #1
0
ファイル: Parameter.cs プロジェクト: miaojiang1/monodevelop-1
        public Parameter(IMember declaringMember, Fun_parm pinfo, XmlNode docNode)
        {
            this.name = pinfo.Name;
            NCC.MType realType = (NCC.MType)pinfo.ty;
            if (realType is NCC.MType.Ref)
            {
                NCC.MType.Ref rt = (NCC.MType.Ref)realType;
                returnType = new ReturnType((NCC.MType)rt.t.Fix());
                modifier  |= ParameterModifier.Ref;
            }
            else if (realType is NCC.MType.Out)
            {
                NCC.MType.Out rt = (NCC.MType.Out)realType;
                returnType = new ReturnType((NCC.MType)rt.t.Fix());
                modifier  |= ParameterModifier.Out;
            }
            else
            {
                returnType = new ReturnType(realType);
            }
            this.declaringMember = declaringMember;

            try { LoadXml(docNode); } catch { }
        }
コード例 #2
0
 XmlNode FindMatch(XmlNodeList nodes, NCC.IMethod methodBase)
 {
     Nemerle.Core.list <Fun_parm> p = methodBase.GetParameters();
     foreach (XmlNode node in nodes)
     {
         XmlNodeList paramList = node.SelectNodes("Parameters/*");
         if (p.Length == 0 && paramList.Count == 0)
         {
             return(node);
         }
         if (p.Length != paramList.Count)
         {
             continue;
         }
         try
         {
             bool matched = true;
             for (int i = 0; i < paramList.Count; i++)
             {
                 Fun_parm k = p.Nth(i);
                 if (k.ty is NCC.MType.Class)
                 {
                     string pname = ((NCC.MType.Class)k.ty).tycon.FrameworkTypeName;
                     if (pname != paramList[i].Attributes["Type"].Value)
                     {
                         matched = false;
                         break;
                     }
                 }
                 else if (k.ty is NCC.MType.Array)
                 {
                     NCC.MType.Array zas = (NCC.MType.Array)k.ty;
                     if (zas.t is NCC.MType.Class)
                     {
                         string pname = ((NCC.MType.Class)zas.t).tycon.FrameworkTypeName + "[]";
                         if (pname != paramList[i].Attributes["Type"].Value)
                         {
                             matched = false;
                             break;
                         }
                     }
                 }
                 else if (k.ty is NCC.MType.Ref)
                 {
                     NCC.MType.Ref zas = (NCC.MType.Ref)k.ty;
                     if (zas.t is NCC.MType.Class)
                     {
                         string pname = ((NCC.MType.Class)zas.t).tycon.FrameworkTypeName + "&";
                         if (pname != paramList[i].Attributes["Type"].Value)
                         {
                             matched = false;
                             break;
                         }
                     }
                 }
                 else
                 {
                     matched = false;
                     break;
                 }
             }
             if (matched)
             {
                 return(node);
             }
         }
         catch { }
     }
     return(null);
 }