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


C# Action.GetType方法代码示例

本文整理汇总了C#中Action.GetType方法的典型用法代码示例。如果您正苦于以下问题:C# Action.GetType方法的具体用法?C# Action.GetType怎么用?C# Action.GetType使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Action的用法示例。


在下文中一共展示了Action.GetType方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: remove

 public Action remove(Action action)
 {
     Action toRemove = action;
     //actions.Remove(action);
     actions.RemoveAll(x => x.GetType() == action.GetType());
     return toRemove;
 }
开发者ID:jpfeltracco,项目名称:DreamStateMachine,代码行数:7,代码来源:ActionList.cs

示例2: FromAction

        internal static CfAction FromAction(Action source)
        {
            if (source == null)
            {
                return null;
            }

            CfAction item = null;
            if (source.GetType() == typeof(Text))
            {
                item = TextMapper.FromText((Text)source);
            }
            else if (source.GetType() == typeof(Call))
            {
                item = CallMapper.FromCall((Call)source);
            }
            return item;
        }
开发者ID:vladimir-mhl,项目名称:CallFire-CSharp-SDK,代码行数:18,代码来源:ActionMapper.cs

示例3: CopyProperties

 protected override void CopyProperties(Action sourceAction)
 {
     if (sourceAction.GetType() == base.GetType())
     {
         base.CopyProperties(sourceAction);
         ClassId = ((ComHandlerAction)sourceAction).ClassId;
         Data = ((ComHandlerAction)sourceAction).Data;
     }
 }
开发者ID:BclEx,项目名称:AdamsyncEx,代码行数:9,代码来源:ComHandlerAction.cs

示例4: has

 public bool has(Action action)
 {
     //Console.WriteLine(action.GetType());
     //Console.WriteLine("Num actions in has:" + actions.Count);
     if (actions.Count > 0)
     {
         for (int i = 0; i < actions.Count; i++)
         {
             Action curAction = actions.ElementAt(i);
             //Console.WriteLine(curAction.GetType());
             if (curAction.GetType().Equals(action.GetType()))
             {
                 //Console.WriteLine("this worked");
                 return true;
             }
         }
         return false;
     }
     else
     {
         return false;
     }
 }
开发者ID:jpfeltracco,项目名称:DreamStateMachine,代码行数:23,代码来源:ActionList.cs

示例5: addAction

    public void addAction(Action a)
    {
       
        if (actions.Count > 0)
        {
          
            Action current = actions[0];
            int pr = current.getPriority();
            
            if (a.GetType() == typeof(Attack)) //remove all attack actions ( new is better)
            {
               
                    actions.RemoveAll((x) => x.getPriority() == pr); // has same priority as currently playing
                

            }
           
        }
        actions.Add(a);
        sortActions();

       
       
    }
开发者ID:DannyBoyThomas,项目名称:Project-Z,代码行数:24,代码来源:ActionHandler.cs

示例6: Copy

        public void Copy(Action obj)
        {
            if (obj == null)
                return;

            // copy all of the properties
            foreach (PropertyInfo pi in obj.GetType().GetProperties())
            {
                // get the value of the property
                var val = pi.GetValue(obj, null);
                pi.SetValue(this, val, null);
            }
        }
开发者ID:ogazitt,项目名称:TaskStore,代码行数:13,代码来源:Action.cs

示例7: CopyProperties

 /// <summary>
 ///     Copies the properties from another <see cref="Action" /> the current instance.
 /// </summary>
 /// <param name="sourceAction">
 ///     The source <see cref="Action" /> .
 /// </param>
 protected override void CopyProperties(Action sourceAction) {
     if (sourceAction.GetType() == GetType()) {
         base.CopyProperties(sourceAction);
         Title = ((ShowMessageAction)sourceAction).Title;
         MessageBody = ((ShowMessageAction)sourceAction).MessageBody;
     }
 }
开发者ID:roomaroo,项目名称:coapp.powershell,代码行数:13,代码来源:Action.cs

示例8: CheckType

 private static bool CheckType(Action<string> a)
 {
     return a.GetType() == typeof(Action<object>);
 }
开发者ID:CheneyWu,项目名称:coreclr,代码行数:4,代码来源:sealedCastVariance.cs

示例9: GetActionTypeIndex

 /**
  * <summary>Gets the index number of an Action within EnabledActions.</summary>
  * <param name = "_action">The Action to search for</param>
  * <returns>The index number of the Action within EnabledActions</returns>
  */
 public int GetActionTypeIndex(Action _action)
 {
     string className = _action.GetType ().ToString ();
     className = className.Replace ("AC.", "");
     foreach (ActionType actionType in EnabledActions)
     {
         if (actionType.fileName == className)
         {
             return EnabledActions.IndexOf (actionType);
         }
     }
     return defaultClass;
 }
