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


C# Action.ToString方法代码示例

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


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

示例1: isAuthorized

	/**
	 * {@inheritDoc}
	 */
    //public override bool isAuthorized(clientApplication clientApplication, Action Action, Context Context) {
	public bool isAuthorized(ClientApplication clientApplication, Action Action, Context Context) {
		bool authorized = false;

		//if (clientApplication != null && Action != null && Action.ToString() != null && Action.ToString().Trim().Length() > 0) {
        if (clientApplication != null && Action != null && Action.ToString() != null && Action.ToString().Trim().Length > 0) {
			foreach (Role role in clientApplication.getRoles()) {
				
				//simple check to make sure that 
				//the value of the action matches the value of one of the roles (exact match)
				if (role != null && role.ToString() != null && 
						role.ToString().Equals(Action.ToString())) {
					authorized = true; 
					break;
				}
			}
		}
		
		return authorized;
	}
开发者ID:Borealix,项目名称:AppSensor2.NET,代码行数:23,代码来源:ReferenceAccessController.cs

示例2: addListener

    public static void addListener(Action<object> action, string messageName)
    {
        if(action == null || messageName == null) return;

        BroadcastListener bl = new BroadcastListener();
        bl.action = action;
        bl.messageName = messageName;
        bl.shouldRemove = false;
        broadcastListeners.Add(bl);
        Debug.Log("Listener added for message: " + messageName + " " + action.ToString());
    }
开发者ID:ericartjohnson,项目名称:climber,代码行数:11,代码来源:BroadcastCenter.cs

示例3: TrackEvent

        public static void TrackEvent(Source e, Action action, string label)
        {
            try
            {
                // Terminology borrowed from GA

                // string javaScriptTrack = "_gaq.push(['_trackEvent', '" + e.ToString() + "', '" + action.ToString() + "', '" + label + "']);";
                string javaScriptTrack = "trackEvent('" + e.ToString() + "','" + action.ToString() + "','" + label + "')";
                object returnObject = HtmlPage.Window.Eval(javaScriptTrack);
            }
            catch { }
        }
开发者ID:nmahoney,项目名称:neilmahoneyphotographyVS,代码行数:12,代码来源:Analytics.cs

示例4: ChooseAction

        public async void ChooseAction(Action action)
        {
            infoPanelVM.AddLineToActionLog(Round.CurrentPlayer.name + ": " + action.ToString());
            Round.BiddingDoAction(action);
            while (Round.InBiddingPhase && Round.CurrentPlayer != gameManager.HumanPlayer)
                await AsyncBidAI();

            if (!Round.InBiddingPhase)
            {
                EndBiddingRound();
                CurrentGameState = GameState.PLAYING;
            }
            NotifyUI();
        }
开发者ID:Bawaw,项目名称:Whist,代码行数:14,代码来源:MainViewModel.cs

示例5: Do

        public void Do(Action act, bool select = false)
        {
            if (act.cancel)
                return;

            //First do the action. Only the *new* action
            act.SetEdControl(EdControl);
            act.Redo();
    
            if(select)
                act.AfterAction();
            
            EdControl.mode.Refresh();
            
            //Then save the done action. Merge with previous actions if needed.
            //Determine if the actions should be merged
            if (merge && UActions.Count > 0 && UActions.Peek().CanMerge(act))
                UActions.Peek().Merge(act);
            else
            {
                UActions.Push(act);
                ToolStripMenuItem item = new ToolStripMenuItem(act.ToString());
                item.MouseEnter += new EventHandler(updateActCount);
                item.Click += new EventHandler(onUndoActions);
                undo.DropDownItems.Insert(0, item);
            }

            //Clear the redo buffer because we just did a new action.
            if (redo.DropDownItems.Count > 0) {
                redo.DropDownItems.Clear();
                RActions.Clear();
            }

            //Always after doing an action.
            EdControl.repaint();
            EdControl.GiveFocus();

            //Now set some flags.
            undo.Enabled = true;
            redo.Enabled = false;

            merge = true;
            dirty = true;
        }
开发者ID:elfinlazz,项目名称:NSMB-Editor,代码行数:44,代码来源:UndoManager.cs

示例6: agentActed

	public void agentActed(IAgent agent, Action action,
			EnvironmentState resultingState) {
		System.Console.WriteLine("Agent acted: " + action.ToString());
	}
开发者ID:PaulMineau,项目名称:AIMA.Net,代码行数:4,代码来源:SimpleEnvironmentView.cs

示例7: Relationship

 /// <summary>
 /// Modify the relationship between the current user and the target user.
 /// <para><c>Requires Authentication:</c> True
 /// </para><para><c>Required scope:</c> relationships
 /// </para>
 /// </summary>
 /// <param name="userId">The user id about which to get relationship information.</param>
 /// <param name="action">One of Action enum.</param>
 /// <returns>RelationshipResponse</returns>
 public Task<RelationshipResponse> Relationship(long userId, Action action)
 {
     var request = Request("{id}/relationship", HttpMethod.Post);
     request.AddUrlSegment("id", userId.ToString());
     request.Content = new FormUrlEncodedContent(new List<KeyValuePair<string, string>>
     {
         new KeyValuePair<string, string>("action", action.ToString().ToLower())
     });
     return Client.ExecuteAsync<RelationshipResponse>(request);
 }
开发者ID:csa7mdm,项目名称:InstaSharp,代码行数:19,代码来源:Relationships.cs

示例8: Change

	public void Change(Action a)
	{
		CurrentAction = a;
		anim.Play(a.ToString());
	}
开发者ID:hidetobara,项目名称:PhotonMeetsZRN,代码行数:5,代码来源:IdleChanger.cs

