Exemplo n.º 1
0
 public ActivityEntry(string name, string displayName, Func <Activity> factoryFunction, ActivitySignature signature, Type activityType)
 {
     Name         = name;
     DisplayName  = displayName;
     Create       = factoryFunction;
     Signature    = signature;
     ActivityType = activityType;
 }
Exemplo n.º 2
0
 public FunctionEntry(
     string name,
     string displayName,
     Func <Activity> factoryFunction,
     ActivitySignature signature,
     Type activityType,
     Type returnType)
     : base(name, displayName, factoryFunction, signature, activityType)
 {
     ReturnType = returnType;
 }
Exemplo n.º 3
0
        /// <summary>
        /// Checks if the given signature matches to this signature.
        /// </summary>
        /// <param name="signature">The given signature</param>
        /// <returns>Return true if match, otherwise return false.</returns>
        public bool Match(ActivitySignature signature)
        {
            // Check if input arguments are covered.
            foreach (var inArg in signature.SystemInArguments)
            {
                if (this.SystemInArguments.Find((arg) => arg.Id == inArg.Id) == null)
                {
                    return(false);
                }
            }

            return(this.CanModifyData || !signature.CanModifyData);
        }
Exemplo n.º 4
0
 /// <summary>
 /// Initializes a new instance of Autodesk.IM.Rule.OperatorEntry class with specified
 /// name, display name, factory function, signature, activity type, return type and operator category.
 /// </summary>
 /// <param name="name">The name of operator.</param>
 /// <param name="displayName">The diaply name of operator.</param>
 /// <param name="factoryFunction">The factory function to create new instnace of operator.</param>
 /// <param name="signature">The specified operator's signature.</param>
 /// <param name="activityType">The specified System.Type object representing the operator's type.</param>
 /// <param name="returnType">The specified System.Type object representing the operator's return type.</param>
 /// <param name="category">The specified category of the operator.</param>
 public OperatorEntry(
     string name,
     string displayName,
     Func <Activity> factoryFunction,
     ActivitySignature signature,
     Type activityType,
     Type returnType,
     OperatorCategory category)
     : base(name, displayName, factoryFunction, signature, activityType)
 {
     ReturnType = returnType;
     Category   = category;
 }
Exemplo n.º 5
0
        /// <summary>
        /// Register functions with specified name, display name, factory function,
        /// signature, function type(function is a kind of activity) and return type.
        /// </summary>
        /// <param name="name">The function's name.</param>
        /// <param name="displayName">The function's display name.</param>
        /// <param name="factoryFunction">The factory function to create new instance of the function.</param>
        /// <param name="signature">The function's signature.</param>
        /// <param name="activityType">The specified System.Type object representing the function's type.</param>
        /// <param name="returnType">The specified System.Type object representing the function's return type.</param>
        public void RegisterFunction(string name, string displayName, Func <Activity> factoryFunction,
                                     ActivitySignature signature, Type activityType, Type returnType)
        {
            if (name == null)
            {
                throw new ArgumentNullException("name");    // NOXLATE
            }
            if (displayName == null)
            {
                throw new ArgumentNullException("displayName");    // NOXLATE
            }
            if (factoryFunction == null)
            {
                throw new ArgumentNullException("factoryFunction");    // NOXLATE
            }
            if (signature == null)
            {
                throw new ArgumentNullException("signature");    // NOXLATE
            }
            if (activityType == null)
            {
                throw new ArgumentNullException("activityType");    // NOXLATE
            }
            if (returnType == null)
            {
                throw new ArgumentNullException("returnType");    // NOXLATE
            }
            if (name.Length == 0)
            {
                throw new ArgumentException(String.Format(Properties.Resources.ArgumentExceptionMessage, "name"));  // NOXLATE
            }
            if (displayName.Length == 0)
            {
                throw new ArgumentException(String.Format(Properties.Resources.ArgumentExceptionMessage, "displayName"));  // NOXLATE
            }

            FunctionEntry entry = new FunctionEntry(
                name,
                displayName,
                factoryFunction,
                signature,
                activityType,
                returnType
                );

            functionEntries.Add(entry);
            typeDictionary[activityType] = entry;
        }