コード例 #1
0
        /// <summary>
        /// 選択中のオプションを取得する処理
        /// </summary>
        /// <returns>選択中のオプション</returns>
        public static ClsDatOption GetOptionFromSelectLineNo()
        {
            int inLineNo = ClsSystem.GetSelectLineNo();

            if (inLineNo < 0)
            {
                return(null);
            }

            ClsDatOption clOption = ClsSystem.GetOptionFromLineNo(inLineNo);

            return(clOption);
        }
コード例 #2
0
ファイル: FormControl.cs プロジェクト: Yoshisan0/hanim
        private void contextMenuStrip_Opening(object sender, CancelEventArgs e)
        {
            ClsDatMotion clMotion = ClsSystem.GetSelectMotion();

            if (clMotion == null)
            {
                return;
            }

            bool isRemoveElementEnable = false;
            bool isAddOptionEnable     = false;
            bool isRemoveOptionEnable  = false;

            int inLineNo = ClsSystem.GetSelectLineNo();

            if (inLineNo >= 0)
            {
                ClsDatItem clItem = clMotion.GetItemFromLineNo(inLineNo);
                if (clItem != null)
                {
                    isRemoveElementEnable = true;
                    isAddOptionEnable     = true;
                }

                ClsDatOption clOption = ClsSystem.GetOptionFromLineNo(inLineNo);
                if (clOption != null)
                {
                    bool isRemoveOK = clOption.IsRemoveOK();
                    if (isRemoveOK)
                    {
                        isRemoveOptionEnable = true;
                    }
                }
            }

            this.ToolStripMenuItem_RemoveElement.Enabled = isRemoveElementEnable;
            this.ToolStripMenuItem_AddOption.Enabled     = isAddOptionEnable;
            this.ToolStripMenuItem_RemoveOption.Enabled  = isRemoveOptionEnable;
        }