github
Advanced Search
  • Home
  • Pricing and Signup
  • Explore GitHub
  • Blog
  • Login

butaji / Sapphire

  • Admin
  • Watch Unwatch
  • Fork
  • Your Fork
  • Pull Request
  • Download Source
    • 3
    • 2
  • Source
  • Commits
  • Network (2)
  • Issues (0)
  • Downloads (0)
  • Wiki (1)
  • Graphs
  • Branch: master

click here to add a description

click here to add a homepage

  • Branches (2)
    • gh-pages
    • master ✓
  • Tags (0)
Sending Request…
Enable Donations

Pledgie Donations

Once activated, we'll place the following badge in your repository's detail box:
Pledgie_example
This service is courtesy of Pledgie.

SharePoint Application Framework — Read more

  cancel

  cancel
  • Private
  • Read-Only
  • HTTP Read-Only

This URL has Read+Write access

Created custom ControlBuilding behavior (constructor was replaced with 
call SapphireControlBuilder.Build method). Add some logic to 
ErrorVisualizer mechanism, described in SPG. Need to understand why 
WebPart dont processed by custom ControlBuilder. 
butaji (author)
Sun Nov 15 04:16:49 -0800 2009
commit  25896af84627702146bc5dc1b67218255eaa7382
tree    f6909d6e3834ac67e378aef05eff36d047778979
parent  508a79c727024724ecd3dced04239d89eef69fe5
Sapphire / trunk / Sapphire.Application / Application.cs trunk/Sapphire.Application/Application.cs
100644 69 lines (63 sloc) 1.959 kb
edit raw blame history
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
using System;
using Microsoft.Practices.Unity;
using Microsoft.Practices.Unity.InterceptionExtension;
using Sapphire.Web.UI;
 
namespace Sapphire
{
  public class Application : Microsoft.SharePoint.ApplicationRuntime.SPHttpApplication
  {
    private static readonly object LockObject = new object();
    private static IUnityContainer _container;
 
    /// <summary>
    /// Gets and sets the Unity Container
    /// </summary>
    public virtual IUnityContainer Container
    {
      get { return _container; }
      protected set { _container = value; }
    }
 
    /// <summary>
    /// Handles the <see cref="Start"/> event and defines the application lifecycle.
    /// </summary>
    /// <param name="sender">The object firing the event.</param>
    /// <param name="e">The event associated data.</param>
    protected virtual void Application_Start(object sender, EventArgs e)
    {
      CreateContainer();
      AddRequiredServices();
      Start();
    }
 
    /// <summary>
    /// Adds the required application services to the container.
    /// </summary>
    /// <remarks>Override this method to add or change the services available in the container.</remarks>
    protected virtual void AddRequiredServices()
    {
    }
 
    /// <summary>
    /// Creates the application root container.
    /// </summary>
    /// <remarks>Override this method to change the container to be used by the application.</remarks>
    protected virtual void CreateContainer()
    {
      if (Container == null)
      {
        lock (LockObject)
        {
          if (Container == null)
          {
            IUnityContainer container = new UnityContainer();
            Container = container;
            Container.RegisterInstance(Container);
          }
        }
      }
    }
 
    /// <summary>
    /// Override this method to add behavior to be executed once the application has started.
    /// </summary>
    protected virtual void Start()
    {
    }
  }
}
Blog | Support | Training | Contact | API | Status | Twitter | Help | Security
© 2010 GitHub Inc. All rights reserved. | Terms of Service | Privacy Policy
Powered by the Dedicated Servers and
Cloud Computing of Rackspace Hosting®
Dedicated Server