当前位置: 首页>>代码示例>>C#>>正文


C# ICommand.execute方法代码示例

本文整理汇总了C#中ICommand.execute方法的典型用法代码示例。如果您正苦于以下问题:C# ICommand.execute方法的具体用法?C# ICommand.execute怎么用?C# ICommand.execute使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ICommand的用法示例。


在下文中一共展示了ICommand.execute方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: btnDelete_Click

        private void btnDelete_Click(object sender, EventArgs e)
        {
            if (_operNumlst.Count == 0)
                return;
            this.Enabled = false;
            foreach (var item in _operNumlst)
            {
                _deleteLabourNormCmd = new DeleteLabourNormCommand(item);
                _deleteLabourNormCmd.execute();
            }

            UpdateDataGrids();
            _operNumlst.Clear();
            this.Enabled = true;
        }
开发者ID:jeffmonson,项目名称:testrepo,代码行数:15,代码来源:fmNormsViewer.cs

示例2: btApplyDel_Click

 private void btApplyDel_Click(object sender, EventArgs e)
 {
     if (_operNumlst.Count > 0)
     {
         foreach (var item in _operNumlst)
         {
             _whereOperationUseItem = new WhereOperationUse(item, 1, 1, _selectProductChiper);
             _delWhereOperUseCmd = new DeleteWhereOperUseCommand(_whereOperationUseItem);
             _delWhereOperUseCmd.execute();
         }
         this.UpdateDataGrids();
         _operNumlst.Clear();
     }
     else
     {
         _delWhereOperUseCmd = new DeleteWhereOperUseCommand(_whereOperationUseItem);
         _delWhereOperUseCmd.execute();
         this.UpdateApplyDataGrid();
     }
 }
开发者ID:jeffmonson,项目名称:testrepo,代码行数:20,代码来源:fmNormsViewer.cs

示例3: btAddApply_Click

        private void btAddApply_Click(object sender, EventArgs e)
        {
            foreach (DataGridViewRow dgrow in dgOperApply.Rows)
            {
                if (dgrow.Cells[0].Value.ToString() == vtbProdName.ValueTxt)
                    return;

            }

            if (!vtbProdName.IsValid || !vtbSeriaFrom.IsValid)
            {
                return;
            }
            if (!FillTrudoyomkostDB.DcMaxApply.ContainsKey(vtbProdName.ValueTxt))
            {
                return;
            }

            int seriaFrom = MathFunctionForSeries.GetIntSeriaNumber(vtbSeriaFrom.ValueTxt);
            int seriaTo = MathFunctionForSeries.GetIntSeriaNumber(vtbSeriaTo.ValueTxt);
            short prodChipher = _dcInfProducts[vtbProdName.ValueTxt];
            _updateOldLabourCard = new UpdateOldNormCardCommand(seriaFrom, prodChipher);
            _updateOldLabourCard.execute();
            if (_operNumlst.Count == 0 && _dtLabourNorm.Rows.Count > 0)
            {

                foreach (DataRow tRow in _dtLabourNorm.Rows)
                {
                    _operNumlst.Add((int)tRow[0]);
                }

            }

            foreach (var item in _operNumlst)
            {
                bool IsApplyProduct = true;
                foreach (DataRow itemrow in _dcApplyOper[item].Rows)
                {
                    if (vtbProdName.ValueTxt.Equals(itemrow[0]))
                    {
                        IsApplyProduct = false;
                        break;
                    }
                }

                if (IsApplyProduct)
                {
                    _whereOperationUseItem = new WhereOperationUse(item, seriaFrom, seriaTo, prodChipher);
                    _addWhereOperUseCmd = new AddWhereOperUseCommand(_whereOperationUseItem);
                    _addWhereOperUseCmd.execute();
                }

            }

            UpdateDataGrids();
            CheckDelOper();
            _operNumlst.Clear();
        }
开发者ID:jeffmonson,项目名称:testrepo,代码行数:58,代码来源:fmNormsViewer.cs

示例4: execute

        public object execute(ICommand command, string line)
        {
            Match match = Regex.Match(line, @"([d|m|c]-\d+)", RegexOptions.IgnoreCase);
            string process = "p";
            if (match.Success)
            {
                process = match.Groups[1].Value;
            }

            char code = process[0];

            object result = null;

            switch (code)
            {
                case 'm':
                    IMetadataServer ms_server = (IMetadataServer)Activator.GetObject(typeof(IMetadataServer), processes[process]);
                    result = command.execute(ms_server, line);
                    break;

                case 'd':
                    IDataServer ds_server = (IDataServer)Activator.GetObject(typeof(IDataServer), processes[process]);
                    result = command.execute(ds_server, line);
                    break;

                case 'c':
                    IClient client = (IClient)Activator.GetObject(typeof(IClient), processes[process]);
                    result = command.execute(client, line);
                    break;
                default:
                    break;
            }

            return result;
        }
开发者ID:nunofmaia,项目名称:padi-fs,代码行数:35,代码来源:Form1.cs

示例5: StoreAndExecute

 public void StoreAndExecute(ICommand command)
 {
     _commands.Add(command);
     command.execute();
 }
开发者ID:janeski,项目名称:DesignPatterns,代码行数:5,代码来源:Switch.cs

示例6: executeCommand

		// PUBLIC
	
		/// <summary>
		/// Executes the command.
		/// </summary>
		/// <returns>
		/// The command.
		/// </returns>
		/// <param name='aICommand'>
		/// A I command.
		/// </param>
		public void executeCommand (ICommand aICommand) 
		{
			aICommand.execute();
			
			if (aICommand is IUndoableCommand) {
				_iUndoableCommands.Add (aICommand as IUndoableCommand);
			}
			
		}
开发者ID:eyalzur,项目名称:CodeSamplesPublic,代码行数:20,代码来源:CommandManager.cs


注:本文中的ICommand.execute方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。