コード例 #1
0
        public CommandSearchCritieria(CommandEntity entity) : base(SearchCriteriaType.Command)
        {
            try {
                if (entity.EntitySource.Parameters.Count <= 0)
                {
                    return;
                }

                foreach (ParameterSchema parameter in entity.EntitySource.Parameters)
                {
                    if (parameter == null)
                    {
                        continue;
                    }

                    if (parameter.Name.Contains("RETURN_VALUE"))
                    {
                        continue;
                    }

                    Properties.Add(new CommandParameter(parameter, entity));
                }
            } catch (NotSupportedException) {
                string message = String.Format("This provider does not support Commands. Please disable the generation of commands by setting IncludeFunctions to false.");
                Trace.WriteLine(message);
                Debug.WriteLine(message);
            } catch (Exception ex) {
                string message = String.Format("Unable to load Command Search Criteria for '{0}'. Exception: {1}", entity.EntityKeyName, ex.Message);
                Trace.WriteLine(message);
                Debug.WriteLine(message);
                _isValid = false;
            }
        }
コード例 #2
0
        /// <summary>
        /// Loop through all the commands and create the command objects.
        /// </summary>
        /// <param name="commands"></param>
        protected virtual void LoadCommands(CommandSchemaCollection commands)
        {
            if (Configuration.Instance.IncludeFunctions && commands != null && commands.Count > 0)
            {
                foreach (CommandSchema command in commands)
                {
                    if (!Configuration.Instance.IncludeRegexIsMatch(command.FullName) || Configuration.Instance.ExcludeRegexIsMatch(command.FullName) || EntityStore.Instance.GetEntity(command.FullName) != null)
                    {
                        Trace.WriteLine(String.Format("Skipping command: '{0}'", command.FullName));
                        Debug.WriteLine(String.Format("Skipping command: '{0}'", command.FullName));

                        EntityStore.Instance.ExcludedEntityCollection.Add(command.FullName, null);
                        continue;
                    }

                    var commandEntity = new CommandEntity(command);
                    EntityStore.Instance.CommandCollection.Add(command.FullName, commandEntity);
                    EntityStore.Instance.EntityCollection.Add(command.FullName, commandEntity);
                }
            }
        }