Click here to Skip to main content
15,915,611 members
Home / Discussions / C#
   

C#

 
QuestionRe: How to get the row number from a non-grid view Pin
gmhanna13-May-10 7:02
gmhanna13-May-10 7:02 
QuestionNon blocking TCP Pin
TimSWatson13-May-10 3:51
TimSWatson13-May-10 3:51 
AnswerRe: Non blocking TCP Pin
Alex Manolescu13-May-10 8:48
Alex Manolescu13-May-10 8:48 
AnswerRe: Non blocking TCP Pin
jschell13-May-10 8:56
jschell13-May-10 8:56 
Questionhow to return sublist Pin
igalep13213-May-10 3:30
igalep13213-May-10 3:30 
AnswerRe: how to return sublist Pin
Nuri Ismail13-May-10 3:44
Nuri Ismail13-May-10 3:44 
GeneralRe: how to return sublist Pin
igalep13213-May-10 3:53
igalep13213-May-10 3:53 
GeneralRe: how to return sublist [modified] Pin
Nuri Ismail13-May-10 4:42
Nuri Ismail13-May-10 4:42 
igalep132 wrote:
and after GetRange, i should Clone it ?

It depends on your requirements.

If you really need to avoid shallow copy, then you can make a deep copy on result returned from GetRange.
For this purpose you can use a generic method like this one:
C#
public static T DeepCopy<T>(T obj)
{
    object result = null;

    using (var ms = new MemoryStream())
    {
        var formatter = new BinaryFormatter();
        formatter.Serialize(ms, obj);
        ms.Position = 0;

        result = formatter.Deserialize(ms);
        ms.Close();
    }

    return (T)result;
}


The code above should work for all serializable types. Smile | :)

modified on Thursday, May 13, 2010 10:49 AM

GeneralRe: how to return sublist Pin
igalep13216-May-10 11:26
igalep13216-May-10 11:26 
QuestionApplication/Framework for rapid small-application-development available? Pin
Frygreen13-May-10 2:06
Frygreen13-May-10 2:06 
AnswerRe: Application/Framework for rapid small-application-development available? Pin
Richard MacCutchan13-May-10 3:15
mveRichard MacCutchan13-May-10 3:15 
QuestionSave "app.config" configuration-file does not work Pin
Frygreen13-May-10 1:39
Frygreen13-May-10 1:39 
AnswerRe: Save "app.config" configuration-file does not work Pin
Arun Jacob13-May-10 1:48
Arun Jacob13-May-10 1:48 
GeneralRe: Save "app.config" configuration-file does not work Pin
Frygreen13-May-10 2:10
Frygreen13-May-10 2:10 
AnswerRe: Save "app.config" configuration-file does not work Pin
wasifmuneer13-May-10 1:48
wasifmuneer13-May-10 1:48 
GeneralRe: Save "app.config" configuration-file does not work Pin
Frygreen13-May-10 2:14
Frygreen13-May-10 2:14 
Questionshowing form from thread Pin
Sunshine Always13-May-10 1:15
Sunshine Always13-May-10 1:15 
QuestionRe: showing form from thread Pin
wasifmuneer13-May-10 1:45
wasifmuneer13-May-10 1:45 
AnswerRe: showing form from thread Pin
Sunshine Always13-May-10 2:09
Sunshine Always13-May-10 2:09 
AnswerRe: showing form from thread Pin
Luc Pattyn13-May-10 3:21
sitebuilderLuc Pattyn13-May-10 3:21 
AnswerRe: showing form from thread Pin
The Man from U.N.C.L.E.13-May-10 3:47
The Man from U.N.C.L.E.13-May-10 3:47 
GeneralRe: showing form from thread Pin
Sunshine Always14-May-10 1:41
Sunshine Always14-May-10 1:41 
GeneralRe: showing form from thread Pin
The Man from U.N.C.L.E.14-May-10 3:26
The Man from U.N.C.L.E.14-May-10 3:26 
AnswerRe: showing form from thread Pin
DaveyM6913-May-10 5:31
professionalDaveyM6913-May-10 5:31 
GeneralRe: showing form from thread Pin
The Man from U.N.C.L.E.13-May-10 6:43
The Man from U.N.C.L.E.13-May-10 6:43 

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.