3
votes
2answers
180 views

Data structure for grid with negative indeces

Sorry if this is an insultingly obvious concept, but it's something I haven't done before and I've been unable to find any material discussing the best way to approach it. I'm wondering what's the ...
2
votes
1answer
98 views

Accessing a private array when I have an extension method

I'm trying to make a number of data classes for my C#/XNA game, which would essentially be a wrapper around T[,]: public interface IGrid<T> where T : struct { Point Size { get; } T ...
4
votes
2answers
4k views

Should I use a list or an array?

I'm working on a windows form to calculate UPC for item numbers. I successfully create one that will handle one item number/UPC at a time, now I want to expand and do it for multiple item ...
3
votes
2answers
583 views

CA1819: Properties should not return arrays. Does this happen only with arrays? If yes, why?

I have a question about CA1819 msdn performance warning. The rule is: Arrays returned by properties are not write-protected, even if the property is read-only. To keep the array tamper-proof, the ...
5
votes
2answers
308 views

Which design pattern is illustrated by inheriting IStructuralComparable interface?

We know that some design patterns are found so useful that they become features of the language itself. For instance, the interface IEnumerator which is implemented by Array object. This helps in ...
3
votes
1answer
641 views

The array class in C# - Implementation questions

I am studying the Array class in C#. The following is the implementation of System.Array class: [SerializableAttribute] [ComVisibleAttribute(true)] public abstract class Array : ICloneable, IList, ...
6
votes
3answers
2k views

Ordered enumeration: IEnumerable or Array (in C#)?

Typical context: I make an extension method for a collection which considers that the elements are ordered. The function starts at the beginning, at index 0, and the order has significance. Examples: ...