logic - C# Visible values of enum -


i beginner in programming , have problem enums. maybe impossible want. here code:

    public static class  browser     {        public static webbrowser browser = webbrowser.ie;        public static resolution resolution = getres(browser);         public static resolution getres(webbrowser browser)        {            resolution res;            if(browser == webbrowser.chrome)            {                // compilator_error: res = resolution._800x600;                // not_error: res = resolution._1024x768;             }             return res;        }     }          public enum webbrowser {     chrome, firefox, ie, opera } public enum resolution {     _800x600, _1024x768, _1280x800 } 

i have created method want magic. if browser webbrowser.chrome, res visible _1024x768, _1280x800 resolution. if not, compilator error. maybe bad solution enums, hope understand want do. there optimal way how this?


Comments

Popular posts from this blog

Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.12:test (default-test) on project.Error occurred in starting fork -

windows - Debug iNetMgr.exe unhandle exception System.Management.Automation.CmdletInvocationException -

configurationsection - activeMq-5.13.3 setup configurations for wildfly 10.0.0 -