public InfoItemControl(AreaItemWrapper wrapper) 
            : base ()
        {
            if (wrapper == null)
                throw new ArgumentNullException("wrapper");

            Wrapper = wrapper;
            Caption = wrapper.Caption;

            UseDragDrop = true;
        }
 public InfoItemControl(AreaItemWrapper wrapper, BitmapImage icon)
     : this(wrapper)
 {
     Icon = icon;
 }
        CustomTreeNode FindCustomNode(AreaItemWrapper wrapper)
        {
            CustomTreeNode nodeInTree = null;
            if (wrapper != null)
            {
                Measure_AreaItemWrapper measures_item = wrapper as Measure_AreaItemWrapper;
                if (measures_item != null)
                {
                    nodeInTree = m_ServerExplorer.CubeBrowser.FindMeasureNode(measures_item.UniqueName);
                }

                CalculatedMember_AreaItemWrapper calcMember_item = wrapper as CalculatedMember_AreaItemWrapper;
                if (calcMember_item != null)
                {
                    nodeInTree = m_ServerExplorer.CubeBrowser.FindCalculatedMember(calcMember_item.Name);
                }

                CalculatedNamedSet_AreaItemWrapper calculatedSet_item = wrapper as CalculatedNamedSet_AreaItemWrapper;
                if (calculatedSet_item != null)
                {
                    nodeInTree = m_ServerExplorer.CubeBrowser.FindCalculatedNamedSet(calculatedSet_item.Name);
                }

                NamedSet_AreaItemWrapper set_item = wrapper as NamedSet_AreaItemWrapper;
                if (set_item != null)
                {
                    nodeInTree = m_ServerExplorer.CubeBrowser.FindNamedSet(set_item.Name);
                }

                Level_AreaItemWrapper level_item = wrapper as Level_AreaItemWrapper;
                if (level_item != null)
                {
                    nodeInTree = m_ServerExplorer.CubeBrowser.FindLevelNode(level_item.UniqueName);
                }

                Hierarchy_AreaItemWrapper hierarchy_item = wrapper as Hierarchy_AreaItemWrapper;
                if (hierarchy_item != null)
                {
                    nodeInTree = m_ServerExplorer.CubeBrowser.FindHierarchyNode(hierarchy_item.UniqueName);
                }

                Kpi_AreaItemWrapper kpi_item = wrapper as Kpi_AreaItemWrapper;
                if (kpi_item != null)
                {
                    switch (kpi_item.Type)
                    {
                        case KpiControlType.Goal:
                            nodeInTree = m_ServerExplorer.CubeBrowser.FindKpiGoalNode(kpi_item.Name);
                            break;
                        case KpiControlType.Status:
                            nodeInTree = m_ServerExplorer.CubeBrowser.FindKpiStatusNode(kpi_item.Name);
                            break;
                        case KpiControlType.Trend:
                            nodeInTree = m_ServerExplorer.CubeBrowser.FindKpiTrendNode(kpi_item.Name);
                            break;
                        case KpiControlType.Value:
                            nodeInTree = m_ServerExplorer.CubeBrowser.FindKpiValueNode(kpi_item.Name);
                            break;
                    }
                }
            }

            return nodeInTree;
        }