Inheritance: MonoBehaviour
Beispiel #1
0
    /**
     *
     * @param appInfo		要打开的app信息
     * @param data			给打开的app传递的参数
     * @param isCloseAll	是否要关闭掉其他已打开的app
     * @param isAutoHide	如果要打开的app已经是在打开状态,是否要执行对打开的app执行关闭
     *
     */
    private static void turnModule(AppInfo appInfo, Object data, string openTable)
    {
        if (appInfo != null)
        {
            string   moduleName = appInfo.appName;
            AppPanel appPanel   = _modulePanel.ContainsKey(moduleName)?_modulePanel[moduleName]:null;
            if (appPanel == null)
            {
                appPanel = new AppPanel(appInfo);
                _modulePanel.Add(moduleName, appPanel);
            }

            appPanel.init(data, openTable);
            appPanel.setup();
        }
    }
        private void FillExistedPointInfo()
        {
            this.txtName.Text = _pointInfo.Name;
            this.txtIP.Text   = _pointInfo.IP;
            this.txtPort.Text = _pointInfo.Port;
            //Fill items
            if (_pointInfo.Items == null || _pointInfo.Items.Count() == 0)//no item
            {
                return;
            }
            foreach (var item in _pointInfo.Items)
            {
                IItemControl itemCtr = null;
                if (item.Type == ItemType.App.ToString())
                {
                    itemCtr = new AppPanel();
                }
                else if (item.Type == ItemType.Flash.ToString())
                {
                    itemCtr = new FlashPanel();
                }
                else if (item.Type == ItemType.Image.ToString())
                {
                    itemCtr = new ImagePanel();
                }
                else if (item.Type == ItemType.PPT.ToString())
                {
                    itemCtr = new PPTPanel();
                }
                else if (item.Type == ItemType.Video.ToString())
                {
                    itemCtr = new VideoPanel();
                }
                else if (item.Type == ItemType.WebPage.ToString())
                {
                    itemCtr = new WebPagePanel();
                }

                //load config
                if (itemCtr != null)
                {
                    this.flpItem.Controls.Add(itemCtr as UserControl);
                    itemCtr.LoadItem(item);
                    AddDeleteEvent(itemCtr);
                }
            }
        }
        private void AddItem_Click(object sender, EventArgs e)
        {
            ItemType     itemType  = (ItemType)cbType.SelectedIndex;
            IItemControl itemtoAdd = null;

            switch (itemType)
            {
            case ItemType.Image:
                itemtoAdd = new ImagePanel();
                break;

            case ItemType.PPT:
                itemtoAdd = new PPTPanel();
                break;

            case ItemType.App:
                itemtoAdd = new AppPanel();
                break;

            case ItemType.Flash:
                itemtoAdd = new FlashPanel();
                break;

            case ItemType.Video:
                itemtoAdd = new VideoPanel();
                break;

            case ItemType.WebPage:
                itemtoAdd = new WebPagePanel();
                break;

            default:
                break;
            }
            itemtoAdd.IsChanged = true;
            AddDeleteEvent(itemtoAdd);
        }