void SiteObject(object instance, object site) { if (instance == null) { throw new ArgumentNullException("instance"); } IObjectWithSite sitedObject = instance as IObjectWithSite; if (sitedObject != null) { sitedObject.SetSite(site); } }
void SiteObject(object instance, object site) { if (instance == null) { throw new ArgumentNullException("instance"); } ThreadHelper.ThrowIfNotOnUIThread(); IObjectWithSite sitedObject = instance as IObjectWithSite; if (sitedObject != null) { sitedObject.SetSite(site); } }