Click here to Skip to main content
15,919,931 members
Home / Discussions / C#
   

C#

 
GeneralRe: Hashsets and objects.. Pin
Luc Pattyn26-Apr-09 11:14
sitebuilderLuc Pattyn26-Apr-09 11:14 
QuestionSelected ListViewItem Pin
Saksida Bojan26-Apr-09 9:06
Saksida Bojan26-Apr-09 9:06 
AnswerRe: Selected ListViewItem Pin
Roberto Ho26-Apr-09 13:18
Roberto Ho26-Apr-09 13:18 
GeneralRe: Selected ListViewItem Pin
Saksida Bojan26-Apr-09 21:36
Saksida Bojan26-Apr-09 21:36 
QuestionSave data Pin
Star0926-Apr-09 7:59
Star0926-Apr-09 7:59 
AnswerRe: Save data Pin
OriginalGriff26-Apr-09 8:09
mveOriginalGriff26-Apr-09 8:09 
GeneralRe: Save data Pin
Star0926-Apr-09 8:13
Star0926-Apr-09 8:13 
GeneralRe: Save data Pin
OriginalGriff26-Apr-09 8:36
mveOriginalGriff26-Apr-09 8:36 
This is not the recommended way to do this, but I am a little pushed for time...

using System;
using System.Collections.Generic;

namespace Demo
    {
    class SaveResults
        {
        public string results;
        }

    class Program
        {
        public static List<saveresults> listResults = new List<saveresults>();
        static void Main(string[] args)
            {
            // blah de blah
            foreach (SaveResults sr in listResults)
                {
                // Handle results
                Console.WriteLine(sr.results);
                }
            }
        }

    class Processing
        {
        void DoSomething()
            {
            // Blah de blah
            SaveResults sr = new SaveResults();
            sr.results = "hello";
            Program.listResults.Add(sr);
            }
        }
    }
</saveresults></saveresults>


Each time you get results, you create a new instance of the SaveResults class, storing the info you need later (Processing.DoSomething). You then add this to a static list (in program class here so that it persists until the app ends - you will have a better place, I am sure). When all processing is done, just iterrate through the List<t> and handle each answer in turn.

No trees were harmed in the sending of this message; however, a significant number of electrons were slightly inconvenienced.

This message is made of fully recyclable Zeros and Ones

GeneralRe: Save data Pin
Star0926-Apr-09 8:38
Star0926-Apr-09 8:38 
QuestionWPF DatePiker Pin
Mohammed Elkholy26-Apr-09 5:37
Mohammed Elkholy26-Apr-09 5:37 
QuestionRe: WPF DatePiker Pin
fly90426-Apr-09 5:57
fly90426-Apr-09 5:57 
AnswerRe: WPF DatePiker Pin
Mohammed Elkholy26-Apr-09 11:36
Mohammed Elkholy26-Apr-09 11:36 
GeneralRe: WPF DatePiker Pin
fly90426-Apr-09 11:56
fly90426-Apr-09 11:56 
GeneralRe: WPF DatePiker Pin
Mohammed Elkholy26-Apr-09 12:01
Mohammed Elkholy26-Apr-09 12:01 
GeneralRe: WPF DatePiker Pin
Mohammed Elkholy28-Apr-09 2:14
Mohammed Elkholy28-Apr-09 2:14 
QuestionSending requst with sent cookies Pin
Gindi Bar Yahav26-Apr-09 5:36
Gindi Bar Yahav26-Apr-09 5:36 
Question[Message Deleted] Pin
hkjghkj126-Apr-09 3:34
hkjghkj126-Apr-09 3:34 
AnswerRe: Button positioning Pin
Luc Pattyn26-Apr-09 3:46
sitebuilderLuc Pattyn26-Apr-09 3:46 
QuestionSimple video player with subtitles? Pin
neonova26-Apr-09 2:06
neonova26-Apr-09 2:06 
AnswerRe: Simple video player with subtitles? Pin
harold aptroot26-Apr-09 3:09
harold aptroot26-Apr-09 3:09 
GeneralRe: Simple video player with subtitles? Pin
neonova26-Apr-09 7:19
neonova26-Apr-09 7:19 
GeneralRe: Simple video player with subtitles? Pin
harold aptroot26-Apr-09 7:34
harold aptroot26-Apr-09 7:34 
QuestionSingle Instance and Task Scheduler Creating Trouble. Pin
Dev S26-Apr-09 2:04
Dev S26-Apr-09 2:04 
AnswerRe: Single Instance and Task Scheduler Creating Trouble. Pin
Joel Ivory Johnson26-Apr-09 3:53
professionalJoel Ivory Johnson26-Apr-09 3:53 
QuestionHow to hide process !!! Pin
elther326-Apr-09 1:26
elther326-Apr-09 1:26 

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.