|
So can a standard List<> hold values of string, int, bool etc at the same time? I was of the impression that a I needed to 'design' my own List<> in order to do this?
|
|
|
|
|
A List<object> can hold any kind of data.
You might want to inherit or encapsulate the list and implement some methods to simplify dealing with different objetcs.
Another alternative is to create a class that encapsulates an object reference and has methods to handle the different kind of data, and make a list containing items of that class.
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
Ahhh, OK ... thats good to hear as I've dumped all my old code and started again but I'm having problems with that now ...
OK here goes again ... I'm still lost on this!
I've ditched my old classes and started again, I just couldn't fathom what was wrong or what to do and now I'm having problem with my new implementation.
I've written this class:
public class BuildFileList<T> : IEnumerable<T>
{
private List<T> fileList = new List<T>();
public T GetFile(int pos)
{
return fileList[pos];
}
public void AddFile(T c)
{
fileList.Add(c);
}
public void ClearFiles()
{
fileList.Clear();
}
public int Count
{
get { return fileList.Count; }
}
IEnumerator<T> IEnumerable<T>.GetEnumerator()
{
return fileList.GetEnumerator();
}
IEnumerator IEnumerable.GetEnumerator()
{
return fileList.GetEnumerator();
}
}
but using these commands:
BuildFileList<FileList> SingleDirectoryFileStore = new BuildFileList<FileList>();
SingleDirectoryFileStore.AddFile(@"G:\Jammer1\", "2132987KB", ".WAV", "12/12/2001");
Gets two errors:
The type or namespace name 'FileList' could not be found (are you missing a using directive or an assembly reference?)
and
No overload for method 'AddFile' takes '4' arguments
I thought the whole point of using List<T> was that it was generic and you didn't need to tell it in advance what to expect?
Man, this whole generics thing has been hurting my head all day, I've not made any progress at all really.
Any help on this would be great Guffa I'm completely lost and losing the will to live!
|
|
|
|
|
You should specify what is <t>.
(This is what Guffa had mentioned to you previously)
The generics means, that it will hold just that type of objects, and you do not need to cast it, when getting back.
(you were holding objects before Generics)
Sincerely,
Elina
Life is great!!!
Enjoy every moment of it!
|
|
|
|
|
Thanks for that! Just 30 seconds before your mail came in I cracked it ... what a painful day! So glad I've now made some progress on this thought, I was starting to go mad with this issue!
Thanks for everyone's help and sorry for the daft questions and so on.
|
|
|
|
|
In my company there aare many computers that uase a software i wrote.
This software uses the registry and uses and crates fileson the client computer.
Sometimes i have to update my software after fixing some bugs..
1. does click once is sutible fot this senario of updating tge cliebnts?
2. if there are 2 seperate environmets for develop and production. is there a way to create the deployment website of click once without the studio? by msi maybe that creates the erbsite on a deployment serve)?
Sample code will be greate help
thanks...
modified on Saturday, March 1, 2008 10:38 AM
|
|
|
|
|
depending on your company's infrastructure, i'd suggest to role out the software on a single application or fileserver and simply link from the clients to this single installation.
the app will be executed on the client as well, but there's only one path you need to update.
i don't see where click once could help you in this case at the moment.
|
|
|
|
|
sir ,
how to use javascript with master page in asp.net2.0
|
|
|
|
|
Cross post = no help
Paul Marfleet
"No, his mind is not for rent
To any God or government"
Tom Sawyer - Rush
|
|
|
|
|
Differance between response.write and response.outputwrite
|
|
|
|
|
Welcome to code project. I recommend that before you flood these boards with questions that are easily answered, you try google. I also suggest that you probably need to buy a book on ASP.NET and work through it, and keep it as a reference for when you have simple questions like the three you have posted here.
Also, pay attention to where you're posting. Two of your three posts to date, are ASP.NET questions, and therefore in the wrong forum. Please google them rather than reposting them in that forum.
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Sachin Pawar wrote: Differance between response.write and response.outputwrite
Well, the most obvious difference is that one exists and not the other...
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
ROTFL - I didn't think I'd ever seen that.
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
difference between Dataset response.redirect and server.transfer
|
|
|
|
|
Thanks for flooding the boards. Is google broken where you live ?
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
|
I swear I am going to write a 'how to use google' article, so I can point people to it.
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
I have a better idea:
Whenever someone post new message the system should redirect user to a google search with message text or message title. Then allow the user to post message only after 15 minutes.
|
|
|
|
|
Well, googling their subject "hi", "urgunt doubt" or "plz heelp" won't help them much...
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
ah... 15 mins aren't sufficient, 30 mins would be better
TVMU^P[[IGIOQHG^JSH`A#@`RFJ\c^JPL>;"[,*/|+&WLEZGc`AFXc!L
%^]*IRXD#@GKCQ`R\^SF_WcHbORY87??6?N8?BcRAV\Z^&SU~%CSWQ@#2
W_AD`EPABIKRDFVS)EVLQK)JKSQXUFYK[M`UKs*$GwU#(QDXBER@CBN%
Rs0~53%eYrd8mt^7Z6]iTF+(EWfJ9zaK-i?TV.C\y<p?jxsg-b$f4ia>
--------------------------------------------------------
128 bit encrypted signature, crack if you can
|
|
|
|
|
I often post responses that are a link to the header as a google search.
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
So you are the resident google-the-subject bot.
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
Difference between Dataset and Type Dataset?
|
|
|
|
|
One is typed and one is not.
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Hi,
How to Fill Different Sheets in same excel File in ASP.Net(C#).
Thanks
|
|
|
|