本文整理汇总了C#中Actions类的典型用法代码示例。如果您正苦于以下问题:C# Actions类的具体用法?C# Actions怎么用?C# Actions使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Actions类属于命名空间,在下文中一共展示了Actions类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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);
}
开发者ID:shadowmint,项目名称:unity-n-events,代码行数:29,代码来源:ActionsTests.cs
示例2: Unit
public Unit(int x, int y, int health)
: base(x, y)
{
this.action = Actions.None;
this.nextAction = Actions.None;
this.speed = 3;
}
开发者ID:Quaade,项目名称:SurvivalGame,代码行数:7,代码来源:Unit.cs
示例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;
}
开发者ID:angelcdz,项目名称:Sirius,代码行数:31,代码来源:Actions.cs
示例4: SetVisuals
void SetVisuals(Actions state)
{
string actionName = actionMap[currentState];
foreach(Transform child in transform) {
child.gameObject.SetActive(child.name == actionName);
}
}
开发者ID:RobKopp,项目名称:JumpDuck,代码行数:7,代码来源:DuckController.cs
示例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()
}
开发者ID:marijnkampf,项目名称:Random-Photo-Screensaver,代码行数:25,代码来源:RPS.cs
示例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;
}
开发者ID:dorofeev-serdg,项目名称:Xamarin,代码行数:13,代码来源:Calc.cs
示例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;
}
开发者ID:zaully,项目名称:guokrkill,代码行数:29,代码来源:Actions.cs
示例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;
}
开发者ID:srinath87,项目名称:AegonsField,代码行数:10,代码来源:Action.cs
示例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();
}
开发者ID:kylelin47,项目名称:virtual-reality,代码行数:25,代码来源:CharacterPanel.cs
示例10: Event
public Event(Triggers trigger, Actions action, string action_data = "")
{
Trigger = trigger;
Action = action;
ActionData = action_data;
Active = false;
}
开发者ID:Shard,项目名称:Blueprint-Client,代码行数:7,代码来源:Event.cs
示例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);
}
开发者ID:PushkinTyt,项目名称:Chat,代码行数:7,代码来源:MetaData.cs
示例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;
}
开发者ID:terryjintry,项目名称:OLSource1,代码行数:30,代码来源:ca1045--do-not-pass-types-by-reference_1.cs
示例13: DownloadForm
public DownloadForm(Dictionary<string, string> files, Actions action)
{
InitializeComponent();
this.files = files;
this.action = action;
numFiles = files.Count;
}
开发者ID:joe-williams-cccu,项目名称:OSIRTv2,代码行数:7,代码来源:DownloadForm.cs
示例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;
}
开发者ID:olafbauer,项目名称:TicTacToe,代码行数:8,代码来源:Player.cs
示例15: InputDate
public InputDate(MainDGV dgvMain, Actions action, WayBillType type)
{
InitializeComponent();
_dgvMain = dgvMain;
_action = action;
_type = type;
}
开发者ID:NextStalker,项目名称:BBAuto,代码行数:8,代码来源:InputDate.cs
示例16: setAction
public void setAction(Actions _val)
{
if (!Constant.moveEnabled) {
mAction = Actions.IDLE;
return;
}
mAction = _val;
}
开发者ID:taobingxue,项目名称:BVW,代码行数:8,代码来源:MotionController.cs
示例17: AddAction
public void AddAction(Actions action, object[] attribute)
{
_currentActions.Add(new ReverseActionValue()
{
_PerformedAction = action,
_ActionAttribute = attribute
});
}
开发者ID:lwhitelock,项目名称:CloudPanel,代码行数:8,代码来源:ReverseActions.cs
示例18: EnableAction
public void EnableAction(Actions action)
{
_service.Execute(new SetStateRequest()
{
EntityMoniker = new EntityReference(Workflow.EntityLogicalName, RetieveActionGuid(action)),
State = new OptionSetValue((int) WorkflowState.Activated),
Status = new OptionSetValue((int) ActionStatus.Activated)
});
}
开发者ID:angelcdz,项目名称:Sirius,代码行数:9,代码来源:Actions.cs
示例19: PerformAction
public void PerformAction(Actions action)
{
switch (action)
{
case Actions.StartTimer:
game.objectiveManager.Countdown(3);
break;
case Actions.ResetTimer:
game.objectiveManager.Reset();
break;
case Actions.Open:
Thread openThread = new Thread(DoOpen);
openThread.SetApartmentState(ApartmentState.STA);
openThread.Start();
break;
case Actions.Reload:
Thread reloadThread = new Thread(DoReload);
reloadThread.SetApartmentState(ApartmentState.STA);
reloadThread.Start();
break;
case Actions.Save:
Thread saveThread = new Thread(DoSave);
saveThread.SetApartmentState(ApartmentState.STA);
saveThread.Start();
break;
case Actions.PropertyEditor:
FormManager.Property.Show();
break;
case Actions.Copy:
FormManager.Property.CopySelected();
break;
case Actions.Delete:
KinectRagdollGame.pendingUpdates.Add(delegate() { FormManager.Property.DeleteSelected(); });
break;
case Actions.Freeze:
KinectRagdollGame.pendingUpdates.Add(delegate() { FormManager.Property.FreezeSelected(); });
break;
case Actions.Release:
KinectRagdollGame.pendingUpdates.Add(delegate() { FormManager.Property.UnfreezeSelected(); });
break;
case Actions.ToggleCamera:
game.ragdollManager.CameraShouldTrack = !game.ragdollManager.CameraShouldTrack;
break;
case Actions.PowerupEditor:
object[] selection = FormManager.Property.getSelectedObjects();
if (selection.Length > 0)
{
PowerupForm p = new PowerupForm();
p.Show(selection);
}
break;
case Actions.ToggleFullScreen:
game.ToggleFullscreen();
break;
}
}
开发者ID:guozanhua,项目名称:KinectRagdoll,代码行数:57,代码来源:ActionCenter.cs
示例20: Ferry
public Ferry()
{
FerryThread = new Thread(new ThreadStart(MoveFerry));
Coast = CoastEnum.WestCoast;
_ferryAction = Actions.FerryWait;
Cars = new Stack<Car>();
_timer = new Stopwatch();
_timer.Start();
}
开发者ID:kirkor93,项目名称:ProgramowanieWspolbiezne,代码行数:9,代码来源:Ferry.cs
注:本文中的Actions类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论