5177 |
#endif |
#endif |
5178 |
protected virtual void OnParentVisibleChanged(EventArgs e) |
protected virtual void OnParentVisibleChanged(EventArgs e) |
5179 |
{ |
{ |
|
bool parentVisible = parent.Visible; |
|
5180 |
OnVisibleChanged(e); |
OnVisibleChanged(e); |
5181 |
} |
} |
5182 |
internal virtual void OnPrimaryEnter(EventArgs e) |
internal virtual void OnPrimaryEnter(EventArgs e) |
5675 |
value.CreateControl(); |
value.CreateControl(); |
5676 |
owner.PerformLayout(value, "Parent"); |
owner.PerformLayout(value, "Parent"); |
5677 |
} |
} |
5678 |
|
|
5679 |
|
// If it's supposed to be visible then fire the |
5680 |
|
// OnVisibleChanged event. |
5681 |
|
if (value.visible) |
5682 |
|
{ |
5683 |
|
value.OnVisibleChanged(EventArgs.Empty); |
5684 |
|
} |
5685 |
|
|
5686 |
// Notify the owner that the control was added. |
// Notify the owner that the control was added. |
5687 |
owner.OnControlAdded |
owner.OnControlAdded |
5688 |
(new ControlEventArgs(value)); |
(new ControlEventArgs(value)); |
5727 |
{ |
{ |
5728 |
if(value != null && value.Parent == owner) |
if(value != null && value.Parent == owner) |
5729 |
{ |
{ |
5730 |
|
bool wasVisible = value.Visible; |
5731 |
|
|
5732 |
// Update the parent. |
// Update the parent. |
5733 |
value.Parent = null; |
value.Parent = null; |
5734 |
|
|
5735 |
// Perform layout on the owner. |
// Perform layout on the owner. |
5736 |
owner.PerformLayout(value, "Parent"); |
owner.PerformLayout(value, "Parent"); |
5737 |
|
|
5738 |
|
// If it was visible, it now isn't and thus the |
5739 |
|
// visibility changed. |
5740 |
|
if (wasVisible) |
5741 |
|
value.OnVisibleChanged (EventArgs.Empty); |
5742 |
|
|
5743 |
// Notify the owner that the control has been removed. |
// Notify the owner that the control has been removed. |
5744 |
owner.OnControlRemoved(new ControlEventArgs(value)); |
owner.OnControlRemoved(new ControlEventArgs(value)); |
5745 |
} |
} |