Back to list
Views:   0
Replies:  0
Archived
,
Reply 1
I personally put it in the Model.cs since all my views bind to Presenter.cs in some way.

public class TabbedPresenter<T> : Presenter<T> where T : ITabPageView, IView 
{ 
   public TabbedPresenter(T view) : base(view) {} 

   protected virtual void WireUpEvents() 
   { 
       if (Model.IsUserAllowedAccess("Edit")) 
       { 
           editOption.Enabled  = true; 
           editOption.Click += new EventHandler(View.OnEditClick); 
       } 
   }
   protected virtual void TearDownEvents() 
   { 
       editOption.Enabled = false; 
       editOption.Click -= new EventHandler(View.OnEditClick); 
   }  
} 

The "IsUserAllowedAccess" method in Model.cs calls on a static instance of UserSession class.  Now it is accessible by all my views and forms.
 
Robert Blair, Feb 16, 2011
Stay Inspired!
Join other developers and designers who have already signed up for our mailing list.
Terms     Privacy     Licensing       EULA       Sitemap      
© Data & Object Factory, LLC.
Made with    in Austin, Texas