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


C# Operation.ToString方法代码示例

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


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

示例1: FormatOperationCustomDataFail

        public void FormatOperationCustomDataFail()
        {
            Operation operation = new Operation();
            operation.Id = 42;
            operation.Comment = "Brand!!!";

            string format = "{Id}, {MichGibtsNicht}";
            string resultExpected = string.Format("{0}, {1}", operation.Id, "");
            string result = operation.ToString(format);

            Assert.AreEqual(resultExpected, result);
        }
开发者ID:happy5217744,项目名称:AlarmWorkflow,代码行数:12,代码来源:OperationExpressionTests.cs

示例2: FormatOperationCustomData

        public void FormatOperationCustomData()
        {
            string cdexpr1 = "ort";
            string cdexpr1value = "12345";
            string cdexpr2 = "myfunny.little.weird.expression";
            int cdexpr2value = 42;
            string resultExpected = string.Format("{0} - {1}", cdexpr1value, cdexpr2value);

            Operation operation = new Operation();
            operation.CustomData[cdexpr1] = cdexpr1value;
            operation.CustomData[cdexpr2] = cdexpr2value;

            string format = string.Format("{{{0}}} - {{{1}}}", cdexpr1, cdexpr2);
            string result = operation.ToString(format);

            Assert.AreEqual(resultExpected, result);
        }
开发者ID:happy5217744,项目名称:AlarmWorkflow,代码行数:17,代码来源:OperationExpressionTests.cs

示例3: CreateOperationNode

        /// <exception cref="ArgumentNullException">
		/// <paramref name="parentNode"/> is null.-or-
		/// <paramref name="operation"/> is null.
		/// </exception>
		protected TreeNode CreateOperationNode(TreeNode parentNode, Operation operation)
		{
			if (parentNode == null)
				throw new ArgumentNullException("parentNode");
			if (operation == null)
				throw new ArgumentNullException("operation");

			TreeNode child = parentNode.Nodes.Add(operation.GetUmlDescription());
			int imageIndex = Icons.GetImageIndex(operation);

			child.Tag = operation;
			child.ImageIndex = imageIndex;
			child.SelectedImageIndex = imageIndex;
			child.ToolTipText = operation.ToString();

			return child;
		}
开发者ID:gbaychev,项目名称:NClass,代码行数:21,代码来源:TreeDialog.cs

示例4: StringBuilder

        void IJob.Execute(IJobContext context, Operation operation)
        {
            StringBuilder messageText = new StringBuilder();
            messageText.AppendFormat("Ort: {0}, ", operation.GetDestinationLocation());
            if (!string.IsNullOrWhiteSpace(operation.Picture))
            {
                messageText.AppendFormat("{0}; ", operation.Picture);
            }
            if (!string.IsNullOrWhiteSpace(operation.Comment))
            {
                messageText.AppendFormat("{0}", operation.Comment);
            }

            string format = SettingsManager.Instance.GetSetting("SMSJob", "MessageFormat").GetString();
            string text = operation.ToString(format);

            // Truncate the string if it is too long
            text = messageText.ToString().Truncate(160, true, true);

            // Invoke the provider-send asynchronous because it is a web request and may take a while
            _provider.Send(_userName, _password, _recipients.Select(r => r.PhoneNumber), text);
        }
开发者ID:Knatter33,项目名称:AlarmWorkflow,代码行数:22,代码来源:SMSJob.cs

示例5: GetName

 public string GetName(Operation operation)
 {
     if (operation == null) throw new ArgumentNullException(nameof(operation));
     return GetName(operation.Id) ?? operation.ToString();
 }
开发者ID:cg123,项目名称:xenko,代码行数:5,代码来源:UndoRedoService.cs

示例6: ExecuteOperation

 private void ExecuteOperation(Operation currOp)
 {
     this.DeleteFurniture(currOp.FurnitureOldData, false);
     this.DrawFurniture(currOp.FurnitureNewData, currOp.Furniture.ID, false);
     operationsStack.Items.Add(currOp.ToString());
 }
开发者ID:DeJaVoo,项目名称:strips-froniture,代码行数:6,代码来源:Form1.cs

