indexer

How to tweak Eclipse's C++ Indexer?

I'm using Eclipse as my IDE for a C++ project, and I would love for it to tell me where a given symbol is defined and what the parameters are for a function. However, there's a catch: I also use Lazy C++, a tool that takes a single source file and generates the .h and the .cpp files. Those .lzz files look like headers, but this tool sup...

Static Indexers?

Why are static indexers disallowed in C#? I see no reason why they should not be allowed and furthermore they could be very useful. For example: static class ConfigurationManager { public object this[string name]{ get{ return ConfigurationManager.getProperty(name); } set { ...

C# Multiple Indexers

Is it possible to have something like the following: class C { public Foo Foos[int i] { ... } public Bar Bars[int i] { ... } } If not, then are what are some of the ways I can achieve this? I know I could make functions called getFoo(int i) and getBar(int i) but I was hoping to do this with pro...

[LUCENE.NET] How to use a field from Index to delete an entry?

I'm developing a Desktop Search Engine in VB 9 using Lucene.NET I wish to delete and create a new entry for a file that is updated. The Index stores complete file path and the last modified date. doc.Add(New Field("path", filepath, Field.Store.YES, Field.Index.UN_TOKENIZED)) doc.Add(New Field("modified", New FileInfo(filepath).LastWri...

Extension Methods for Indexers, would they be good ?

Extension Methods for Indexers, would they be good ? I was playing around with some code that re-hydrates POCO's. The code iterates around rows returned from a SqlDataReader and and uses reflection to assign properties from column values. Down my call stack I had a code a line like this :- poco.Set(“Surname”, “Smith”); // uses exten...

PropertyChanged for indexer property

I have a class with an indexer property, with a string key: public class IndexerProvider { public object this[string key] { get { return ... } set { ... } } ... } I bind to an instance of this class in WPF, using indexer notation: <TextBox Text="{Bin...

C# Indexer memory question

Hi I have the following code inside main method: List<Rectangle> rects = new List<Rectangle>(); for (int i = 0; i < 5; i++) { rects.Add(new Rectangle(1, 1, 1, 1)); } foreach (Rectangle item in rects) { Console.WriteLine(item); } rects[1].Inflate(100, 100); foreach (Rectangle item in rects) { Console.WriteLine(item); } ...

Question about indexers and/or generics

Hello, how is it possible to know whether an object implements an indexer?, I need to share a logic for a DataRow and a IDataReader, but they don't share any interface. I tried also with generics but don't know what restriction should I put on the where clause. public class Indexer { // myObject should be a DataRow or a IDataReader...

C++/CLI: Implementing IList and IList<T> (explicit implementation of a default indexer)

I am trying to implement a C++/CLI class that implements both IList and IList<T>. Since they have overlapping names, I have to implement one of them explicitly, and the natural choice should be IList. The implicit implementation of the indexer is: using namespace System::Collections::Generic; generic<class InnerT> public ref class MyL...

Eclipse has two C/C++ indexers (fast & full): what's the difference?

Eclipse CDT provides two indexers for C/C++ code (Preferences > C/C++ > Indexer). Does anybody know what the exact difference is between these two? The help file isn't exactly enlightening: "CDT supports the contribution of additional indexers, with 2 indexers being provided with the default CDT release: Fast C/C++ In...

Google Code Search-like source code indexer and visualizer

I'm looking for a way to search through our subversion repository or just packaged source code. Are there any downloadable servers/tools like Google Code Search to index source code (preferable with support of version control systems like svn) and allow us to search in it? Is there any tool that will index documents too? ...

nexus indexer (macosx-leopard) issue

hi, I'm stuck trying to add org.nakedobjects.prototyping : application, the nexus indexer cant find anything. I've realized that in the url text box doesn't contains the http;//repo1.maven.org/maven2/ address, any clues? I'm using the latest version of eclipse 3.4.2 ...

C# Indexer Property Question

I have a class like this: public class SomeClass { private const string sessionKey = "__Privileges"; public Dictionary<int, Privilege> Privileges { get { if (Session[sessionKey] == null) { Session[sessionKey] = new Dictionary<int, Privilege>(); } ...

Indexer as part of the interface in C#

In C#, what's the syntax for declaring an indexer as part of an interface? Is it still this[ ]? Something feels odd about using the this keyword in an interface. ...

How can I use a DebuggerDisplay attribute on an indexer class...

I am trying to do something like this on an indexer class: [DebuggerDisplay("Debug: {_Items[index]}")] public override string this[byte index] However, when the debugger evaluates the string, the message in the value field is "index does not exist in the current context". Is there some way to use the DebuggerDisplay attribute...

C# Indexer Usage

To have an indexer we use the following format: class ClassName { DataType[] ArrayName = new DataType[Length]; public DataType this[int i] { get { return ArrayName[i]; } } } For the sake of simplicity I used the format, even though we can go for a custom indexer also. According to my understanding, we are kee...

Indexing text files in PHP

I have been set a challenge to create an indexer that takes all words 4 characters or more, and stores them in a database along with how many times the word was used. I have to run this indexer on 4,000 txt files. Currently, it takes about 12-15 minutes - and I'm wondering if anyone has a suggestion for speeding things up? Currently...

How to extract an individual item of an EntityCollection thru xaml binding?

Hi! I have a Contact entity that exposes a navigation proeprty for child Phone entities. Public Class Contact : Inherits EntityObject Public Property Phones() As EntityCollection(Of Phone) EndClass I want to Xamly retrieve the first phone of the bound contact. I tried the following but it doesn't work. Note: I also tried Phon...

C#: public method{get{} set{}} question

I'm not entirely sure if I have all the terminology correct so forgive me if I'm wrong. I was wondering if it would be possible to send an argument(s) to the method. Take the following for example. public item (int index) { get { return list[index]; } set { list[index] = value; } } I know that as it is, it will error. ...

Iterating Linq result set using indexers

Let's ay I have this query: var results = from row in db.Table select row; How can I access this: string name = results[0]["columnName"]; ...