Click here to Skip to main content
15,902,114 members
Home / Discussions / C#
   

C#

 
QuestionAdd to value by key in Dictionary<string, List Pin
Ryan.L. R.11-Oct-07 8:57
Ryan.L. R.11-Oct-07 8:57 
AnswerRe: Add to value by key in Dictionary<string, List Pin
kubben11-Oct-07 9:01
kubben11-Oct-07 9:01 
QuestionRetrieve EMail from Drag'n'Drop out Thunderbird Pin
baerten11-Oct-07 4:42
baerten11-Oct-07 4:42 
AnswerRe: Retrieve EMail from Drag'n'Drop out Thunderbird Pin
VirtualVoid.NET12-Oct-07 2:06
VirtualVoid.NET12-Oct-07 2:06 
QuestionUnit Conversion Method Pin
patrickjamesscott11-Oct-07 4:33
patrickjamesscott11-Oct-07 4:33 
AnswerRe: Unit Conversion Method Pin
Anthony Mushrow11-Oct-07 5:52
professionalAnthony Mushrow11-Oct-07 5:52 
GeneralRe: Unit Conversion Method Pin
patrickjamesscott11-Oct-07 6:15
patrickjamesscott11-Oct-07 6:15 
AnswerRe: Unit Conversion Method [modified] Pin
patrickjamesscott11-Oct-07 6:00
patrickjamesscott11-Oct-07 6:00 
public enum UnitDefs
{
UNDEFINED = 0,
LENGTH, // 1
PRESS, // 2
DPRESS, // 3
MASS, // 4
VOLUME, // 5
TIMEUNIT, // 6
TEMPERATURE, // 7
DENSITY, // 8
MASSFLOW, // 9
VOLFLOW, // 10
EXPANFACT, // 11
VISCOSITY, // 12
HEATVALUE, // 13
ENGYFLWRATE, // 14
VELOCITY, // 15
GASISEEXP, // 16
MYBOOL, // 17
End
}
public enum SysUnits
{
USUNITS = 0, // 1
IPUNITS, // 2
METRICUNITS, // 3
SIUNITS, // 4
End
}
public enum Line
{
m = 0,
b,
End
}
// y = mx + b conversion format
// since C# does not allow for struct->struct->instance, we will have to create a single array
// first dim => current units, second dim => desired units, third dim m=0, b=1
// so instead of names, we are reduced to numbers
public class UnitConv
{
double[, ,] To = new double[(int)SysUnits.End.GetTypeCode(),
(int)SysUnits.End.GetTypeCode(),
(int)Line.End.GetTypeCode()];
}
UnitConv[] ConvFacts = new UnitConv[(int)UnitDefs.End.GetTypeCode()];


Is this the best way?!
This appears to be runtime based resolution, not compile time resolution.
Is there a compile time (c preprocessor) method.
I can use defines which may perform the same replacement operations.

Any ideas?


-- modified at 12:18 Thursday 11th October, 2007
QuestionWinForm controls Pin
half-life11-Oct-07 4:19
half-life11-Oct-07 4:19 
AnswerRe: WinForm controls Pin
Scott Dorman11-Oct-07 4:29
professionalScott Dorman11-Oct-07 4:29 
AnswerRe: WinForm controls Pin
Pete O'Hanlon11-Oct-07 10:30
mvePete O'Hanlon11-Oct-07 10:30 
Questionc# Pin
shen1711-Oct-07 3:52
shen1711-Oct-07 3:52 
AnswerRe: c# Pin
Justin Perez11-Oct-07 4:00
Justin Perez11-Oct-07 4:00 
AnswerRe: c# Pin
Dave Kreskowiak11-Oct-07 4:01
mveDave Kreskowiak11-Oct-07 4:01 
GeneralRe: c# Pin
Colin Angus Mackay11-Oct-07 5:09
Colin Angus Mackay11-Oct-07 5:09 
GeneralRe: c# Pin
Dave Kreskowiak11-Oct-07 5:28
mveDave Kreskowiak11-Oct-07 5:28 
JokeRe: c# Pin
PIEBALDconsult11-Oct-07 5:22
mvePIEBALDconsult11-Oct-07 5:22 
GeneralRe: c# Pin
BoneSoft11-Oct-07 5:49
BoneSoft11-Oct-07 5:49 
GeneralRe: c# Pin
MasterSharp11-Oct-07 6:37
MasterSharp11-Oct-07 6:37 
GeneralRe: c# Pin
Pete O'Hanlon11-Oct-07 11:30
mvePete O'Hanlon11-Oct-07 11:30 
AnswerRe: c# Pin
GuyThiebaut11-Oct-07 8:14
professionalGuyThiebaut11-Oct-07 8:14 
AnswerWell Pin
Ennis Ray Lynch, Jr.11-Oct-07 8:55
Ennis Ray Lynch, Jr.11-Oct-07 8:55 
Questionhiding option Pin
netJP12L11-Oct-07 3:49
netJP12L11-Oct-07 3:49 
AnswerRe: hiding option Pin
TJoe11-Oct-07 3:51
TJoe11-Oct-07 3:51 
AnswerRe: hiding option Pin
Pete O'Hanlon11-Oct-07 11:48
mvePete O'Hanlon11-Oct-07 11:48 

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.