public override void Initialize(IComponent component)
 {
     base.Initialize(component);
     //
     this.m_ExpandablePanelContainer = base.Component as ExpandablePanelContainer;
     if (this.m_ExpandablePanelContainer == null)
     {
         this.DisplayError(new ArgumentException("ExpandablePanelContainer == null"));
         return;
     }
 }
Пример #2
0
        protected override void WndProc(ref Message m)
        {
            try
            {
                if (this.m_ExpandablePanel.Created)
                {
                    switch (m.Msg)
                    {
                    case (int)GISShare.Win32.Msgs.WM_LBUTTONDOWN:    //0x201
                        Point point = GISShare.Win32.NativeMethods.LParamToMouseLocation((int)m.LParam);
                        if (
                            (this.m_ExpandablePanel.IsCaptionExpandArea &&
                             this.m_ExpandablePanel.CaptionRectangle.Contains(point))
                            ||
                            (this.m_ExpandablePanel.ShowTreeNodeButton &&
                             this.m_ExpandablePanel.GetTreeNodeButtonRectangle().Contains(point))
                            ||
                            (this.m_ExpandablePanel.ShowExpandButton &&
                             this.m_ExpandablePanel.GetExpandButtonRectangle().Contains(point))
                            )
                        {
                            ExpandablePanelContainer expandablePanelContainer = this.m_ExpandablePanel.Parent as ExpandablePanelContainer;
                            if (expandablePanelContainer == null)
                            {
                                return;
                            }
                            expandablePanelContainer.SetSelectedExpandablePanel(this.m_ExpandablePanel);
                        }
                        break;

                    default:
                        break;
                    }
                }
            }
            finally
            {
                base.WndProc(ref m);
            }
        }