Glyma.NodeServiceApp.NodeService.CreateApplication C# (CSharp) Method

CreateApplication() public method

public CreateApplication ( string name, Type serviceApplicationType, SPServiceProvisioningContext provisioningContext ) : SPServiceApplication
name string
serviceApplicationType System.Type
provisioningContext SPServiceProvisioningContext
return SPServiceApplication
        public SPServiceApplication CreateApplication(string name, Type serviceApplicationType, SPServiceProvisioningContext provisioningContext)
        {
            if (serviceApplicationType != typeof(NodeServiceApplication))
            {
                throw new NotSupportedException();
            }

            if (provisioningContext == null)
            {
                throw new ArgumentNullException("provisioningContext");
            }

            // If the service doesn't already exist, create it.
            NodeServiceApplication serviceApp = this.Farm.GetObject(name, this.Id, serviceApplicationType) as NodeServiceApplication;

            if (serviceApp == null)
            {
                serviceApp = NodeServiceApplication.Create(name, this, provisioningContext.IisWebServiceApplicationPool);
            }

            return serviceApp;
        }