コード例 #1
0
        public static List <ExposableEvent> GetExposableEventsFor(EntitySave entitySave, bool removeAlreadyExposed)
        {
            List <ExposableEvent> returnValues = new List <ExposableEvent>();

            // February 18, 2012
            // Not sure why this checks
            // both if the Entity is IClickable
            // and IWindow, but only IWindow has
            // these events.  Let's fix that:
            //if (entitySave.ImplementsIClickable || entitySave.ImplementsIWindow)
            if (entitySave.GetImplementsIWindowRecursively())
            {
                AddIWindowEvents(returnValues);
            }

            if (entitySave.GetImplementsIVisibleRecursively())
            {
                returnValues.Add(new ExposableEvent("AfterVisibleSet", "Visible", BeforeOrAfter.After));
                returnValues.Add(new ExposableEvent("BeforeVisibleSet", "Visible", BeforeOrAfter.Before));
            }

            // todo:  Will want to implement after Enabled set events

            GetExposableEventsFor(entitySave, returnValues);


            returnValues.Sort(Sort);
            if (removeAlreadyExposed)
            {
                RemoveAlreadyExposed(entitySave, returnValues);
            }

            return(returnValues);
        }
コード例 #2
0
        private static List <MemberWithType> GetExposableMembersForEntity(EntitySave entitySave, bool removeAlreadyExposed,
                                                                          List <MemberWithType> returnValues)
        {
            if (entitySave.GetImplementsIVisibleRecursively())
            {
                returnValues.Add(new MemberWithType {
                    Member = "Visible", Type = "bool"
                });
            }
            if (entitySave.GetImplementsIWindowRecursively())
            {
                returnValues.Add(new MemberWithType {
                    Member = "Enabled", Type = "bool"
                });
            }

            returnValues.AddRange(mPositionedObjectMembers);

            return(returnValues);
        }