Advertisement
Guest User

drachenstern

a guest
Oct 20th, 2010
159
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.99 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.     [WebService( Namespace = "http://localhost:2530/WidgetHandler.asmx" )]
  40.     [WebServiceBinding( ConformsTo = WsiProfiles.BasicProfile1_1 )]
  41.     [ScriptService]
  42.     public class WidgetHandler : WebService {
  43.         // a whole lot of other code removed from here
  44.         // yes I'm sure there's a linq method that works better than this, but it works, doesn't it?
  45.         [WebMethod]
  46.         public void UpdatePositions(List<WidgetPageItems> Items) {
  47.             int counter = 0;
  48.             foreach ( WidgetPageItems w in Items ) {
  49.                 w.ColumnOrder = counter;
  50.                 counter++;
  51.             }
  52.             _bll.UpdateWidget( Items );
  53.         }
  54.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement