本文整理汇总了C#中Storage.CreateIndex方法的典型用法代码示例。如果您正苦于以下问题:C# Storage.CreateIndex方法的具体用法?C# Storage.CreateIndex怎么用?C# Storage.CreateIndex使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Storage
的用法示例。
在下文中一共展示了Storage.CreateIndex方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: TimeSeriesImpl
internal TimeSeriesImpl(Storage storage, Type blockClass, long maxBlockTimeInterval)
{
this.blockClass = blockClass;
this.maxBlockTimeInterval = maxBlockTimeInterval;
//UPGRADE_TODO: The equivalent in .NET for method 'java.lang.Class.getName' may return a different value.
blockClassName = blockClass.FullName;
index = storage.CreateIndex(typeof(long), true);
}
示例2: Open
/// <summary>Open database</summary>
/// <param name="filePath">path to the database file</param>
public void Open(string filePath)
{
db = StorageFactory.Instance.CreateStorage();
db.Open(filePath);
root = (DatabaseRoot)db.Root;
if (root == null)
{
root = new DatabaseRoot();
root.prefixUriIndex = db.CreateIndex(typeof(string), true);
root.suffixUriIndex = db.CreateIndex(typeof(string), true);
root.strPropIndex = db.CreateIndex(new Type[]{typeof(PropDef), typeof(string)}, false);
root.numPropIndex = db.CreateIndex(new Type[]{typeof(PropDef), typeof(double)}, false);
root.refPropIndex = db.CreateIndex(new Type[]{typeof(PropDef), typeof(VersionHistory)}, false);
root.timePropIndex = db.CreateIndex(new Type[]{typeof(PropDef), typeof(DateTime)}, false);
root.propDefIndex = db.CreateFieldIndex(typeof(PropDef), "name", true);
root.timeIndex = db.CreateFieldIndex(typeof(Thing), "timestamp", false);
root.inverseIndex = db.CreateIndex(typeof(string), false);
root.spatialIndex = db.CreateSpatialIndexR2();
root.latest = db.CreateSet();
CreateMetaType();
db.Root = root;
}
}