Advertisement
Guest User

drachenstern

a guest
Oct 20th, 2010
134
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.71 KB | None | 0 0
  1. //For posting to SO http://stackoverflow.com/questions/3982616/deserializing-json-to-c
  2.  
  3.     public class WidgetPageItems {
  4.         public WidgetPageItems( ) {
  5.             CanClose = true;
  6.             Custom = string.Empty;
  7.             Width = 0;
  8.             Settings = string.Empty;
  9.             Height = 0;
  10.             MinHeight = 0;
  11.             ColumnOrder = 0;
  12.             MaxHeight = 0;
  13.             CanHide = true;
  14.             Collapsed = false;
  15.             CanRefresh = true;
  16.             RefreshOnColumnChange = false;
  17.             FileName = string.Empty;
  18.             Title = string.Empty;
  19.         }
  20.  
  21.         public Guid Parent { get; set; }
  22.         public Guid ID { get; set; }
  23.         public string Title { get; set; }
  24.         public string FileName { get; set; }
  25.         public string Custom { get; set; }
  26.         public string Settings { get; set; }
  27.         public int Width { get; set; }
  28.         public int Height { get; set; }
  29.         public int MinHeight { get; set; }
  30.         public int MaxHeight { get; set; }
  31.         public int ColumnOrder { get; set; }
  32.         public bool CanHide { get; set; }
  33.         public bool CanClose { get; set; }
  34.         public bool Collapsed { get; set; }
  35.         public bool CanRefresh { get; set; }
  36.         public bool RefreshOnColumnChange { get; set; }
  37.     }
  38.  
  39.     // yes I'm sure there's a linq method that works better than this, but it works, doesn't it?
  40.         [WebMethod]
  41.         public void UpdatePositions(List<WidgetPageItems> Items) {
  42.             int counter = 0;
  43.             foreach ( WidgetPageItems w in Items ) {
  44.                 w.ColumnOrder = counter;
  45.                 counter++;
  46.             }
  47.             _bll.UpdateWidget( Items );
  48.         }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement