public ConfigurationNodeCollection()
        {
            _listIndex = new ListIndex <ConfigurationNode>("List");
            _nameIndex = new UniqueIndex <string, ConfigurationNode>("Name", node => GetKeyResponse.Create(true, node.Name), SortOrder.Ascending);

            _collection = new IndexableCollection <ConfigurationNode>(_listIndex);
            _collection.Indexes.Add(_nameIndex);
        }
        internal XmlSpreadsheetAttributeCollection()
        {
            NameIndex = new UniqueIndex <string, XmlSpreadsheetAttribute>(
                "NameIndex",
                item => GetKeyResponse.Create(true, item.LocalName),
                SortOrder.None);

            _items = new IndexableCollection <XmlSpreadsheetAttribute>(NameIndex);
        }
 /// <summary>
 ///
 /// </summary>
 public TextDataSetTableCollection()
 {
     _listIndex = new ListIndex <TextDataSetTable>("List");
     _nameIndex = new UniqueIndex <string, TextDataSetTable>(
         "Name",
         item => GetKeyResponse.Create(true, item.Name),
         SortOrder.None);
     _collection = new IndexableCollection <TextDataSetTable>(_listIndex);
     _collection.Indexes.Add(_nameIndex);
 }
Esempio n. 4
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="monitoredObject"></param>
        public PriorityMonitor(T monitoredObject)
        {
            MonitoredObject = monitoredObject;
            _priorityIndex  = new NonUniqueIndex <int, LockRequest>(
                "priorityIndex",
                item => GetKeyResponse.Create(true, item.Priority),
                SortOrder.Ascending);

            _lockRequests = new IndexableCollection <LockRequest>(_priorityIndex);
        }
Esempio n. 5
0
    public TextDataColumnCollection()
    {
        _listIndex = new ListIndex <TextDataColumn>("List");

        _nameIndex = new UniqueIndex <string, TextDataColumn>(
            "Name",
            column => GetKeyResponse.Create(true, column.ColumnName),
            SortOrder.None);

        _collection = new IndexableCollection <TextDataColumn>(_listIndex);
    }
    /// <summary>
    ///
    /// </summary>
    public TextDataParameterCollection()
    {
        _listIndex = new ListIndex <TextDataParameter>("List");
        _nameIndex = new UniqueIndex <string, TextDataParameter>(
            "Name",
            parameter => GetKeyResponse.Create(true, parameter.ParameterName),
            SortOrder.None);

        _collection = new IndexableCollection <TextDataParameter>(_listIndex);
        _collection.Indexes.Add(_nameIndex);
    }
Esempio n. 7
0
        /// <summary>
        ///
        /// </summary>
        public ConfigurationAttributeCollection()
        {
            _listIndex = new ListIndex <ConfigurationAttribute>("List");

            _nameIndex = new UniqueIndex <string, ConfigurationAttribute>(
                "NameIndex",
                attribute => GetKeyResponse.Create(true, attribute.Name),
                SortOrder.None);

            _collection = new IndexableCollection <ConfigurationAttribute>(_listIndex);
            _collection.Indexes.Add(_nameIndex);
        }
Esempio n. 8
0
        static SessionMonitor()
        {
            linkedListIndex = new LinkedListIndex <SessionData>("LinkedList");
            idIndex         = new UniqueIndex <String, SessionData>(
                "Id",
                delegate(SessionData sessionData, out String sessionId)
            {
                sessionId = sessionData.SessionId;
                return(true);
            },
                false);

            sessions = new IndexableCollection <SessionData>(linkedListIndex);
            sessions.Indexes.Add(idIndex);
        }
Esempio n. 9
0
    public CommandLine(string commandLine)
    {
        ArgumentNullException.ThrowIfNull(commandLine);

        _arguments = new IndexableCollection <CommandLineArgument>(ListIndex);
        var dictionary = new Dictionary <string, ICollection <CommandLineArgument> >(StringComparer.InvariantCultureIgnoreCase);

        NameIndex = new NonUniqueIndex <string, CommandLineArgument>(
            "nameIndex",
            argument => GetKeyResponse.Create(argument.Name != null, argument.Name),
            dictionary,
            () => new List <CommandLineArgument>());
        _arguments.Indexes.Add(NameIndex);
        var stringReader = new StringReader(commandLine);
        var arguments    = Parse(stringReader);

        _arguments.Add(arguments);
    }
Esempio n. 10
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="maximumConcurrencyLevel"></param>
        /// <param name="timerPeriod"></param>
        public MemoryCache(int maximumConcurrencyLevel, TimeSpan timerPeriod)
        {
            this.keyIndex = new UniqueIndex <string, CacheEntry>(
                "key",
                entry => GetKeyResponse.Create(true, entry.CacheItem.Key),
                SortOrder.None);

            this.absoluteExpirationIndex = new NonUniqueIndex <DateTime, CacheEntry>(
                "absoluteExpiration",
                entry => GetKeyResponse.Create(true, entry.AbsoluteExpiration),
                SortOrder.Ascending);

            this.entries = new IndexableCollection <CacheEntry>(this.keyIndex);
            this.entries.Indexes.Add(this.absoluteExpirationIndex);

            this.scheduler = new LimitedConcurrencyLevelTaskScheduler("MemoryCache", maximumConcurrencyLevel, new ConcurrentQueue <Action>());

            this.timer = new Timer(this.TimerCallback, null, timerPeriod, timerPeriod);
        }
Esempio n. 11
0
        static TypeNameCollection()
        {
            NameIndex = new UniqueIndex <string, TypeCollectionItem>(
                "Name",
                item => GetKeyResponse.Create(true, item.Name),
                SortOrder.None);

            TypeIndex = new UniqueIndex <Type, TypeCollectionItem>(
                "Type",
                item => GetKeyResponse.Create(true, item.Type),
                new Dictionary <Type, TypeCollectionItem>(TypeEqualityComparer.Instance));

            Collection = new IndexableCollection <TypeCollectionItem>(NameIndex);
            Collection.Indexes.Add(TypeIndex);

            Add(CSharpTypeName.Boolean, typeof(bool));
            Add(CSharpTypeName.Char, typeof(char));
            Add(CSharpTypeName.String, typeof(string));
            Add(CSharpTypeName.Object, typeof(object));

            Add(CSharpTypeName.SByte, typeof(sbyte));
            Add(CSharpTypeName.Int16, typeof(short));
            Add(CSharpTypeName.Int32, typeof(int));
            Add(CSharpTypeName.Int64, typeof(long));
            Add(CSharpTypeName.Byte, typeof(byte));
            Add(CSharpTypeName.UInt16, typeof(ushort));
            Add(CSharpTypeName.UInt32, typeof(uint));
            Add(CSharpTypeName.UInt64, typeof(ulong));

            Add(CSharpTypeName.Single, typeof(float));
            Add(CSharpTypeName.Double, typeof(double));
            Add(CSharpTypeName.Decimal, typeof(decimal));

            Add(TypeName.DateTime, typeof(DateTime));
            Add(TypeName.XmlNode, typeof(XmlNode));

            SystemAssembly = Assembly.GetAssembly(typeof(int));
        }
 private QueryPerformanceResult<Item> RunWhereTestForIndexedByString(IndexableCollection<Item> IndexableCollectionItem, Int32 ItemName)
 {
     return (
         from item in IndexableCollectionItem
         where item.Name == ItemName.ToString()
         select item
     ).ExecuteQueryPerformanceResult();
 }
 private QueryPerformanceResult<Item> RunWhereTestForIndexedByGuid(IndexableCollection<Item> IndexableCollectionItem, Int32 Id)
 {
     return (
             from item in IndexableCollectionItem
             where item.Id == Id.MakeGuid()
             select item
     ).ExecuteQueryPerformanceResult();
 }
 private QueryPerformanceResult<Item> RunJoinTestForIndexedByString(IndexableCollection<Item> IndexableCollectionOfItemsA, IndexableCollection<Item> IndexableCollectionOfItemsB)
 {
     return (
         from a in IndexableCollectionOfItemsA
         join b in IndexableCollectionOfItemsB on a.Name equals b.Name
         select new Item(Guid.Empty, 0, a.Name, b.Description, 0)
     ).ExecuteQueryPerformanceResult();
 }