/// <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)); }
internal bool IsNameDispId(object obj, DispatchID dispid) { if (obj is null || !obj.GetType().IsCOMObject) { return(false); } return(dispid == Com2TypeInfoProcessor.GetNameDispId((Oleaut32.IDispatch)obj)); }
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(""); }
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(""); }
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); }
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); }
internal bool IsNameDispId(object obj, int dispid) { return(((obj != null) && obj.GetType().IsCOMObject) && (dispid == Com2TypeInfoProcessor.GetNameDispId((UnsafeNativeMethods.IDispatch)obj))); }