示例#1
0
        /// <summary>
        /// Adds a new Touch Strip for specified tablet if not already created; else it's a NO-OP.
        /// </summary>
        /// <param name="tabletIndex_I">index of tablet where control to be added</param>
        /// <param name="controlIndex_I">index of control to add</param>
        /// <param name="modeIndex_I">index of the mode</param>
        public void AddTouchStrip(UInt32 tabletIndex_I, int controlIndex_I, int modeIndex_I)
        {
            if (!mTablets.ContainsKey(tabletIndex_I))
            {
                mTablets[tabletIndex_I] = new TabletGraphic();
            }

            TabletGraphic tabGraphic = mTablets[tabletIndex_I];

            if (tabGraphic.touchStrips == null)
            {
                tabGraphic.touchStrips  = new LinearControlGraphic[1];
                mTablets[tabletIndex_I] = tabGraphic;
            }

            if (controlIndex_I >= mTablets[tabletIndex_I].touchStrips.Length)
            {
                Array.Resize(ref tabGraphic.touchStrips, mTablets[tabletIndex_I].touchStrips.Length + 1);
                mTablets[tabletIndex_I] = tabGraphic;
            }

            if (mTablets[tabletIndex_I].touchStrips[controlIndex_I].modes == null)
            {
                mTablets[tabletIndex_I].touchStrips[controlIndex_I].modes = new LinearControlMode[1];
            }

            if (modeIndex_I >= (int)mTablets[tabletIndex_I].touchStrips[controlIndex_I].modes.Length)
            {
                Array.Resize(ref tabGraphic.touchStrips[controlIndex_I].modes, tabGraphic.touchStrips[controlIndex_I].modes.Length + 1);
                mTablets[tabletIndex_I] = tabGraphic;
            }
        }
示例#2
0
        /// <summary>
        /// Adds a new Express Key for specified tablet if not already created; else it's a NO-OP.
        /// </summary>
        /// <param name="tabletIndex_I">index of tablet where control to be added</param>
        /// <param name="controlIndex_I">index of control to add</param>
        public void AddExpressKey(UInt32 tabletIndex_I, int controlIndex_I)
        {
            if (!mTablets.ContainsKey(tabletIndex_I))
            {
                mTablets[tabletIndex_I] = new TabletGraphic();
            }

            TabletGraphic tabGraphic = mTablets[tabletIndex_I];

            if (tabGraphic.expKeys == null)
            {
                tabGraphic.expKeys      = new ExpressKeyGraphic[1];
                mTablets[tabletIndex_I] = tabGraphic;
            }

            if (controlIndex_I >= mTablets[tabletIndex_I].expKeys.Length)
            {
                Array.Resize(ref tabGraphic.expKeys, tabGraphic.expKeys.Length + 1);
                mTablets[tabletIndex_I] = tabGraphic;
            }
        }