Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
P

Paul_Williams

@Paul_Williams
About
Posts
3
Topics
1
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • Error 'not all code paths return a value'
    P Paul_Williams

    In your example there would be nothing to return if value where not one of the handled cases. You need to specify a return value for ALL cases or throw an exception for invalid values. One way to do this is by using the default case in your switch statement. Here is an example:

    public class EventCode
    {
    public static string ToXml(Soap.EventCode.EvCodes value)
    {
    switch (value)
    {
    case Soap.EventCode.EvCodes.DispatchedForDelivery:
    case Soap.EventCode.EvCodes.Delivered:
    return "OD";
    case Soap.EventCode.EvCodes.DepartedFromTerminal:
    return "L1";
    // Catch-all for all other cases.
    // Throwing an exception here is just an example implementation, not mandatory.
    default: throw new ArgumentOutOfRangeException(nameof(value), "Unsupported Evcode: " + value);

           }
       }
    

    }

    C# help wcf xml

  • Newsletter - Filter out Metro articles?
    P Paul_Williams

    Thanks, will give it a try.

    Site Bugs / Suggestions question

  • Newsletter - Filter out Metro articles?
    P Paul_Williams

    Hi, I currently do not have much interest in reading articles, tips etc about Metro apps. Is there an easy way to filter these out from the weekly newsletter? e.g. !Metro in the 'Newsletter topics' filter would be much simpler than listing all the possible topics I would be interested in. Thanks advance for any ideas. Paul

    Site Bugs / Suggestions question
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups