本文整理汇总了C#中IIndex类的典型用法代码示例。如果您正苦于以下问题:C# IIndex类的具体用法?C# IIndex怎么用?C# IIndex使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
IIndex类属于命名空间,在下文中一共展示了IIndex类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: QueryDataSourceCommand
public QueryDataSourceCommand(
IDataTypeProvider dataTypeProvider,
IIndex<string, IQueryDataSourceCommandImplementation> repositories)
{
_dataTypeProvider = dataTypeProvider;
_repositories = repositories;
}
示例2: ApplicationDatabase
public ApplicationDatabase(
IConnectionStringProvider connectionStringProvider,
IIndex<string, IDatabaseProvider> providerLookup)
{
this.connectionStringProvider = connectionStringProvider;
this.providerLookup = providerLookup;
}
示例3: IndexReader
public IndexReader(IIndex index, bool openReadOnly)
{
if (index == null)
throw new ArgumentNullException("index", "index cannot be null");
this.index = index;
this.isReadOnly = openReadOnly;
this.isDisposed = false;
switch (index.IndexStructure) {
case IndexType.SingleIndex:
var singleIndex = (IIndex)index;
if (!singleIndex.HasIndexFiles())
throw new InvalidOperationException("There are no index files in the specified directory " + index.IndexDirectory.FullName);
this.luceneDirectory = singleIndex.GetLuceneDirectory();
break;
case IndexType.DoubleIndex:
case IndexType.CyclicalIndex:
var doubleIndex = (DoubleIndex)index;
if (!doubleIndex.HasIndexFiles())
throw new InvalidOperationException("There are no index files in the specified directory " + index.IndexDirectory.FullName);
this.luceneDirectory = doubleIndex.GetLuceneDirectory();
break;
default:
throw new NotSupportedException(index.IndexStructure.ToString() + " not supported");
}
this.luceneReader = Lucene29.Net.Index.IndexReader.Open(this.luceneDirectory, openReadOnly);
}
示例4: GetMessage
private static string GetMessage(
IIndex primaryIndex,
IIndex foreignIndex,
object primaryKey)
{
string foreignTable =
foreignIndex.Table.EntityType.Name;
string foreignColumns =
string.Join(", ", foreignIndex.KeyInfo.EntityKeyMembers.Select(m => m.Name));
string primaryTable =
primaryIndex.Table.EntityType.Name;
string primaryColumns =
string.Join(", ", primaryIndex.KeyInfo.EntityKeyMembers.Select(m => m.Name));
return string.Format(
ExceptionMessages.ForeignKeyViolation,
foreignTable,
foreignColumns,
primaryKey,
primaryTable,
primaryColumns);
}
示例5: Core
public Core(IIndex index)
{
if (index == null)
throw new ArgumentNullException("index");
_index = index;
}
示例6: CreateIndexCommand
public CreateIndexCommand(
IIndex index,
IEnumerable<int> addedDocumentIds,
string tablePrefix) : base(index, tablePrefix)
{
_addedDocumentIds = addedDocumentIds;
}
示例7: DbAccessProvider
/// <summary>
/// Initializes a new instance of the <see cref="DbAccessProvider" /> class.
/// </summary>
/// <param name="dbAccessProviders">
/// The db access providers.
/// </param>
/// <param name="serviceLocator">
/// The service locator.
/// </param>
public DbAccessProvider(IIndex<string, IDbAccess> dbAccessProviders, IServiceLocator serviceLocator)
{
this._dbAccessProviders = dbAccessProviders;
this._serviceLocator = serviceLocator;
this._providerName = Config.ConnectionProviderName;
this._dbAccessSafe = new SafeReadWriteProvider<IDbAccess>(
() =>
{
IDbAccess dbAccess;
// attempt to get the provider...
if (this._dbAccessProviders.TryGetValue(this.ProviderName, out dbAccess))
{
// first time...
this._serviceLocator.Get<IRaiseEvent>().Raise(new InitDatabaseProviderEvent(this.ProviderName, dbAccess));
}
else
{
throw new NoValidDbAccessProviderFoundException(
@"Unable to Locate Provider Named ""{0}"" in Data Access Providers (DLL Not Located in Bin Directory?).".FormatWith(
this.ProviderName));
}
return dbAccess;
});
}
示例8: Import
public void Import(IIndex index, int count)
{
var reader = new DataDumpReader<Post>();
var xml = Path.Combine(path, "posts.xml");
index.Add(reader.Read(xml)
.Where(p => p.PostTypeId == PostTypeId.Question)
.Take(count));
}
示例9: ForeignKeyViolationException
public ForeignKeyViolationException(
IIndex primaryIndex,
IIndex foreignIndex,
object primaryKey)
: base(ErrorCode.RelationError,
GetMessage(primaryIndex, foreignIndex, primaryKey))
{
}
示例10: MapState
public MapState(IIndex map, MapStates state)
{
Map = map;
State = state;
RemovedDocuments = new List<Document>();
AddedDocuments = new List<Document>();
}
示例11: InitGroups
public void InitGroups(QueryProcessor processor, IIndex<long> emptyIndexContainer)
{
Debug.Assert(emptyIndexContainer.Count == 0);
ITable child = BaseTable;
// No groups, so make the entire child table the group,
if (aggregateComposite == null || child.RowCount <= 1) {
emptyIndexContainer.Add(0);
emptyIndexContainer.Add(child.RowCount);
}
// Populate the index by the aggregate composite,
else {
// Create a resolver for the composite function
IndexResolver resolver = processor.CreateResolver(child, aggregateComposite);
// The groups state
long groupPos = 0;
long groupSize = 0;
SqlObject[] lastComposite = null;
// Scan over the child
IRowCursor cursor = child.GetRowCursor();
while (cursor.MoveNext()) {
RowId rowid = cursor.Current;
// Get the group term
SqlObject[] groupValue = resolver.GetValue(rowid);
if (lastComposite == null) {
lastComposite = groupValue;
} else {
int c = SqlObject.Compare(groupValue, lastComposite);
// If group_val > the last composite, we are on a new group
if (c > 0) {
// New group,
emptyIndexContainer.Add(groupPos);
emptyIndexContainer.Add(groupSize);
lastComposite = groupValue;
groupPos = groupPos + groupSize;
groupSize = 0;
} else if (c < 0) {
// This will happen if the child table is not sorted by the
// composite expression.
throw new ApplicationException("Aggregate child is not sorted correctly.");
}
}
++groupSize;
}
// Final group
// (the below check probably not necessary since we already check for the
// empty child so group size will always be >1 at this point).
if (groupSize > 0) {
emptyIndexContainer.Add(groupPos);
emptyIndexContainer.Add(groupSize);
}
}
// Set the group index
childGroupsIndex = emptyIndexContainer;
lookupCursor = BaseTable.GetRowCursor();
}
示例12: For
public override IEnumerable<IAnnotation> For(IIndex index)
{
if (index.MyCat().Method != null)
{
yield return new Annotation(
MyCatAnnotationNames.Prefix + MyCatAnnotationNames.IndexMethod,
index.MyCat().Method);
}
}
开发者ID:yonglehou,项目名称:Pomelo.EntityFrameworkCore.MyCat,代码行数:9,代码来源:MyCatMigrationsAnnotationProvider.cs
示例13: Output_index
public static void Output_index(IIndex index)
{
foreach (var e in index.Entries)
{
System.Console.WriteLine("{0}", e.Word);
foreach (var dn in e.DocumentNames)
System.Console.WriteLine("\t{0}", dn);
}
}
示例14: AttachToModel
public void AttachToModel(IIndex index)
{
if (!Detached) DetachFromModel();
Index = index;
index.PropertyChanged += Index_PropertyChanged;
Detached = false;
SetupForm();
}
示例15: Dump_index
private void Dump_index(IIndex index)
{
foreach(var e in index.Entries)
{
System.Console.WriteLine("{0}", e.Word);
foreach(var dn in e.DocumentNames)
System.Console.WriteLine("\t{0}", dn);
}
}