Click here to Skip to main content
15,886,199 members
Home / Discussions / C#
   

C#

 
AnswerRe: FileSystemWatcher HELP PLEASE !! Pin
FyreWyrm5-Apr-10 16:12
FyreWyrm5-Apr-10 16:12 
QuestionHow to send Email in C# through the Exchange Server? Pin
ravis194-Apr-10 21:00
ravis194-Apr-10 21:00 
AnswerRe: How to send Email in C# through the Exchange Server? Pin
Abhinav S4-Apr-10 21:49
Abhinav S4-Apr-10 21:49 
QuestionHow to ATL COM exe(out-of-proc) in .net? Pin
SRKSHOME4-Apr-10 20:32
SRKSHOME4-Apr-10 20:32 
QuestionWindows Service service Account = Network Pin
yadlaprasad4-Apr-10 20:18
yadlaprasad4-Apr-10 20:18 
AnswerRe: Windows Service service Account = Network Pin
Dave Kreskowiak5-Apr-10 1:53
mveDave Kreskowiak5-Apr-10 1:53 
AnswerRe: Windows Service service Account = Network Pin
PIEBALDconsult5-Apr-10 3:38
mvePIEBALDconsult5-Apr-10 3:38 
Questioniteration Pin
adrian5644-Apr-10 19:34
adrian5644-Apr-10 19:34 
Hello all,

I would appreciate any help that can be given. I'm new to c# and mostly develop in c++. I'm using Microsoft Visual Studio 2010 as my IDE. My question is I'd like to ouput cars from a car collection. I'm using a 3rd party DLL library. As far as I know the dll has 2 classes. They are CarCollection and Car.

CarCollection has the following functions:

using System;
using System.Collections.Generic;

namespace CaraPartnersSdk
{
    public class CarCollection
    {
        public CarCollection();

        public IEnumerable<Car> FindByName(string name);
        public Car GetByID(int id);
    }
}


Car.cs:
using System;
using System.Collections.Generic;

namespace CaraPartnersSdk
{
    public class Car
    {
        public Car();

        public string AlternateForm { get; }
        public Condition Condition { get; }
        public IEnumerable<Car> ConnectsToCars { get; }
        public bool HasBeenOpened { get; }
        public int ID { get; }
        public string Name { get; }
        public string OptionalAttributesXml { get; }
        public decimal Price { get; }
        public string Set { get; }
        public int Strength { get; }
    }
}


All I'm trying to do is output each Car's name and ID which is in the dll. For now, I'm using a simple main class. I have no idea how to iterate through the CarCollection since it's not an array or actual collection. I'm doing CarCollection aCollection = new CarCollection(); When I use aCollection.FindByName() I get a message which does not help. After that I'm stumped. I know I have to use public IEnumerable&lt;Car&gt; FindByName(string name); from the CarCollection class but I have no idea how. I wish they passed the collection as an array because then I can do a simple for loop like
for(int i = 0; i
AnswerRe: iteration Pin
Abhinav S4-Apr-10 19:51
Abhinav S4-Apr-10 19:51 
GeneralRe: iteration Pin
adrian5644-Apr-10 19:55
adrian5644-Apr-10 19:55 
GeneralRe: iteration Pin
VCsamir4-Apr-10 20:33
VCsamir4-Apr-10 20:33 
GeneralRe: iteration Pin
adrian5645-Apr-10 8:00
adrian5645-Apr-10 8:00 
GeneralRe: iteration Pin
adrian5645-Apr-10 8:01
adrian5645-Apr-10 8:01 
GeneralRe: iteration Pin
adrian5645-Apr-10 19:05
adrian5645-Apr-10 19:05 
AnswerRe: iteration [modified] Pin
PIEBALDconsult7-Apr-10 13:49
mvePIEBALDconsult7-Apr-10 13:49 
QuestionWant to learn how to develop components for .net eg:Chart components Pin
milpo4-Apr-10 18:57
milpo4-Apr-10 18:57 
Question[Solved] How to open all files in a floder/drive? [modified] Pin
newcoder19994-Apr-10 17:19
newcoder19994-Apr-10 17:19 
AnswerRe: How to open all files in a floder/drive? Pin
Luc Pattyn4-Apr-10 17:59
sitebuilderLuc Pattyn4-Apr-10 17:59 
QuestionRe: How to open all files in a floder/drive? Pin
newcoder19994-Apr-10 18:12
newcoder19994-Apr-10 18:12 
AnswerRe: How to open all files in a floder/drive? Pin
Luc Pattyn4-Apr-10 19:03
sitebuilderLuc Pattyn4-Apr-10 19:03 
GeneralRe: How to open all files in a floder/drive? Pin
newcoder19994-Apr-10 19:08
newcoder19994-Apr-10 19:08 
GeneralRe: How to open all files in a floder/drive? Pin
Luc Pattyn4-Apr-10 19:27
sitebuilderLuc Pattyn4-Apr-10 19:27 
QuestionImages in property grid Pin
viciouskinid4-Apr-10 17:15
viciouskinid4-Apr-10 17:15 
Questionhiding tables in ms sql Pin
Ice_Freez054-Apr-10 15:30
Ice_Freez054-Apr-10 15:30 
AnswerRe: hiding tables in ms sql Pin
Luc Pattyn4-Apr-10 15:35
sitebuilderLuc Pattyn4-Apr-10 15:35 

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.