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


C# ActionType类代码示例

本文整理汇总了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;
        }
开发者ID:royhpr,项目名称:Hypermarket-Shop-Management-Tool,代码行数:33,代码来源:AddEditStaff.cs

示例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);
     }
 }
开发者ID:haimon74,项目名称:Easy-Fixup,代码行数:13,代码来源:IPLogger.cs

示例3: IsActionAllowed

 protected override bool IsActionAllowed(ActionType type)
 {
   if (type != ActionType.Victory)
     return type == ActionType.VictoryForever;
   else
     return true;
 }
开发者ID:tanis2000,项目名称:FEZ,代码行数:7,代码来源:Victory.cs

示例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;
		}
开发者ID:RobinHood70,项目名称:wGemCombiner,代码行数:7,代码来源:Instruction.cs

示例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);
                    });
                }
            }
        }
开发者ID:johnhhm,项目名称:corefx,代码行数:36,代码来源:ParallelInvokeTest.cs

示例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;
		}
开发者ID:Chazn2,项目名称:wGemCombiner,代码行数:31,代码来源:Instruction.cs

示例7: AddEditProduct

 public AddEditProduct(ref DataTable productList)
 {
     InitializeComponent();
     lblProductID.Text = mainController.GenerateNextAvailableProductID();
     currentProductList = productList;
     currentAction = ActionType.Add;
 }
开发者ID:royhpr,项目名称:HyperMartHQManagementTool,代码行数:7,代码来源:AddEditProduct.cs

示例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);
				}
			}
		}
	}
开发者ID:liuhanxu,项目名称:Descendant,代码行数:27,代码来源:Ancestor.cs

示例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;
 }
开发者ID:sentonnes,项目名称:RTS-Framework,代码行数:13,代码来源:Action.cs

示例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;
 }
开发者ID:somebody1234,项目名称:BFCalc,代码行数:7,代码来源:Ai.cs

示例11: IsActionAllowed

 protected override bool IsActionAllowed(ActionType type)
 {
   if (type != ActionType.TurnAwayFromBell && type != ActionType.HitBell)
     return type == ActionType.TurnToBell;
   else
     return true;
 }
开发者ID:Zeludon,项目名称:FEZ,代码行数:7,代码来源:BellActions.cs

示例12: AddEditStock

 public AddEditStock(DataTable product, DataTable stock)
 {
     InitializeComponent();
     productTable = product;
     stockTable = stock;
     currentAction = ActionType.Add;
 }
开发者ID:royhpr,项目名称:Hypermarket-Shop-Management-Tool,代码行数:7,代码来源:AddEditStock.cs

示例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();
        }
开发者ID:Shkorodenok,项目名称:Articles,代码行数:35,代码来源:TransactionHelper.cs

示例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);
        }
开发者ID:Shkorodenok,项目名称:Articles,代码行数:27,代码来源:TransactionHelper.cs

示例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);
        }
开发者ID:erpframework,项目名称:FileSync,代码行数:13,代码来源:ActionException.cs


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