Click here to Skip to main content
15,906,766 members
Home / Discussions / C#
   

C#

 
GeneralRe: Pause and continue threads Pin
Jimmanuel10-Oct-08 6:58
Jimmanuel10-Oct-08 6:58 
QuestionIs there a portable "Add Web Reference" auto-generating code? Pin
Rafferty Uy9-Oct-08 18:53
Rafferty Uy9-Oct-08 18:53 
AnswerRe: Is there a portable "Add Web Reference" auto-generating code? Pin
blackjack21509-Oct-08 20:26
blackjack21509-Oct-08 20:26 
QuestionCrystal Reports - Parameters Fields [modified] Pin
nelsonpaixao9-Oct-08 12:41
nelsonpaixao9-Oct-08 12:41 
QuestionObject containing structures or array Pin
davidbrammer9-Oct-08 11:04
davidbrammer9-Oct-08 11:04 
AnswerRe: Object containing structures or array Pin
Wes Aday9-Oct-08 12:51
professionalWes Aday9-Oct-08 12:51 
AnswerRe: Object containing structures or array Pin
DaveyM699-Oct-08 23:04
professionalDaveyM699-Oct-08 23:04 
AnswerRe: Object containing structures or array Pin
Guffa9-Oct-08 23:45
Guffa9-Oct-08 23:45 
davidbrammer wrote:
Ideal I want to have several arrays there of for different things but all of the same length


It sounds like you are thinking in a non-OO way about how you store data. If I get you right, the reason that the arrays would be the same length is that the items in each array with the same index belong together? Then you should probably use a list of custom objects instead, where you have properties in the object instead of items in separate arrays.

Example:

public class MyCustomObject {

   // some properties that are only writeable from within the object
   public int Id { get; private set; }
   public string Name { get; private set; }
   public decimal Price { get; private set; }

   // constructor where you set the properties
   public MyCustomObject(int id, string name, decimal price) {
      Id = id;
      Name = name;
      Price = price;
   }

   // your object may have a logical way to be represented as a string
   public override string ToString() {
      return string.Format("{0} (${1:0.##})", Name, Price);
   }

}

// create a list of objects
List<MyCustomObject> myObjects = new List<MyCustomObject>();
// add some objects to the list
myObjects.Add(new MyCustomObject(1, "C# for beginners", 12.50m));
myObjects.Add(new MyCustomObject(2, "VB for veterans", 1.99m));
// get the name of the first objects
string name = myObjects[0].Name;

GeneralRe: Object containing structures or array Pin
davidbrammer11-Oct-08 5:11
davidbrammer11-Oct-08 5:11 
QuestionHow to extend SharePoint Components/Features ? Pin
hdv2129-Oct-08 9:47
hdv2129-Oct-08 9:47 
Questionrun a method after getting a reponse it is done Pin
netJP12L9-Oct-08 9:25
netJP12L9-Oct-08 9:25 
AnswerRe: run a method after getting a reponse it is done Pin
Wendelius9-Oct-08 9:33
mentorWendelius9-Oct-08 9:33 
AnswerRe: run a method after getting a reponse it is done Pin
Anthony Mushrow9-Oct-08 9:56
professionalAnthony Mushrow9-Oct-08 9:56 
GeneralRe: run a method after getting a reponse it is done Pin
netJP12L9-Oct-08 10:13
netJP12L9-Oct-08 10:13 
GeneralRe: run a method after getting a reponse it is done Pin
Anthony Mushrow9-Oct-08 10:31
professionalAnthony Mushrow9-Oct-08 10:31 
QuestionVisual Studio 2008 - Report Viewer does show on WinForm Pin
tkmarshall9-Oct-08 9:05
tkmarshall9-Oct-08 9:05 
AnswerRe: Visual Studio 2008 - Report Viewer does show on WinForm Pin
Wendelius9-Oct-08 9:44
mentorWendelius9-Oct-08 9:44 
GeneralRe: Visual Studio 2008 - Report Viewer does show on WinForm Pin
tkmarshall9-Oct-08 10:55
tkmarshall9-Oct-08 10:55 
GeneralRe: Visual Studio 2008 - Report Viewer does show on WinForm Pin
Wendelius9-Oct-08 11:00
mentorWendelius9-Oct-08 11:00 
GeneralRe: Visual Studio 2008 - Report Viewer does show on WinForm Pin
tkmarshall10-Oct-08 4:58
tkmarshall10-Oct-08 4:58 
GeneralRe: Visual Studio 2008 - Report Viewer does show on WinForm Pin
Wendelius10-Oct-08 6:38
mentorWendelius10-Oct-08 6:38 
QuestionApp.Config Encrypt section, not saving Pin
Bill Warner9-Oct-08 8:12
Bill Warner9-Oct-08 8:12 
QuestionAnonymous constructor for Dictionary Pin
ezazazel9-Oct-08 7:50
ezazazel9-Oct-08 7:50 
AnswerRe: Anonymous constructor for Dictionary Pin
Daniel Grunwald9-Oct-08 8:02
Daniel Grunwald9-Oct-08 8:02 
GeneralRe: Anonymous constructor for Dictionary Pin
ezazazel9-Oct-08 8:04
ezazazel9-Oct-08 8:04 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.