• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# ActionType类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中ActionType的典型用法代码示例。如果您正苦于以下问题:C# ActionType类的具体用法?C# ActionType怎么用?C# ActionType使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



ActionType类属于命名空间,在下文中一共展示了ActionType类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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


示例16: FeatureAction

		public FeatureAction (XPathNavigator nav)
		{
			string val = Helpers.GetRequiredNonEmptyAttribute (nav, "type");
			type = Helpers.ConvertEnum <ActionType> (val, "type");

			val = Helpers.GetRequiredNonEmptyAttribute (nav, "when");
			when = Helpers.ConvertEnum <ActionWhen> (val, "when");

			XPathNodeIterator iter;
			StringBuilder sb = new StringBuilder ();
			
			switch (type) {
				case ActionType.Message:
				case ActionType.ShellScript:
					iter = nav.Select ("./text()");
					while (iter.MoveNext ())
						sb.Append (iter.Current.Value);
					if (type == ActionType.Message)
						message = sb.ToString ();
					else
						script = sb.ToString ();
					break;
					
				case ActionType.Exec:
					command = Helpers.GetRequiredNonEmptyAttribute (nav, "command");
					commandArguments = Helpers.GetOptionalAttribute (nav, "commndArguments");
					break;
			}
		}
开发者ID:nobled,项目名称:mono,代码行数:29,代码来源:FeatureAction.cs


示例17: AddAction

        public void AddAction(string playerA, string playerB, ActionType actionType, ModifierType modifyer, Weapon weapon, WhereType where, ArmyType teamA, ArmyType teamB)
        {
            Player playerGet = getPlayer(playerA, teamA);
            Player playerDo = null;
            
            //damage from the world (harrier, falling) will not be considered in this version
            if (playerB == string.Empty)
            {
                playerDo = playerGet;
            } else
            {
                playerDo = getPlayer(playerB, teamB);
            }

            switch (actionType)
            {
                case ActionType.Kill:
                    playerGet.AddAction(playerDo, ActionType.Die, modifyer, weapon, where);
                    playerDo.AddAction(playerGet, ActionType.Kill, modifyer, weapon, where);
                    break;
                case ActionType.Damage:
                    playerGet.AddAction(playerDo, ActionType.Damage, modifyer, weapon, where);
                    playerDo.AddAction(playerGet, ActionType.Damage, modifyer, weapon, where);
                    break;
            }
        }
开发者ID:gustavobello,项目名称:CarameloNoCocao-2.0,代码行数:26,代码来源:Game.cs


示例18: GameState

 public GameState(Dictionary<int, Entity> entities, ActionType type)
 {
     AllEntities = entities;
     Type = type;
     Player1 = new Player(entities, 1);
     Player2 = new Player(entities, 2);
 }
开发者ID:bhabanism,项目名称:HSReplay,代码行数:7,代码来源:GameState.cs


示例19: DefaultStayInLaneBehavior

        /// <summary>
        /// Gets a default behavior for a path segment
        /// </summary>
        /// <param name="location"></param>
        /// <param name="vehicleState"></param>
        /// <param name="exit"></param>
        /// <param name="relative"></param>
        /// <param name="stopSpeed"></param>
        /// <param name="aMax"></param>
        /// <param name="dt">timestep in seconds</param>
        /// <returns></returns>
        public static PathFollowingBehavior DefaultStayInLaneBehavior(RndfLocation location, VehicleState vehicleState, 
            RndfWaypointID action, ActionType actionType, bool relative, double stopSpeed, double aMax, double dt,
            double maxSpeed, IPath path)
        {
            // get lane path
            //IPath path = RoadToolkit.LanePath(location.Partition.FinalWaypoint.Lane, vehicleState, relative);

            // check if the action is just a goal (note that exit and stop take precedence)
            if (actionType == ActionType.Goal)
            {
                // get maximum speed
                //double maxSpeed = location.Partition.FinalWaypoint.Lane.Way.Segment.SpeedInformation.MaxSpeed;
                //double maxSpeed = maxV;

                // generate path following behavior
                //return new PathFollowingBehavior(path, new ScalarSpeedCommand(maxSpeed));
                return null;
            }
            else
            {
                // get maximum speed
                //double maxSpeed = location.Partition.FinalWaypoint.Lane.Way.Segment.SpeedInformation.MaxSpeed;

                // get operational required distance to hand over to operational stop
                double distance = RoadToolkit.DistanceUntilOperationalStop(RoadToolkit.DistanceToWaypoint(location, action)-TahoeParams.FL);

                // get desired velocity
                double desiredSpeed = RoadToolkit.InferFinalSpeed(0, stopSpeed, distance, maxSpeed, aMax, dt);

                // generate path following behavior
                //return new PathFollowingBehavior(path, new ScalarSpeedCommand(desiredSpeed));
                return null;
            }
        }
开发者ID:anand-ajmera,项目名称:cornell-urban-challenge,代码行数:45,代码来源:RoadToolkit.cs


示例20: PlayerAction

 public PlayerAction(Player player, Point targetPoint, ActionType actionType)
 {
     AffectedPlayer = player;
     this.TargetPoint = targetPoint;
     WayToTarget = new Queue<Point>();
     Type = actionType;
 }
开发者ID:Jecral,项目名称:Football,代码行数:7,代码来源:PlayerAction.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# ActionableProgress类代码示例发布时间:2022-05-24
下一篇:
C# ActionState类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap