.net - Map two enumerations to a third single enumeration -


what best way in c# map combination of 2 enumerations third enumeration?

basically need class static method can accept enumerationa , enumerationb , in method or class have static mapping enumeration should return x,y combination.

does have examples?

your question unclear, here's guess @ want.

public enum { x, ... } public enum b { y, z, ... } public enum c { cat, dog, ... }  private static readonly dictionary<tuple<a, b>, c> lookup =     new dictionary<tuple<a, b>, c>     {         { tuple.create(a.x, b.y), c.cat },         { tuple.create(a.x, b.z), c.dog },         ...etc...     };  public static c lookup(a a, b b) {     return lookup[tuple.create(a, b)]; } 

Comments

Popular posts from this blog

java - JavaFX 2 slider labelFormatter not being used -

Detect support for Shoutcast ICY MP3 without navigator.userAgent in Firefox? -

web - SVG not rendering properly in Firefox -