// This method will create and return a function object based upon the input name.
        public IGPFunction GetFunction(string Name)
        {
            IGPFunction2 gpFunc = null;

            // Look up the item with the matching "Name" field
            gpFunc = WmauFunctionFactory.wmxUtilityFunctions[Name];
            if (gpFunc != null)
            {
                return(Activator.CreateInstance((gpFunc as System.Object).GetType()) as IGPFunction2);
            }

            return(null);
        }
示例#2
0
        /// <summary>
        ///     Gets the name of the function.
        /// </summary>
        /// <param name="function">The function.</param>
        /// <returns></returns>
        protected virtual IGPFunctionName GetFunctionName(IGPFunction2 function)
        {
            IGPFunctionName functionName = new GPFunctionNameClass();

            functionName.MinimumProduct = esriProductCode.esriProductCodeBasic;
            functionName.HelpFile       = function.HelpFile;
            functionName.HelpContext    = function.HelpContext;

            IGPName name = (IGPName)functionName;

            name.Name        = function.Name;
            name.Description = function.DisplayName;
            name.DisplayName = function.DisplayName;
            name.Factory     = this;

            return(functionName);
        }
示例#3
0
 /// <summary>
 ///     Adds the specified function.
 /// </summary>
 /// <param name="function">The function.</param>
 /// <param name="category">The category.</param>
 protected void Add(IGPFunction2 function, string category)
 {
     this.Tools.Add(function, category);
 }