本文整理汇总了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;
}
示例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());
}
示例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 { }
}
示例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();
}
示例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;
}
示例6: agentActed
public void agentActed(IAgent agent, Action action,
EnvironmentState resultingState) {
System.Console.WriteLine("Agent acted: " + action.ToString());
}
示例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);
}
示例8: Change
public void Change(Action a)
{
CurrentAction = a;
anim.Play(a.ToString());
}
示例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);
}
示例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));
}
}
示例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");
}
示例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;
}
示例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();
}
}