示例#1
0
        void SiteObject(object instance, object site)
        {
            if (instance == null)
            {
                throw new ArgumentNullException("instance");
            }

            IObjectWithSite sitedObject = instance as IObjectWithSite;

            if (sitedObject != null)
            {
                sitedObject.SetSite(site);
            }
        }
示例#2
0
        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);
            }
        }