本文整理汇总了C#中ActionType类的典型用法代码示例。如果您正苦于以下问题:C# ActionType类的具体用法?C# ActionType怎么用?C# ActionType使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
ActionType类属于命名空间,在下文中一共展示了ActionType类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: AddEditStaff
public AddEditStaff(string name, string staffID, string email, DateTime renewPasswordDate, DateTime dateOfBirth, DateTime joinDate, string gender, string position, string contact, bool defaultPassword, bool blocked)
{
InitializeComponent();
lblStaffID.Text = staffID;
txtName.Text = name;
txtEmail.Text = email;
dtpPswExpirateDate.Value = renewPasswordDate;
dtpDoB.Value = dateOfBirth;
dtpJoinDate.Value = joinDate;
cbGender.Text = gender;
isDefaultPassword = defaultPassword;
cbGender.DropDownStyle = ComboBoxStyle.DropDown;
cbPosition.DropDownStyle = ComboBoxStyle.DropDown;
cbPosition.Text = position;
txtContact.Text = contact;
chkDefaultPsw.Checked = defaultPassword;
chkBlocked.Checked = blocked;
txtName.Enabled = false;
txtEmail.Enabled = false;
dtpPswExpirateDate.Enabled = false;
dtpDoB.Enabled = false;
dtpJoinDate.Enabled = false;
cbGender.Enabled = false;
if (defaultPassword == true)
{
chkDefaultPsw.Enabled = false;
}
currentAction = ActionType.Edit;
}
示例2: Log
/// <summary>
/// Logs the specified username.
/// </summary>
/// <param name="username">The username.</param>
/// <param name="ip">The ip.</param>
/// <param name="action">The action.</param>
public static void Log(string username, string ip, ActionType action)
{
using (SqlConnection conn = Config.DB.Open())
{
SqlHelper.GetDB().ExecuteNonQuery( "SaveIPLog", username, ip, (int) action);
}
}
示例3: IsActionAllowed
protected override bool IsActionAllowed(ActionType type)
{
if (type != ActionType.Victory)
return type == ActionType.VictoryForever;
else
return true;
}
示例4: Instruction
public Instruction(ActionType type, int from, int to)
{
// Dupe can also use the other constructors, but specifying the target via this one is prefered even though it won't affect anything in the actual combine. This is required by the CondenseSlots logic to move the final base gem when no longer needed, but is also useful for debugging.
this.Action = type;
this.From = from;
this.To = to;
}
示例5: ParallelInvokeTest
private double[] _results; // global place to store the workload results for verication
#endregion
public ParallelInvokeTest(ParallelInvokeTestParameters parameters)
{
_count = parameters.Count;
_actionType = parameters.ActionType;
_actions = new Action[_count];
_results = new double[_count];
// intialize actions
for (int i = 0; i < _count; i++)
{
int iCopy = i;
if (_actionType == ActionType.Empty)
{
_actions[i] = new Action(delegate { });
}
else if (_actionType == ActionType.EqualWorkload)
{
_actions[i] = new Action(delegate
{
_results[iCopy] = ZetaSequence(SEED);
});
}
else
{
_actions[i] = new Action(delegate
{
_results[iCopy] = ZetaSequence((iCopy + 1) * SEED);
});
}
}
}
示例6: Instruction
public Instruction(ActionType action, int from, int to)
{
if (from < 0)
{
throw new ArgumentOutOfRangeException(nameof(from), "Invalid slot in instruction.");
}
if (to < 0)
{
throw new ArgumentOutOfRangeException(nameof(to), "Invalid slot in instruction.");
}
if (action == ActionType.Upgrade)
{
if (from != to)
{
throw new ArgumentException("From and to parameters are not equal in an Upgrade instruction.");
}
}
else
{
if (from == to)
{
throw new ArgumentException("From and to parameters cannot be equal except in an Upgrade instruction.");
}
}
this.Action = action;
this.From = from;
this.To = to;
}
示例7: AddEditProduct
public AddEditProduct(ref DataTable productList)
{
InitializeComponent();
lblProductID.Text = mainController.GenerateNextAvailableProductID();
currentProductList = productList;
currentAction = ActionType.Add;
}
示例8: SetAction
public void SetAction(ActionType pendingAction)
{
Debug.Log("SET THIS ACTION: "+pendingAction);
if (!m_hasAction)
{
if(pendingAction._energyCost < _uiController._currentEnergy)
{
LockActions();
_uiController.ReduceEnergy(pendingAction._energyCost);
//No action has yet been set
m_hasAction = true;
if(pendingAction._instantApply)
{
//We have an instant action
ActivateAction(pendingAction);
}
else
{
//We have a queued action
SetQueuedAction(pendingAction);
}
}
}
}
示例9: setAction
/* Action (string actionName, Sprite actionSprite, ActionType actionType) {
Name = actionName;
Sprite = actionSprite;
Type = actionType;
Enabled = true;
}*/
public void setAction(string actionName, Sprite actionSprite, ActionType actionType)
{
Name = actionName;
Sprite = actionSprite;
Type = actionType;
Enabled = true;
}
示例10: PartyParam
[JsonConstructor] public PartyParam(string parameters,TargetParam targetparam,int targetType,ActionType type){
Parameters=
parameters.Split(new[]{','},StringSplitOptions.RemoveEmptyEntries).ToList().Select(Parse).ToArray();
TargetParam=targetparam;
TargetType=targetType;
Type=type;
}
示例11: IsActionAllowed
protected override bool IsActionAllowed(ActionType type)
{
if (type != ActionType.TurnAwayFromBell && type != ActionType.HitBell)
return type == ActionType.TurnToBell;
else
return true;
}
示例12: AddEditStock
public AddEditStock(DataTable product, DataTable stock)
{
InitializeComponent();
productTable = product;
stockTable = stock;
currentAction = ActionType.Add;
}
示例13: GetDescription
private static string GetDescription(KeyValuePair<Type, EntityType> current, ActionType type, object entity)
{
var builder = new StringBuilder();
var firstFormat = string.Format("Сущность \"{0}\"",current.Value.GetEntityTypeName());
const string idFormat = " с идентификатором \"{0}\"";
const string nameFormat = " с названием \"{0}\"";
var actionFormat = string.Format(" была {0}", type.GetActionTypeName());
if (entity != null)
{
var idProp = entity.GetType().GetProperties().FirstOrDefault(c => c.Name.ToUpper().Contains("ID"));
var nameProp = entity.GetType().GetProperties().FirstOrDefault(c => c.Name.ToUpper().Contains("NAME"));
builder.Append(firstFormat);
if (idProp != null)
{
builder.Append(string.Format(idFormat, idProp.GetValue(entity)));
}
if (nameProp != null)
{
builder.Append(string.Format(nameFormat, nameProp.GetValue(entity)));
}
builder.Append(actionFormat);
}
if (type == ActionType.Export || type == ActionType.Import)
{
builder.Append(type.GetActionTypeName());
}
return builder.ToString();
}
示例14: AddTransaction
public static void AddTransaction(DbContext context, ActionType type, object entity)
{
var currentData = entity.GetEnityType();
var description = GetDescription(currentData, type, entity);
int entityId = -1;
var entityIdProp = entity == null ? null : entity.GetType().GetProperties().FirstOrDefault(c => c.Name.ToUpper().Contains("ID"));
if (entityIdProp != null)
{
entityId = entityIdProp.GetValue(entity).MaybeAs<int>().GetOrDefault(-1);
if (entityId == -1)
{
var guid = entityIdProp.GetValue(entity).MaybeAs<Guid>().GetOrDefault(default(Guid));
entityId = guid == default(Guid) ? -1 : guid.GetHashCode();
}
}
var tLog = new TransactionLog
{
ActionDateTime = DateTime.Now,
ActionType = type,
EntityType = currentData.Value,
Description = description,
EntityId = entityId
};
context.Set<TransactionLog>().Add(tLog);
}
示例15: ActionException
/// <summary>
/// Creates new action exception.
/// </summary>
/// <param name="message">the message, as in ordinary exception</param>
/// <param name="actionType">type of the action that caused the exception</param>
/// <param name="innerException">exception that was catched to throw this one</param>
public ActionException(string message, ActionType actionType, MemeType? memeType
= MemeType.AreYouFuckingKiddingMe, Exception innerException = null)
: base(SHOW_EXCEPTION_DETAILS ? GetExtendedMessage(message, innerException) :
GetTypicalMessage(message, innerException), innerException)
{
SetInitialValues(message, actionType, memeType);
}