Exemplo n.º 1
0
 void ILanguageExtender.FindMethod([MarshalAs(UnmanagedType.BStr)] string bstrMethodName, ref int plMethodNum)
 {
     plMethodNum = 0;
     for (int i = 0; i <= this.m_Methods.GetUpperBound(0); i++)
     {
         AliasAttribute aliasAttribute = (AliasAttribute)Attribute.GetCustomAttribute(this.m_Methods[i], typeof(AliasAttribute));
         if (this.m_Methods[i].Name.ToUpper() == bstrMethodName.ToUpper() || (aliasAttribute != null && aliasAttribute.AliasName.ToUpper() == bstrMethodName.ToUpper()))
         {
             plMethodNum = i + 1;
             return;
         }
     }
 }
Exemplo n.º 2
0
        void ILanguageExtender.GetPropName(int lPropNum, int lPropAlias, [MarshalAs(UnmanagedType.BStr)] ref string pbstrPropName)
        {
            PropertyInfo propertyInfo = this.m_Properties[lPropNum - 1];

            pbstrPropName = propertyInfo.Name;
            if (lPropAlias == 1)
            {
                AliasAttribute aliasAttribute = (AliasAttribute)Attribute.GetCustomAttribute(propertyInfo, typeof(AliasAttribute));
                if (aliasAttribute != null)
                {
                    pbstrPropName = aliasAttribute.AliasName;
                }
            }
        }
Exemplo n.º 3
0
        void ILanguageExtender.GetMethodName(int lMethodNum, int lMethodAlias, [MarshalAs(UnmanagedType.BStr)] ref string pbstrMethodName)
        {
            MethodInfo methodInfo = this.m_Methods[lMethodNum - 1];

            pbstrMethodName = methodInfo.Name;
            if (lMethodAlias == 1)
            {
                AliasAttribute aliasAttribute = (AliasAttribute)Attribute.GetCustomAttribute(methodInfo, typeof(AliasAttribute));
                if (aliasAttribute != null)
                {
                    pbstrMethodName = aliasAttribute.AliasName;
                }
            }
        }
Exemplo n.º 4
0
        void ILanguageExtender.FindProp([MarshalAs(UnmanagedType.BStr)] string bstrPropName, ref int plPropNum)
        {
            plPropNum = 0;
            Type typeFromHandle = typeof(AliasAttribute);

            for (int i = 0; i <= this.m_Properties.GetUpperBound(0); i++)
            {
                AliasAttribute aliasAttribute = (AliasAttribute)Attribute.GetCustomAttribute(this.m_Properties[i], typeFromHandle);
                if (this.m_Properties[i].Name.ToUpper() == bstrPropName.ToUpper() || (aliasAttribute != null && aliasAttribute.AliasName.ToUpper() == bstrPropName.ToUpper()))
                {
                    plPropNum = i + 1;
                    return;
                }
            }
        }