DialogResult ICyParamEditHook_v1.EditParams(ICyInstEdit_v1 edit, ICyTerminalQuery_v1 termQuery,
                                                    ICyExpressMgr_v1 mgr)
        {
            const string         PAPAM_TAB_NAME_BUILTIN      = "Built-in";
            const string         PAPAM_TAB_NAME_INTERCONNECT = "Interconnect";
            CyParameters         prms            = new CyParameters(edit);
            CyGeneralPage        generalPage     = new CyGeneralPage(prms);
            ICyTabbedParamEditor editor          = edit.CreateTabbedParamEditor();
            CyTerminalControl_v1 interconnectTab = null;

            CyParamExprDelegate exprDelegate = delegate(ICyParamEditor custEditor, CyCompDevParam param)
            {
                prms.m_globalEditMode = false;
                if (param.TabName == generalPage.TabName)
                {
                    generalPage.InitFields();
                }
                prms.m_globalEditMode = true;
            };

            editor.AddCustomPage(Properties.Resources.PageTitleGeneral, generalPage, exprDelegate, generalPage.TabName);

            // System Builder support
            if (prms.InstQuery.DeviceQuery.IsPSoC4 && edit.IsInSystemBuilder)
            {
                interconnectTab = new CyTerminalControl_v1(edit);
                editor.AddCustomPage(Resources.InterconnectTabDisplayName, interconnectTab, exprDelegate,
                                     PAPAM_TAB_NAME_INTERCONNECT);
            }
            editor.AddDefaultPage(Properties.Resources.PageTitleBuiltIn, PAPAM_TAB_NAME_BUILTIN);

            prms.m_globalEditMode = true;

            return(editor.ShowDialog());
        }
Ejemplo n.º 2
0
        DialogResult ICyParamEditHook_v1.EditParams(ICyInstEdit_v1 edit, ICyTerminalQuery_v1 termQuery,
            ICyExpressMgr_v1 mgr)
        {
            const string PAPAM_TAB_NAME_BUILTIN = "Built-in";
            const string PAPAM_TAB_NAME_INTERCONNECT = "Interconnect";
            CyParameters prms = new CyParameters(edit);
            CyGeneralPage generalPage = new CyGeneralPage(prms);
            ICyTabbedParamEditor editor = edit.CreateTabbedParamEditor();
            CyTerminalControl_v1 interconnectTab = null;

            CyParamExprDelegate exprDelegate = delegate(ICyParamEditor custEditor, CyCompDevParam param)
            {
                prms.m_globalEditMode = false;
                if (param.TabName == generalPage.TabName)
                    generalPage.InitFields();
                prms.m_globalEditMode = true;
            };

            editor.AddCustomPage(Properties.Resources.PageTitleGeneral, generalPage, exprDelegate, generalPage.TabName);

            // System Builder support
            if (prms.InstQuery.DeviceQuery.IsPSoC4 && edit.IsInSystemBuilder)
            {
                interconnectTab = new CyTerminalControl_v1(edit);
                editor.AddCustomPage(Resources.InterconnectTabDisplayName, interconnectTab, exprDelegate,
                    PAPAM_TAB_NAME_INTERCONNECT);
            }
            editor.AddDefaultPage(Properties.Resources.PageTitleBuiltIn, PAPAM_TAB_NAME_BUILTIN);

            prms.m_globalEditMode = true;

            return editor.ShowDialog();
        }