示例7: PerformOperation

        public static void PerformOperation(long playerInfoId, Operation op, string param, bool ignoreCommand)
        {
            if (Program.LicenseExpired == true)
                return;

            try
            {
                if (playerInfoId != ActiveBgMusic.Id)
                {
                    // Foreground sound infos

                    SoundPlayerInfo playerInfo;
                    switch (op)
                    {
                        case Operation.Show:
                            OperationHelper.Show(getPidForPlayerInfoId(playerInfoId));
                            break;

                        case Operation.Minimize:
                            OperationHelper.Minimize(getPidForPlayerInfoId(playerInfoId));
                            break;
                        case Operation.IgnoreForAutoMute:
                            playerInfo = FindPlayerInfo(playerInfoId);
                            if (playerInfo != null)
                            {
                                SmartVolManagerPackage.BgMusicManager.FgMusicIgnore[playerInfo.Id] = true;
                                SmartVolManagerPackage.BgMusicManager.IgnoreProcNameForAutomuteDict[playerInfo.ShortProcessName] = true;
                                MuteFmConfigUtil.InitIgnoreForAutoMute(SmartVolManagerPackage.BgMusicManager.IgnoreProcNameForAutomuteDict, SmartVolManagerPackage.BgMusicManager.MuteFmConfig);
                                MuteFmConfigUtil.Save(SmartVolManagerPackage.BgMusicManager.MuteFmConfig);
                                UpdateFgMusicState();
                            }
                            break;
                        case Operation.NoIgnoreForAutoMute:
                            playerInfo = FindPlayerInfo(playerInfoId);
                            if (playerInfo != null)
                            {
                                SmartVolManagerPackage.BgMusicManager.FgMusicIgnore[playerInfo.Id] = false;
                                SmartVolManagerPackage.BgMusicManager.IgnoreProcNameForAutomuteDict[playerInfo.ShortProcessName] = false;
                                MuteFmConfigUtil.InitIgnoreForAutoMute(SmartVolManagerPackage.BgMusicManager.IgnoreProcNameForAutomuteDict, SmartVolManagerPackage.BgMusicManager.MuteFmConfig);
                                MuteFmConfigUtil.Save(SmartVolManagerPackage.BgMusicManager.MuteFmConfig);
                                UpdateFgMusicState();
                            }
                            break;
                        default:

                            string[] sessionInstanceIdentifiers = getSessionInstanceIdentifiers(playerInfoId);

                            foreach (string sessionInstanceIdentifier in sessionInstanceIdentifiers)
                            {
                                switch (op)
                                {
                                    case Operation.Mute:
                                        FgMusicMuted[playerInfoId] = true;
                                        MuteFm.SmartVolManagerPackage.SoundServer.PerformOperation(sessionInstanceIdentifier, OperationEnum.Mute.ToString(), null, null, new PostVolumeOp(delegate() { UpdateFgMusicState(); }));
                                        break;
                                    case Operation.Unmute:
                                        FgMusicMuted[playerInfoId] = false;
                                        MuteFm.SmartVolManagerPackage.SoundServer.PerformOperation(sessionInstanceIdentifier, OperationEnum.Unmute.ToString(), null, null, new PostVolumeOp(delegate() { UpdateFgMusicState(); }));
                                        break;
                                    case Operation.SetVolumeTo:
                                        FgMusicVol[playerInfoId] = float.Parse(param);
                                        MuteFm.SmartVolManagerPackage.SoundServer.PerformOperation(sessionInstanceIdentifier, OperationEnum.SetVolumeTo.ToString(), param, null, new PostVolumeOp(delegate() { UpdateFgMusicState(); }));
                                        break;
                                    case Operation.SetVolumeToNoFade:
                                        FgMusicVol[playerInfoId] = float.Parse(param);
                                        MuteFm.SmartVolManagerPackage.SoundServer.PerformOperation(sessionInstanceIdentifier, OperationEnum.SetVolumeToNoFade.ToString(), param, null, new PostVolumeOp(delegate() { UpdateFgMusicState(); }));
                                        break;
                                }
                            }
                            break;
                    }

                    // TODO: update state via postoperation in all of the above
                }
                else
                {
                    MuteFm.SmartVolManagerPackage.SoundEventLogger.LogBg(op.ToString());

                    switch (op)
                    {

                        case Operation.Play:
                        case Operation.ChangeMusic:
                            PerformOperation(playerInfoId, Operation.Unmute, null, ignoreCommand); //todo is this trying to unmute before loaded???
                            //if (_runCommand(ActiveBgMusic.PlayCommand))
                            //{
                            //                Update MusicState(BgMusicState.Play);
                            //}
                            break;
                        case Operation.Pause:
                            if (_runCommand(ActiveBgMusic.PauseCommand))
                                UpdateBgMusicState(BgMusicState.Pause);
                            break;
                        case Operation.Mute:
                            Mute(new PostVolumeOp(delegate() { FadingThreadCount--; }), 0);
                            break;

                        case Operation.Stop:
                            if (ActiveBgMusic.IsWeb == false)
                            {
//.........这里部分代码省略.........
开发者ID:jlami,项目名称:mutefm,代码行数:101,代码来源:BgMusicManager.cs


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