protected void SelfRegister(System.Web.UI.UserControl control)
        {
            if (control != null && control is IView)
            {
                object[] attributes = control.GetType().GetCustomAttributes(typeof(PresenterTypeAttribute), true);

                if (attributes != null && attributes.Length > 0)
                {
                    foreach (Attribute viewAttribute in attributes)
                    {
                        if (viewAttribute is PresenterTypeAttribute)
                        {
                            //Had to grab the application context that gets created in the global.asax and shoved into the httpcontext.current.items collection.  In order to use it I have to assign it to the ISessionProvider because presenters have no knowledge of httpcontext.
                            var sessionProvider = new WebSessionProvider();
                            SessionManager.Current = sessionProvider;
                            //if (HttpContext.Current.Items[ResourceStrings.Session_ApplicationContext] != null)
                            //{
                            //    SessionManager.Current[ResourceStrings.Session_ApplicationContext] = (ApplicationContext)HttpContext.Current.Items[ResourceStrings.Session_ApplicationContext];
                            //}
                            PresentationManager.RegisterView((viewAttribute as PresenterTypeAttribute).PresenterType, control as IView, sessionProvider);

                            if (SecurityContextManager.Current == null)
                            {
                                SecurityContextManager.Current = new WebSecurityContext();
                            }
                            break;
                        }
                    }
                }
            }
        }
示例#2
0
 public ProgrammMethods(TabControl tabControl, WebSessionProvider webSessionProvider, Form1 form1, NotifyIcon notifyIcon1, AddressBox addressBox1, Panel splitContainerUp, Timer timer)
 {
     NOW                     = new NavigationOnWebControl();
     TCA                     = new TabControlAwesomium(tabControl, webSessionProvider, this);
     this.formGUI            = form1;
     this.notifyIcon1        = notifyIcon1;
     this.tabControl         = tabControl;
     this.webSessionProvider = webSessionProvider;
     this.addressBox1        = addressBox1;
     this.splitContainerUp   = splitContainerUp;
     this.timer              = timer;
 }
示例#3
0
        protected void Page_Load(object sender, EventArgs e)
        {
            ISessionProvider  session   = new WebSessionProvider();
            ViewCasePresenter presenter = new ViewCasePresenter(this, session);

            if (!IsPostBack)
            {
                if (Request.QueryString["id"] != null)
                {
                    session["caseID"] = Request.QueryString["id"];
                }
            }
            presenter.Initialize();
        }
示例#4
0
 public ProgrammMethods(TabControl tabControl, WebSessionProvider webSessionProvider)
 {
     NOW = new NavigationOnWebControl();
     TCA = new TabControlAwesomium(tabControl, webSessionProvider);
 }
 /// <summary>
 /// Инициализирует новый экземпляр класса TabControlAwesomium
 /// </summary>
 /// <param name="tabControl">Объект tabControl, с которым будет работать класс</param>
 /// <param name="webSessionProvider">Объект webSessionProvider,  с которым будет работать класс</param>
 public TabControlAwesomium(TabControl tabControl, WebSessionProvider webSessionProvider)
 {
     this.tabControl         = tabControl;
     this.webSessionProvider = webSessionProvider;
 }
示例#6
0
 /// <summary>
 /// Инициализирует новый экземпляр класса TabControlAwesomium
 /// </summary>
 /// <param name="tabControl">Объект tabControl, с которым будет работать класс</param>
 /// <param name="webSessionProvider">Объект webSessionProvider,  с которым будет работать класс</param>
 public TabControlAwesomium(TabControl tabControl, WebSessionProvider webSessionProvider, ProgrammMethods pm)
 {
     this.tabControl         = tabControl;
     this.webSessionProvider = webSessionProvider;
     this.pm = pm;
 }