Questions tagged [indexer]

367 questions
-2
votes
1 answer

Why value doesn't want to change?

I got a portion of code to hold game variables. The Var struct is a simple one: struct Var{ /// /// Name of variable. Unchangable /// public string Name { get; private set; } /// /// Value of variable. Can be changed…
SkillGG
  • 647
  • 4
  • 18
-2
votes
1 answer

javascript array like function (javascript indexer C# like)

I need in typescript (or, at least, javascript) a function which I can call/use like an array: myFunc[someInput] I know I cand do something like: interface IInputs { "someInput1": someType, "someInput2": someType, } interface someType { …
Gigi
  • 158
  • 11
-3
votes
2 answers

C# Console Program Indexer only finds the FIRST item in my List<>

Below is a very basic program with three classes which makes use of an Indexer to search for a person within a List<> per based on their age. Person.cs Below: using System; using System.Collections.Generic; using System.Linq; using…
FireHawk2300
  • 91
  • 3
  • 13
-3
votes
1 answer

In C# is it possible to have an custom Indexer property of a type that is NOT a string or an int?

In C# is it possible to have an Indexer property of a type that is not a string or an int? For example I have a custom object that is a map of 2D vector coordinates. Taking the basics of my map class to be... public class TileMap { ///…
Dib
  • 2,001
  • 2
  • 29
  • 45
-3
votes
3 answers

What is the proper syntax in C# for indexing a property

How do i declare an indexed property? public class PublishProperties : ScriptableObject { List m_shellPathsT = new List(); List m_shellPathsL = new List(); public List ShellPath[int index] { get { …
vbbartlett
  • 179
  • 2
  • 14
-4
votes
4 answers

Having multiple Indexer with the same signature

Is it possible to have two or more indexer (or something simillar) with the same signature? So it would look something like this private int[,] X; public int this[int a] { set { X[a, 0] = value; } …
RexMan85
  • 59
  • 1
  • 1
  • 6
-5
votes
2 answers

How can i show the alphabet in a listview?

How can i show the alphabet like below: This is what i want I'm using alphabet indexer and that is works. But the alphabet missing from the right side.
László Magyar
  • 355
  • 1
  • 16
1 2 3
24
25