Ejemplo n.º 1
0
 /// <summary>
 /// Checks if the given dispid matches the dispid that the Object would like to specify
 /// as its identification proeprty (Name, ID, etc).
 /// </summary>
 internal bool IsNameDispId(object obj, int dispid)
 {
     if (obj == null || !obj.GetType().IsCOMObject)
     {
         return(false);
     }
     return(dispid == Com2TypeInfoProcessor.GetNameDispId((UnsafeNativeMethods.IDispatch)obj));
 }
Ejemplo n.º 2
0
        internal bool IsNameDispId(object obj, DispatchID dispid)
        {
            if (obj is null || !obj.GetType().IsCOMObject)
            {
                return(false);
            }

            return(dispid == Com2TypeInfoProcessor.GetNameDispId((Oleaut32.IDispatch)obj));
        }
Ejemplo n.º 3
0
 internal string GetName(object component)
 {
     if (component is UnsafeNativeMethods.IDispatch)
     {
         int nameDispId = Com2TypeInfoProcessor.GetNameDispId((UnsafeNativeMethods.IDispatch)component);
         if (nameDispId != -1)
         {
             bool   succeeded = false;
             object obj2      = this.GetPropertyValue(component, nameDispId, ref succeeded);
             if (succeeded && (obj2 != null))
             {
                 return(obj2.ToString());
             }
         }
     }
     return("");
 }
Ejemplo n.º 4
0
        internal string GetName(object component)
        {
            if (!(component is UnsafeNativeMethods.IDispatch))
            {
                return("");
            }

            int dispid = Com2TypeInfoProcessor.GetNameDispId((UnsafeNativeMethods.IDispatch)component);

            if (dispid != NativeMethods.MEMBERID_NIL)
            {
                bool   success = false;
                object value   = GetPropertyValue(component, dispid, ref success);

                if (success && value != null)
                {
                    return(value.ToString());
                }
            }
            return("");
        }
Ejemplo n.º 5
0
        internal string GetName(object component)
        {
            if (!(component is UnsafeNativeMethods.IDispatch))
            {
                return("");
            }

            Ole32.DispatchID dispid = Com2TypeInfoProcessor.GetNameDispId((UnsafeNativeMethods.IDispatch)component);
            if (dispid != Ole32.DispatchID.UNKNOWN)
            {
                bool   success = false;
                object value   = GetPropertyValue(component, dispid, ref success);

                if (success && value != null)
                {
                    return(value.ToString());
                }
            }

            return(string.Empty);
        }
Ejemplo n.º 6
0
        internal string GetName(object component)
        {
            if (!(component is Oleaut32.IDispatch))
            {
                return("");
            }

            DispatchID dispid = Com2TypeInfoProcessor.GetNameDispId((Oleaut32.IDispatch)component);

            if (dispid != DispatchID.UNKNOWN)
            {
                bool   success = false;
                object value   = GetPropertyValue(component, dispid, ref success);

                if (success && value is not null)
                {
                    return(value.ToString());
                }
            }

            return(string.Empty);
        }
Ejemplo n.º 7
0
 internal bool IsNameDispId(object obj, int dispid)
 {
     return(((obj != null) && obj.GetType().IsCOMObject) && (dispid == Com2TypeInfoProcessor.GetNameDispId((UnsafeNativeMethods.IDispatch)obj)));
 }