c# - Build a list of options based on an array -


how go programmatic making list? need combinations

string[] list = { "open", "completed","rescheduled", "canceled", "started",     "customer notified", "do not move", "needs confirmation" }; 

this list first 15 there on 200+ combinations.

  1. open
  2. completed
  3. open, completed
  4. rescheduled
  5. open, rescheduled
  6. completed, rescheduled
  7. open, completed, rescheduled
  8. canceled
  9. open, canceled
  10. completed canceled
  11. open, completed, canceled
  12. rescheduled, canceled
  13. open, rescheduled, canceled
  14. completed, rescheduled, canceled
  15. open, completed, rescheduled, canceled

don't use lists it. try use enum , attribute flags like:

[flags] public enum status {     open = 0x01,     completed = 0x02,     rescheduled = 0x04,     canceled = 0x08,     started = 0x10,     customer_notified = 0x20,     do_not_move = 0x40,     needs_confirmation = 0x80 } 

then can set few statuses @ once field like

var status = status.open | status.completed 

Comments

Popular posts from this blog

Android : Making Listview full screen -

javascript - Parse JSON from the body of the POST -

javascript - How to Hide Date Menu from Datepicker in yii2 -