Пример #1
0
        private void ExpandAll()
        {
            if (SelectedObject == null)
            {
                return;
            }

            Visible = false;
            try
            {
                if (gridViewAccessor == null)
                {
                    gridViewAccessor = new FieldAccesor(this, "gridView");
                    peMainAccessor   = new FieldAccesor(this, "peMain");
                }

                object gridView = gridViewAccessor.Get();
                object peMain   = peMainAccessor.Get();
                if (recursivelyExpandAccessor == null)
                {
                    recursivelyExpandAccessor = new MethodAccesor(gridView.GetType(), "RecursivelyExpand");
                }

                recursivelyExpandAccessor.Invoke(gridView, new object[] { peMain, false, true, 2 });
            }
            finally { Visible = true; }
        }
Пример #2
0
        public void DynamicInvoke()
        {
            Type target = (component is Type)?(component as Type):component.GetType();

            if (target != null)
            {
                MethodAccesor methodAcc = new MethodAccesor(target, "On" + eventInfo.Name);
                if (methodAcc.IsValid)
                {
                    if (target is Type)
                    {
                        methodAcc.Invoke(null);
                    }
                    else
                    {
                        methodAcc.Invoke(component);
                    }
                }
            }
        }