本文整理汇总了C#中IPredicate类的典型用法代码示例。如果您正苦于以下问题:C# IPredicate类的具体用法?C# IPredicate怎么用?C# IPredicate使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
IPredicate类属于命名空间,在下文中一共展示了IPredicate类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: UnicornDataProvider
public UnicornDataProvider(ITargetDataStore targetDataStore, ISourceDataStore sourceDataStore, IPredicate predicate, IFieldFilter fieldFilter, IUnicornDataProviderLogger logger, IUnicornDataProviderConfiguration dataProviderConfiguration, ISyncConfiguration syncConfiguration, PredicateRootPathResolver rootPathResolver)
{
Assert.ArgumentNotNull(targetDataStore, nameof(targetDataStore));
Assert.ArgumentNotNull(predicate, nameof(predicate));
Assert.ArgumentNotNull(fieldFilter, nameof(fieldFilter));
Assert.ArgumentNotNull(logger, nameof(logger));
Assert.ArgumentNotNull(sourceDataStore, nameof(sourceDataStore));
Assert.ArgumentNotNull(dataProviderConfiguration, nameof(dataProviderConfiguration));
Assert.ArgumentNotNull(rootPathResolver, nameof(rootPathResolver));
Assert.ArgumentNotNull(syncConfiguration, nameof(syncConfiguration));
_logger = logger;
_dataProviderConfiguration = dataProviderConfiguration;
_syncConfiguration = syncConfiguration;
_rootPathResolver = rootPathResolver;
_predicate = predicate;
_fieldFilter = fieldFilter;
_targetDataStore = targetDataStore;
_sourceDataStore = sourceDataStore;
// enable capturing recycle bin and archive restores to serialize the target item if included
EventManager.Subscribe<RestoreItemCompletedEvent>(HandleItemRestored);
try
{
_targetDataStore.RegisterForChanges(RemoveItemFromCaches);
}
catch (NotImplementedException)
{
// if the data store doesn't implement watching, cool story bruv
}
}
示例2: PredicateRootPathResolver
public PredicateRootPathResolver(IPredicate predicate, ISerializationProvider serializationProvider, ISourceDataProvider sourceDataProvider, ILogger logger)
{
_predicate = predicate;
_serializationProvider = serializationProvider;
_sourceDataProvider = sourceDataProvider;
_logger = logger;
}
示例3: AtomFunction
/// <summary>
/// Private constructor used for cloning.
/// </summary>
/// <param name="source">The source AtomFunction to use for building the new one.</param>
/// <param name="members">The members to use in the new AtomFunction.</param>
private AtomFunction(AtomFunction source, IPredicate[] members)
: base(source, members)
{
this.bob = source.bob;
this.functionSignature = source.functionSignature;
this.resolutionType = source.resolutionType;
}
示例4: SelectSet
public string SelectSet(IClassMapper classMap, IPredicate predicate, IList<ISort> sort, int firstResult, int maxResults, IDictionary<string, object> parameters)
{
if (sort == null || !sort.Any())
{
throw new ArgumentNullException("Sort", "Sort cannot be null or empty.");
}
if (parameters == null)
{
throw new ArgumentNullException("Parameters");
}
StringBuilder innerSql = new StringBuilder(string.Format("SELECT {0} FROM {1}",
BuildSelectColumns(classMap),
GetTableName(classMap)));
if (predicate != null)
{
innerSql.Append(" WHERE ")
.Append(predicate.GetSql(this, parameters));
}
string orderBy = sort.Select(s => GetColumnName(classMap, s.PropertyName, false) + (s.Ascending ? " ASC" : " DESC")).AppendStrings();
innerSql.Append(" ORDER BY " + orderBy);
string sql = Configuration.Dialect.GetSetSql(innerSql.ToString(), firstResult, maxResults, parameters);
return sql;
}
示例5: ConfigurationDetails
public ConfigurationDetails(IPredicate predicate, ISerializationProvider serializationProvider, ISourceDataProvider sourceDataProvider, IEvaluator evaluator)
{
_predicate = predicate;
_serializationProvider = serializationProvider;
_sourceDataProvider = sourceDataProvider;
_evaluator = evaluator;
}
示例6: UnicornDataProvider
public UnicornDataProvider(ITargetDataStore targetDataStore, ISourceDataStore sourceDataStore, IPredicate predicate, IFieldFilter fieldFilter, IUnicornDataProviderLogger logger, IUnicornDataProviderConfiguration configuration)
{
Assert.ArgumentNotNull(targetDataStore, "serializationProvider");
Assert.ArgumentNotNull(predicate, "predicate");
Assert.ArgumentNotNull(fieldFilter, "fieldPredicate");
Assert.ArgumentNotNull(logger, "logger");
Assert.ArgumentNotNull(sourceDataStore, "sourceDataStore");
Assert.ArgumentNotNull(configuration, "configuration");
_logger = logger;
_configuration = configuration;
_predicate = predicate;
_fieldFilter = fieldFilter;
_targetDataStore = targetDataStore;
_sourceDataStore = sourceDataStore;
try
{
_targetDataStore.RegisterForChanges(RemoveItemFromCaches);
}
catch (NotImplementedException)
{
// if the data store doesn't implement watching, cool story bruv
}
}
示例7: PredicateRootPathResolver
public PredicateRootPathResolver(IPredicate predicate, ITargetDataStore targetDataStore, ISourceDataStore sourceDataStore, ILogger logger)
{
_predicate = predicate;
_targetDataStore = targetDataStore;
_sourceDataStore = sourceDataStore;
_logger = logger;
}
示例8: FiatSitecoreSerializationProvider
public FiatSitecoreSerializationProvider(IPredicate predicate, IFieldPredicate fieldPredicate, IFiatDeserializerLogger logger, string rootPath = null, string logName = "UnicornItemSerialization")
: base(predicate, rootPath, logName)
{
Assert.ArgumentNotNull(logger, "logger");
_deserializer = new FiatDeserializer(logger, fieldPredicate);
}
示例9: Populate
/// <summary>
/// Populates the Variable predicates of a target Atom, using another Atom as a template
/// and a Fact as the source of data, i.e. Individual predicates.
/// </summary>
/// <param name="data">The data for populating the Atom.</param>
/// <param name="template">The template of Atom being populated.</param>
/// <param name="target">The members to populate.</param>
public static void Populate(Fact data, Atom template, IPredicate[] members) {
for(int i=0;i<members.Length;i++)
if (members[i] is Variable) {
int j = Array.IndexOf(template.Members, members[i]);
if (j >= 0) members[i] = data.Members[j];
}
}
示例10: PredicateFilteredItemData
public PredicateFilteredItemData(IItemData innerItem, IPredicate predicate)
: base(innerItem)
{
Assert.ArgumentNotNull(predicate, "predicate");
_predicate = predicate;
}
示例11: FiatRemotedSerializationProvider
public FiatRemotedSerializationProvider(IPredicate predicate, IFieldPredicate fieldPredicate, IFiatDeserializerLogger logger, string remoteUrl = null, string rootPath = null, string logName = "UnicornItemSerialization")
: base(predicate, fieldPredicate, logger, rootPath, logName)
{
Assert.ArgumentNotNull(remoteUrl, "remoteUrl");
RemoteUrl = remoteUrl;
}
示例12: ConfigurationDetails
public ConfigurationDetails(IPredicate predicate, ITargetDataStore serializationStore, ISourceDataStore sourceDataStore, IEvaluator evaluator)
{
_predicate = predicate;
_serializationStore = serializationStore;
_sourceDataStore = sourceDataStore;
_evaluator = evaluator;
}
示例13: CreateTestProvider
// TODO
private UnicornDataProvider CreateTestProvider(Database db, ITargetDataStore targetDataStore = null, ISourceDataStore sourceDataStore = null, IPredicate predicate = null, IFieldFilter filter = null, IUnicornDataProviderLogger logger = null, bool enableTransparentSync = false)
{
if (predicate == null)
{
predicate = CreateInclusiveTestPredicate();
}
if (filter == null)
{
filter = Substitute.For<IFieldFilter>();
filter.Includes(Arg.Any<Guid>()).Returns(true);
}
targetDataStore = targetDataStore ?? Substitute.For<ITargetDataStore>();
sourceDataStore = sourceDataStore ?? Substitute.For<ISourceDataStore>();
var dp = new UnicornDataProvider(targetDataStore,
sourceDataStore,
predicate,
filter,
logger ?? Substitute.For<IUnicornDataProviderLogger>(),
new DefaultUnicornDataProviderConfiguration(enableTransparentSync),
new PredicateRootPathResolver(predicate, targetDataStore, sourceDataStore, Substitute.For<ILogger>()));
dp.ParentDataProvider = db.GetDataProviders().First();
return dp;
}
示例14: ConfigurationDetails
public ConfigurationDetails(IPredicate predicate, ITargetDataStore serializationStore, ISourceDataStore sourceDataStore, IEvaluator evaluator, ConfigurationDependencyResolver dependencyResolver)
{
_predicate = predicate;
_serializationStore = serializationStore;
_sourceDataStore = sourceDataStore;
_evaluator = evaluator;
_dependencyResolver = dependencyResolver;
}
示例15: Slot
/// <summary>
/// Instantiates a new slot that will hold a named predicate.
/// </summary>
/// <param name="name">The name of the predicate</param>
/// <param name="predicate">The predicate itself</param>
public Slot(string name, IPredicate predicate)
{
if ((name == null) || (name == String.Empty)) throw new ArgumentException("The name of a slot can not be null or empty");
if (predicate == null) throw new ArgumentException("The predicate of a slot can not be null");
if (predicate is Slot) throw new ArgumentException("A slot can not contain another slot");
this.name = name;
this.predicate = predicate;
}