Click here to Skip to main content
15,903,201 members
Home / Discussions / C#
   

C#

 
GeneralRe: How to make the ListView to display each thumbnail immediately after it's loaded? Pin
alin14-Nov-17 7:41
alin14-Nov-17 7:41 
GeneralRe: How to make the ListView to display each thumbnail immediately after it's loaded? Pin
Sascha Lefèvre4-Nov-17 7:55
professionalSascha Lefèvre4-Nov-17 7:55 
GeneralRe: How to make the ListView to display each thumbnail immediately after it's loaded? Pin
alin14-Nov-17 8:23
alin14-Nov-17 8:23 
GeneralRe: How to make the ListView to display each thumbnail immediately after it's loaded? Pin
Sascha Lefèvre4-Nov-17 8:29
professionalSascha Lefèvre4-Nov-17 8:29 
GeneralRe: How to make the ListView to display each thumbnail immediately after it's loaded? Pin
alin15-Nov-17 2:41
alin15-Nov-17 2:41 
GeneralRe: How to make the ListView to display each thumbnail immediately after it's loaded? Pin
Sascha Lefèvre5-Nov-17 2:53
professionalSascha Lefèvre5-Nov-17 2:53 
GeneralRe: How to make the ListView to display each thumbnail immediately after it's loaded? Pin
alin15-Nov-17 3:09
alin15-Nov-17 3:09 
GeneralRe: How to make the ListView to display each thumbnail immediately after it's loaded? Pin
Sascha Lefèvre5-Nov-17 3:43
professionalSascha Lefèvre5-Nov-17 3:43 
GeneralRe: How to make the ListView to display each thumbnail immediately after it's loaded? Pin
alin15-Nov-17 4:58
alin15-Nov-17 4:58 
GeneralRe: How to make the ListView to display each thumbnail immediately after it's loaded? Pin
alin15-Nov-17 13:22
alin15-Nov-17 13:22 
GeneralRe: How to make the ListView to display each thumbnail immediately after it's loaded? Pin
Sascha Lefèvre5-Nov-17 20:52
professionalSascha Lefèvre5-Nov-17 20:52 
GeneralRe: How to make the ListView to display each thumbnail immediately after it's loaded? Pin
alin16-Nov-17 2:56
alin16-Nov-17 2:56 
GeneralRe: How to make the ListView to display each thumbnail immediately after it's loaded? Pin
Sascha Lefèvre6-Nov-17 3:00
professionalSascha Lefèvre6-Nov-17 3:00 
GeneralRe: How to make the ListView to display each thumbnail immediately after it's loaded? Pin
Gerry Schmitz4-Nov-17 7:39
mveGerry Schmitz4-Nov-17 7:39 
QuestionRun List Of Tasks Sequentially and Process Them As The Complete Pin
Kevin Marois1-Nov-17 8:47
professionalKevin Marois1-Nov-17 8:47 
AnswerRe: Run List Of Tasks Sequentially and Process Them As The Complete Pin
ZurdoDev1-Nov-17 9:37
professionalZurdoDev1-Nov-17 9:37 
AnswerRe: Run List Of Tasks Sequentially and Process Them As The Complete Pin
Sascha Lefèvre1-Nov-17 10:31
professionalSascha Lefèvre1-Nov-17 10:31 
AnswerRe: Run List Of Tasks Sequentially and Process Them As The Complete Pin
BillWoodruff2-Nov-17 17:56
professionalBillWoodruff2-Nov-17 17:56 
AnswerRe: Run List Of Tasks Sequentially and Process Them As The Complete Pin
MadMyche14-Nov-17 8:35
professionalMadMyche14-Nov-17 8:35 
QuestionC#+WebBrowser+JavaScript - full download Pin
kama_kama31-Oct-17 12:03
kama_kama31-Oct-17 12:03 
QuestionRe: C#+WebBrowser+JavaScript - full download Pin
Karthik_Mahalingam31-Oct-17 17:00
professionalKarthik_Mahalingam31-Oct-17 17:00 
AnswerRe: C#+WebBrowser+JavaScript - full download Pin
kama_kama31-Oct-17 20:08
kama_kama31-Oct-17 20:08 
QuestionWhat's The Best Way To Do This? Pin
Kevin Marois31-Oct-17 7:04
professionalKevin Marois31-Oct-17 7:04 
We have 2 files with settings in them.

The first is a constants file that has all kinds of data in it:
public struct General
{
    public static float FAIL_CODE = -999999;
    public static int BayPort = 0xc000;
}

public struct Thermal
{
    public static float Gi = 1;
    public static float Gv = 4.0875f;
    public static int Resistance = 1;
    public static int Temp = 0;
}

public struct BlisterMotor
{
    public static uint MIN_BLISTER_POSITION = 0;
    public static uint MAX_BLISTER_POSITION = 56250;
}
The other is an embedded xml file resource:
<Parameter>
    <Name>Effector</Name>
    <Value>150</Value>
</Parameter>
<Parameter>
    <Name>SampleHeaterSetPoint</Name>
    <Value>66</Value>
</Parameter>
<Parameter>
    <Name>SampleHeaterSamples</Name>
    <Value>18</Value>
</Parameter>

We want to make all of this user editable with a UI, so I want to serialize all of them to XML.

I'm trying to find a way to do this with generics, so...
public class Setting<T>
{
    public T SettingValue { get; set; }
    public T MinValue { get; set; }
    public T MaxValue { get; set; }
    public string Key { get; set; }
    public string Description { get; set; }
}
Then a class to hold all of them:
public List<Setting> MySettings { get; set; }
But this won't compile because the Setting class in the List<> requires a type argument.

But I don't see how this would work with generics. That really only leave overriding the base class with a different type for each:
public List<SettingBase> MySettings { get; set; }

public class SettingBase
{
    public string Key { get; set; }
    public string Description { get; set; }
}

public class SettingInt : SettingBase
{
    public int SettingValue { get; set; }
    public int MinValue { get; set; }
    public int MaxValue { get; set; }
}

public class SettingDouble : SettingBase
{
    public double SettingValue { get; set; }
    public double MinValue { get; set; }
    public double MaxValue { get; set; }
}

Anyone have a better idea?
If it's not broken, fix it until it is.
Everything makes sense in someone's mind.
Ya can't fix stupid.

AnswerRe: What's The Best Way To Do This? Pin
Gerry Schmitz31-Oct-17 12:08
mveGerry Schmitz31-Oct-17 12:08 
GeneralRe: What's The Best Way To Do This? Pin
Rob Philpott1-Nov-17 3:04
Rob Philpott1-Nov-17 3: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.