Esempio n. 1
0
        IEnumerable <IMemberDef> CalculateDefsToRemove()
        {
            var m = GetInitializeComponent();

            if (m != null)
            {
                yield return(m);

                foreach (var f in DotNetUtils.GetFields(m))
                {
                    yield return(f);
                }
            }

            m = GetDispose();
            if (m != null)
            {
                yield return(m);

                foreach (var f in DotNetUtils.GetFields(m))
                {
                    yield return(f);
                }
            }
        }
Esempio n. 2
0
        IEnumerable <IMemberDef> GetDefsToRemove()
        {
            var ep = Type.Module.EntryPoint;

            if (ep != null && ep.DeclaringType == Type)
            {
                yield return(ep);
            }

            var d = FindInitializeComponent();

            if (d != null)
            {
                yield return(d);

                foreach (var f in DotNetUtils.GetFields(d))
                {
                    if (f.FieldType.RemovePinnedAndModifiers().GetElementType() == ElementType.Boolean)
                    {
                        yield return(f);
                    }
                }
            }

            var connMeth = FindConnectMethod();

            if (connMeth != null)
            {
                yield return(connMeth);

                foreach (var f in DotNetUtils.GetFields(connMeth))
                {
                    yield return(f);
                }
            }

            var delMeth = FindCreateDelegateMethod();

            if (delMeth != null)
            {
                yield return(delMeth);
            }
        }