예제 #1
0
            protected void UnLinkSubStyle(ISubStyle style, ISubStyle parentProvided)
            {
                if (style == null)
                {
                    return;
                }

                style.OnChange -= TriggerChanged;

                if (parentProvided == null)
                {
                    return;
                }

                // We remove parent provided style.
                while (style.Parent != null)
                {
                    if (style.Parent == parentProvided)
                    {
                        style.Parent = null;
                        return;
                    }

                    style = style.Parent;
                }
            }
예제 #2
0
            protected void LinkSubStyle(ISubStyle style, ISubStyle parentProvided)
            {
                if (style == null)
                {
                    return;
                }

                style.OnChange += TriggerChanged;

                if (parentProvided == null)
                {
                    return;
                }

                // We link it to parent provided.
                while (style.Parent != null)
                {
                    style = style.Parent;
                }

                if (style != parentProvided)
                {
                    style.Parent = parentProvided;
                }
            }
예제 #3
0
 protected void ReparentSubStyle(ISubStyle style,
                                 ISubStyle prevParentProvided, ISubStyle currentParentProvided)
 {
     UnLinkSubStyle(style, prevParentProvided);
     LinkSubStyle(style, currentParentProvided);
 }