开发者ID:WastNotWantNot,项目名称:WasteNotWantNot,代码行数:18,代码来源:ActionsManager.cs

示例10: IsTypeOf

 /// <summary>
 /// Determines whether this instance is type of the specified action.
 /// A test to see if this action is the same as another action. Remember
 /// that they don't have to have the same type to be of the same type. 
 /// Consider the "Manage" action which covers ALL actions. 
 /// </summary>
 /// <returns><c>true</c> if this instance is same as the specified action; otherwise, <c>false</c>.</returns>
 /// <param name="action">The action</param>
 public virtual bool IsTypeOf(Action action)
 {
     return this.GetType() == action.GetType();
 }
开发者ID:pcresswell,项目名称:authorize,代码行数:12,代码来源:Action.cs

示例11: GetActionSubCategory

        /**
         * <summary>Gets the index of an Action within a list of all Actions that share it's category.</summary>
         * <param name = "_action">The Action to get the index of</param>
         * <returns>The index of the Action within a list of all Actions that share it's category</returns>
         */
        public int GetActionSubCategory(Action _action)
        {
            string fileName = _action.GetType ().ToString ().Replace ("AC.", "");
            ActionCategory _category = _action.category;

            // Learn category
            foreach (ActionType type in EnabledActions)
            {
                if (type.fileName == fileName)
                {
                    _category = type.category;
                }
            }

            // Learn subcategory
            int i=0;
            foreach (ActionType type in EnabledActions)
            {
                if (type.category == _category)
                {
                    if (type.fileName == fileName)
                    {
                        return i;
                    }
                    i++;
                }
            }

            ACDebug.LogWarning ("Error building Action " + _action);
            return 0;
        }
开发者ID:WastNotWantNot,项目名称:WasteNotWantNot,代码行数:36,代码来源:ActionsManager.cs

示例12: SetAction

 public void SetAction( Action action, string mode)
 {
     string actionType = action.GetType().Name;
     string name;
     switch(mode)
     {
         case "enter":
             name = GetUniqueKey( actionType, _enter );
             _enter.Add( name, action );
             break;
         case "step":
             name = GetUniqueKey( actionType, _step );
             _step.Add( name, action );
             break;
         case "exit":
             name = GetUniqueKey( actionType, _exit );
             _exit.Add( name, action );
             break;
         case "finish":
             name = GetUniqueKey( actionType, _finish );
             _finish.Add( name, action);
             break;
     }
 }
开发者ID:saygt,项目名称:samuraivillage,代码行数:24,代码来源:State.cs

示例13: InitializeRoles

 /// <summary>
 /// Initializes the roles from the action attribute declaration. See <see cref="ActionRolesAttribute"/>
 /// for more information. 
 /// </summary>
 /// <returns></returns>
 /// <exception cref="System.NotImplementedException"></exception>
 protected virtual List<string> InitializeRoles(Action action)
 {
     // retrieve default roles for action using declarative attributes;
     Type actionType = action.GetType();
     {
         List<object> roleAttributes = new List<object>(actionType.GetCustomAttributes(typeof (ActionRolesAttribute), true));
         if (roleAttributes.Count > 0)
         {
             foreach (object roleAttribute in roleAttributes)
                 this.roles = ((ActionRolesAttribute)roleAttribute).Roles;
         }
     }
     return this.roles;
 }
开发者ID:kahneraja,项目名称:Vergosity,代码行数:20,代码来源:Action.cs

示例14: Copy

 public void Copy(Action action)
 {
     // copy all of the properties
     foreach (PropertyInfo pi in action.GetType().GetProperties())
     {
         // get the value of the property
         var val = pi.GetValue(action, null);
         pi.SetValue(this, val, null);
     }
 }
开发者ID:ogazitt,项目名称:TaskStore,代码行数:10,代码来源:Action.cs

示例15: checkConsumed

		private void  checkConsumed(int pos, int len, Action a)
		{
			int consumed = reader.Offset - pos;
			if (consumed != len)
			{
				throw new SwfFormatException(a.GetType().FullName + ": " + consumed + " was read. " + len + " was required.");
			}
		}
开发者ID:CamWiseOwl,项目名称:flashdevelop,代码行数:8,代码来源:ActionDecoder.cs


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