示例9: Relationship

 /// <summary>
 /// Modify the relationship between the current user and the target user.
 /// <para>
 /// <c>Requires Authentication:</c> True
 /// </para>
 /// <para>
 /// <c>Required scope:</c> relationships
 /// </para>
 /// </summary>
 /// <param name="userId">The user id about which to get relationship information.</param>
 /// <param name="action">One of Action enum.</param>
 public Task<RelationshipResponse> Relationship(int userId, Action action)
 {
     var request = base.Request(string.Format("{0}/relationship", userId.ToString()), HttpMethod.Post);
     request.Content = new FormUrlEncodedContent(new List<KeyValuePair<string, string>>() { new KeyValuePair<string, string>("action", action.ToString().ToLower()) });
     return base.Client.ExecuteAsync<RelationshipResponse>(request);
 }
开发者ID:2RoN4eG,项目名称:InstaSharp,代码行数:17,代码来源:Relationships.cs

示例10: TrackAction

 /// <summary>
 /// Add an action into the tracking list
 /// </summary>
 public static void TrackAction(Action action)
 {
     if(isTrackingStarted && !isTrackingPuased)
     {
         //update end time
         action.EndTime = timeFromStart;
         actions.Enqueue (action);
         Debug.Log(string.Format("New Tracking Action ({0}) Added on {1}s!",action.ToString(),timeFromStart));
     }
 }
开发者ID:itruginski,项目名称:Passive-spatial-learning-task,代码行数:13,代码来源:ActionTracker.cs

示例11: activeAction

        /// <summary>
        /// the active player folds, checks, calls, bets, raises with this function
        /// </summary>
        /// <param name="pa"> the action which the player can do</param>
        /// <param name="amount">absolut amount(fold - 0; check - 0)</param>
        public void activeAction(Action.playerAction pa, int amount)
        {
            log.Debug("activeAction(Action.playerAction "+ pa.ToString() +",int " + amount + ") - Begin");
            switch (pa)
            {
                case Action.playerAction.fold:
                    activePlayer.isActive = false;
                    activePlayer.totalInPot += activePlayer.inPot;
                    activePlayer.inPot = 0;
                    activePlayer.cards = new List<Card>();
                    break;

                case Action.playerAction.check:

                    break;
                case Action.playerAction.call:
                    pot.raisePot(activePlayer, amount);
                    activePlayer.action(amount);
                    break;
                case Action.playerAction.bet:
                    pot.amountPerPlayer = amount + activePlayer.inPot;
                    pot.raisePot(activePlayer, amount);
                    activePlayer.action(amount);
                    pot.raiseSize = amount;
                    break;
                case Action.playerAction.raise:
                    pot.raiseSize = amount - pot.amountPerPlayer + activePlayer.inPot;
                    if (pot.sidePot == null)
                    {
                        pot.amountPerPlayer = amount + activePlayer.inPot;
                    }
                    else
                    {
                        pot.amountPerPlayer = amount + activePlayer.inPot - pot.sidePot.amountPerPlayer;
                    }
                    pot.raisePot(activePlayer,  amount);
                    activePlayer.action(amount);
                    break;
            }
            Logger.action(this, activePlayer, pa, amount, this.board);
            activePlayer.hasChecked = true;
            log.Debug("activeAction() - End");
        }
开发者ID:B3J4y,项目名称:Poker,代码行数:48,代码来源:Game.cs

示例12: GetDialogUrl

    /// <summary>
    /// Returns Correct URL of the copy or move dialog.
    /// </summary>
    /// <param name="nodeId">ID Of the node to be copied or moved</param>
    /// <param name="CurrentAction">Action which should be performed</param>
    private string GetDialogUrl(int nodeId, Action CurrentAction)
    {
        Config.CustomFormatCode = CurrentAction.ToString().ToLower();

        string url = CMSDialogHelper.GetDialogUrl(Config, false, false, null, false);

        url = URLHelper.RemoveParameterFromUrl(url, "hash");
        url = URLHelper.AddParameterToUrl(url, "sourcenodeids", nodeId.ToString());
        url = URLHelper.AddParameterToUrl(url, "hash", QueryHelper.GetHash(url));
        url = URLHelper.EncodeQueryString(url);

        return url;
    }
开发者ID:puentepr,项目名称:kentico-site-example,代码行数:18,代码来源:ContentMenu.ascx.cs

示例13: UnregisterEventListener

	internal void UnregisterEventListener(object aListener, Action<EventObject> aMethod = null)
	{
	    int index = 0;
	    bool eventRemoved = false;

	    while (!eventRemoved)
	    {
	        if (index >= _listenerList.Count)
	        {
	            break;
	        }

	        ListenerObject listener = _listenerList[index];
	        if ((listener.ObjectReference.Equals(aListener) && aMethod != null && listener.Callback.Equals(aMethod)) ||
	            (listener.ObjectReference.Equals(aListener) && aMethod == null))
	        {
	            UnregisterEventListenerObject(listener);
	            eventRemoved = true;
	        }
	        else
	        {
	            if (listener.IsAlive)
	            {
	                index++;
	            }
	            else
	            {
	                UnregisterEventListenerObject(listener);
	            }
	        }
	    }

	    if (!eventRemoved)
	    {
	        string prefix = "";
	        if (aMethod != null)
	        {
	            prefix += "The method [" + aMethod.ToString() + "] from ";
	        }
	        Debug.LogWarning("[EventObject.cs] - UnregisterEventListener() - " + prefix + aListener.ToString() + "] doesn't seem to be registered for the event: " + _event + ".");
	    }

	    if (_listenerList.Count <= 0)
	    {
	        Destroy();
	    }
	}
开发者ID:gcoope,项目名称:UnityEventDispatcher,代码行数:47,代码来源:EventObject.cs


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