本文整理汇总了C#中Actions类的典型用法代码示例。如果您正苦于以下问题:C# Actions类的具体用法?C# Actions怎么用?C# Actions使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
Actions类属于命名空间,在下文中一共展示了Actions类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: test_wait_for_specific_action
public void test_wait_for_specific_action()
{
var timer = new Timer();
var instance = new Actions(timer);
var complete = false;
var count = 0;
// Run an action which doesn't resolved immediately
var task = new DeferredAction();
instance.Execute(task, (ep) =>
{
count += 1;
complete = true;
});
Assert(complete == false);
// Run some other action
// Notice how all ActionCompleteEvents are skipped until the matching action.
instance.Execute<SimpleAction>();
instance.Execute<SimpleAction>();
instance.Execute<SimpleAction>();
Assert(count == 0);
Assert(complete == false);
// Now we fake the deferred completion, and correctly catch it
task.Complete();
Assert(count == 1);
Assert(complete == true);
}
示例2: Unit
public Unit(int x, int y, int health)
: base(x, y)
{
this.action = Actions.None;
this.nextAction = Actions.None;
this.speed = 3;
}
示例3: RetieveActionGuid
internal Guid RetieveActionGuid(Actions action)
{
Guid returnValue = Guid.Empty;
switch (action)
{
case Actions.PrSvDisableProductAc:
returnValue = new Guid("9d3eb947-466d-49aa-8a5f-bcb4593e402e");
break;
case Actions.PrSvDisableServiceAc:
returnValue = new Guid("aa7fa958-dc74-463d-9ab9-341b8c3e04b2");
break;
case Actions.PrSvEnableServiceAc:
returnValue = new Guid("43902389-9bb9-4a78-8814-4db50222a6aa");
break;
case Actions.PrSvDisableTypedSaleAc:
returnValue = new Guid("7fc35b44-cab8-44fb-97b4-c95fa3afc23c");
break;
case Actions.PrSvEnableTypedSaleAc:
returnValue = new Guid("81a13984-a7c4-4d90-b043-cd98930373bd");
break;
case Actions.PrSvRateChengNegotiationRequestAc:
returnValue = new Guid("94d5a751-0094-4268-bf49-d2129d60ceb5");
break;
case Actions.PrSvRequestLicenseAnalysisAc:
returnValue = new Guid("e34c98e3-5eca-44f5-a4b9-25c1e2815e32");
break;
}
return returnValue;
}
示例4: SetVisuals
void SetVisuals(Actions state)
{
string actionName = actionMap[currentState];
foreach(Transform child in transform) {
child.gameObject.SetActive(child.name == actionName);
}
}
示例5: Screensaver
private Screensaver(Actions action, bool readOnly, IntPtr[] hwnds) {
#if (DEBUG)
this.debugLog = new List<string>();
#endif
this.version = new Version(Application.ProductVersion);
this.readOnly = readOnly;
this.action = action;
this.hwnds = hwnds;
this.config = new Config(this);
this.config.PreviewKeyDown += new System.Windows.Forms.PreviewKeyDownEventHandler(this.PreviewKeyDown);
this.config.browser.PreviewKeyDown += new System.Windows.Forms.PreviewKeyDownEventHandler(this.PreviewKeyDown);
this.config.browser.Navigate(new Uri(Constants.getDataFolder(Constants.ConfigHtmlFile)));
this.config.browser.DocumentCompleted += new System.Windows.Forms.WebBrowserDocumentCompletedEventHandler(this.config.ConfigDocumentCompleted);
if (this.action == Actions.Config) this.config.Show();
else {
if (this.action != Actions.Wallpaper) {
this.mouseMoveTimer = new System.Windows.Forms.Timer();
this.mouseMoveTimer.Interval = 1500;
this.mouseMoveTimer.Tick += mouseMoveTimer_Tick;
}
}
// Wait for config document to load to complete initialisation: Config.ConfigDocumentCompleted()
}
示例6: Calc
private double result; // variable to contain the result of calculation
#endregion Fields
#region Constructors
public Calc()
{
result = 0.0;
argument = 0.0;
dotFlag = -1; // -1 means than no decimal part is used
action = Actions.Unknown;
}
示例7: initialization
public static List<Actions> initialization(List<string> strLstActions, Status thisStat)
{
List<Character> chaLstCharacters = thisStat.chaLstCharacter;
List<Spell> splLstAll = thisStat.splLstSpell;
List<Actions> actLstResult = new List<Actions>();
Regex rgSource = new Regex("{.*}");
Regex rgSpell = new Regex("\\[\\[.*\\]\\]");
Regex rgDestination = new Regex("->.*<-");
string strTmp = "";
for (int i = 0; i < strLstActions.Count; i++)
{
Actions actionItem = new Actions();
strTmp = rgSource.Match(strLstActions[i]).ToString();
strTmp = strTmp.Replace("{", "");
actionItem.strCharacterName = strTmp.Replace("}", "");
strTmp = rgSpell.Match(strLstActions[i]).ToString();
strTmp = strTmp.Replace("[[", "");
actionItem.strSpellName = strTmp.Replace("]]", "");
strTmp = rgDestination.Match(strLstActions[i]).ToString();
strTmp = strTmp.Replace("->", "");
actionItem.intCharacter = Character.findIndexForCharacter(actionItem.strCharacterName, chaLstCharacters);
strTmp = strTmp.Replace("<-", "");
actionItem.intDestination = Character.findIndexForCharacter(strTmp, chaLstCharacters);
actionItem.intResult = 0;
actionItem.intTargetAvailable = Spell.isSpellTargetFixed(actionItem.strSpellName, splLstAll);
actLstResult.Add(actionItem);
}
return actLstResult;
}
示例8: Init
/**
* Overload for Attack Action
*/
public void Init(int type, int attackerId, int targetId)
{
actionType = (Actions)type;
Debug.Log(actionType.ToString());
this.unitId = attackerId;
this.targetId = targetId;
}
示例9: Initialize
void Initialize () {
actions = character.GetComponent<Actions> ();
controller = character.GetComponent<PlayerController> ();
foreach (PlayerController.Arsenal a in controller.arsenal)
CreateWeaponButton(a.name);
CreateActionButton("Stay");
CreateActionButton("Walk");
CreateActionButton("Run");
CreateActionButton("Sitting");
CreateActionButton("Jump");
CreateActionButton("Aiming");
CreateActionButton("Attack");
CreateActionButton("Damage");
CreateActionButton("Death Reset", "Death");
cameras = GameObject.FindObjectsOfType<Camera> ();
var sort = from s in cameras orderby s.name select s;
foreach (Camera c in sort)
CreateCameraButton(c);
camerasPanel.GetChild (0).GetComponent<Button>().onClick.Invoke();
}
示例10: Event
public Event(Triggers trigger, Actions action, string action_data = "")
{
Trigger = trigger;
Action = action;
ActionData = action_data;
Active = false;
}
示例11: MetaData
public MetaData(Roles role, Actions action, ContentTypes contentType, string message)
{
this.role = role;
this.action = action;
this.contentType = contentType;
messageSize = encoding.GetByteCount(message);
}
示例12: ReplyInformation
// Violates rule: DoNotPassTypesByReference.
public static bool ReplyInformation(TypeOfFeedback input,
out string reply, ref Actions action)
{
bool returnReply = false;
string replyText = "Your feedback has been forwarded " +
"to the product manager.";
reply = String.Empty;
switch (input)
{
case TypeOfFeedback.Complaint:
case TypeOfFeedback.Praise :
action = Actions.ForwardToManagement;
reply = "Thank you. " + replyText;
returnReply = true;
break;
case TypeOfFeedback.Suggestion:
action = Actions.ForwardToDeveloper;
reply = replyText;
returnReply = true;
break;
case TypeOfFeedback.Incomprehensible:
default:
action = Actions.Discard;
returnReply = false;
break;
}
return returnReply;
}
示例13: DownloadForm
public DownloadForm(Dictionary<string, string> files, Actions action)
{
InitializeComponent();
this.files = files;
this.action = action;
numFiles = files.Count;
}
示例14: Player
public Player(Player p, Actions Action = Actions.Play)
{
this.Name = p.Name;
this.Moves = p.Moves;
this.Sign = p.Sign;
this.NextMove = p.NextMove;
this.Action = Action;
}
示例15: InputDate
public InputDate(MainDGV dgvMain, Actions action, WayBillType type)
{
InitializeComponent();
_dgvMain = dgvMain;
_action = action;
_type = type;
}