private static MemberReference HandleGenericParameterProvider(MemberReference member)
        {
            if (member == null)
            {
                return(null);
            }

            var provider = member as IGenericParameterProvider;

            if (provider == null || !provider.HasGenericParameters)
            {
                return(member);
            }

            var form = GenericInstanceFormFactory.GetForm(member);

            if (form == null)
            {
                return(member);
            }

            using (form)
            {
                if (form.ShowDialog() == DialogResult.OK)
                {
                    return((MemberReference)form.GenericInstance);
                }
            }

            return(member);
        }
예제 #2
0
        private MemberReference HandleGenericParameterProvider(MemberReference member)
        {
            if (member == null)
            {
                return(null);
            }

            var provider = member as IGenericParameterProvider;

            if (provider == null || !provider.HasGenericParameters)
            {
                return(member);
            }

            var genericParameterProvider = Context as IGenericParameterProvider;
            var genericContext           = genericParameterProvider ?? provider;

            var form = GenericInstanceFormFactory.GetForm(provider, genericContext);

            if (form == null)
            {
                return(member);
            }

            using (form)
            {
                if (form.ShowDialog() != DialogResult.OK)
                {
                    throw new OperationCanceledException();
                }

                var instance = form.GenericInstance;
                if (instance != null)
                {
                    return((MemberReference)instance);
                }

                return((MemberReference)provider);
            }
        }