﻿using System;
using System.Globalization;
using System.IO;
using Microsoft.SharePoint.Administration;
using Microsoft.SharePoint.Utilities;

namespace CvrService.Service
{
    [System.Runtime.InteropServices.Guid("E36D38F0-B3BD-45C4-84A5-C4D156311B99")]
    public class CvrServiceApplication : SPIisWebServiceApplication
    {
        #region Constructors
        public CvrServiceApplication() { }
        public CvrServiceApplication(string name, CvrService service, SPIisWebServiceApplicationPool applicationPool) : base(name, service, applicationPool) { }
        #endregion

        #region Overrides of SPIisWebServiceApplication
        public override string TypeName
        {
            get { return "CVR Service Application"; }
        }
        public override SPAdministrationLink ManageLink
        {
            get { return new SPAdministrationLink(string.Format(CultureInfo.InvariantCulture, "/_admin/CvrService/ManageApplication.aspx?{0}", SPHttpUtility.UrlKeyValueEncode("id", Id.ToString()))); }
        }
        public override SPAdministrationLink PropertiesLink
        {
            get { return new SPAdministrationLink(string.Format(CultureInfo.InvariantCulture, "/_admin/CvrService/Properties.aspx?{0}", SPHttpUtility.UrlKeyValueEncode("id", Id.ToString()))); }
        }
        public override Guid ApplicationClassId
        {
            get { return new Guid("7FC0B4C1-2FAE-4632-8B0B-44B31B8357B0"); }
        }
        public override Version ApplicationVersion
        {
            get { return new Version("1.0.0.0"); }
        }
        protected override string InstallPath
        {
            get { return Path.GetFullPath(SPUtility.GetGenericSetupPath(@"WebServices\CvrService")); }
        }

        protected override string VirtualPath
        {
            get { return "CvrService.svc"; }
        }

        #endregion
    }
}