Naethra D avatar Naethra D committed ba1cb57

New Source folder added.

Comments (0)

Files changed (338)

Source/Excel/Excel.Add-in.sln

+
+Microsoft Visual Studio Solution File, Format Version 11.00
+# Visual Studio 2010
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Excel.AddIn", "Excel.AddIn\Excel.AddIn\Excel.AddIn.csproj", "{BA497EE4-C2F9-44D0-97CF-597EBEBF8A85}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Excel.Common", "Excel.Common\Excel.Common.csproj", "{9A6FA981-B98A-48D9-8EFE-2ED9C6A2E40D}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Excel.BizLogic", "Excel.BizLogic\Excel.BizLogic.csproj", "{D4667682-A6E5-446B-AE68-68C5FAB8681D}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Web.Service.Model", "..\WebService\Web.Service.Model\Web.Service.Model.csproj", "{20D9F94F-AABB-4A90-83F5-14628F75B547}"
+EndProject
+Global
+	GlobalSection(SolutionConfigurationPlatforms) = preSolution
+		Debug|Any CPU = Debug|Any CPU
+		Debug|Mixed Platforms = Debug|Mixed Platforms
+		Debug|x86 = Debug|x86
+		Release|Any CPU = Release|Any CPU
+		Release|Mixed Platforms = Release|Mixed Platforms
+		Release|x86 = Release|x86
+	EndGlobalSection
+	GlobalSection(ProjectConfigurationPlatforms) = postSolution
+		{BA497EE4-C2F9-44D0-97CF-597EBEBF8A85}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+		{BA497EE4-C2F9-44D0-97CF-597EBEBF8A85}.Debug|Any CPU.Build.0 = Debug|Any CPU
+		{BA497EE4-C2F9-44D0-97CF-597EBEBF8A85}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
+		{BA497EE4-C2F9-44D0-97CF-597EBEBF8A85}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
+		{BA497EE4-C2F9-44D0-97CF-597EBEBF8A85}.Debug|x86.ActiveCfg = Debug|Any CPU
+		{BA497EE4-C2F9-44D0-97CF-597EBEBF8A85}.Release|Any CPU.ActiveCfg = Release|Any CPU
+		{BA497EE4-C2F9-44D0-97CF-597EBEBF8A85}.Release|Any CPU.Build.0 = Release|Any CPU
+		{BA497EE4-C2F9-44D0-97CF-597EBEBF8A85}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
+		{BA497EE4-C2F9-44D0-97CF-597EBEBF8A85}.Release|Mixed Platforms.Build.0 = Release|Any CPU
+		{BA497EE4-C2F9-44D0-97CF-597EBEBF8A85}.Release|x86.ActiveCfg = Release|Any CPU
+		{9A6FA981-B98A-48D9-8EFE-2ED9C6A2E40D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+		{9A6FA981-B98A-48D9-8EFE-2ED9C6A2E40D}.Debug|Any CPU.Build.0 = Debug|Any CPU
+		{9A6FA981-B98A-48D9-8EFE-2ED9C6A2E40D}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
+		{9A6FA981-B98A-48D9-8EFE-2ED9C6A2E40D}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
+		{9A6FA981-B98A-48D9-8EFE-2ED9C6A2E40D}.Debug|x86.ActiveCfg = Debug|Any CPU
+		{9A6FA981-B98A-48D9-8EFE-2ED9C6A2E40D}.Release|Any CPU.ActiveCfg = Release|Any CPU
+		{9A6FA981-B98A-48D9-8EFE-2ED9C6A2E40D}.Release|Any CPU.Build.0 = Release|Any CPU
+		{9A6FA981-B98A-48D9-8EFE-2ED9C6A2E40D}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
+		{9A6FA981-B98A-48D9-8EFE-2ED9C6A2E40D}.Release|Mixed Platforms.Build.0 = Release|Any CPU
+		{9A6FA981-B98A-48D9-8EFE-2ED9C6A2E40D}.Release|x86.ActiveCfg = Release|Any CPU
+		{D4667682-A6E5-446B-AE68-68C5FAB8681D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+		{D4667682-A6E5-446B-AE68-68C5FAB8681D}.Debug|Any CPU.Build.0 = Debug|Any CPU
+		{D4667682-A6E5-446B-AE68-68C5FAB8681D}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
+		{D4667682-A6E5-446B-AE68-68C5FAB8681D}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
+		{D4667682-A6E5-446B-AE68-68C5FAB8681D}.Debug|x86.ActiveCfg = Debug|Any CPU
+		{D4667682-A6E5-446B-AE68-68C5FAB8681D}.Release|Any CPU.ActiveCfg = Release|Any CPU
+		{D4667682-A6E5-446B-AE68-68C5FAB8681D}.Release|Any CPU.Build.0 = Release|Any CPU
+		{D4667682-A6E5-446B-AE68-68C5FAB8681D}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
+		{D4667682-A6E5-446B-AE68-68C5FAB8681D}.Release|Mixed Platforms.Build.0 = Release|Any CPU
+		{D4667682-A6E5-446B-AE68-68C5FAB8681D}.Release|x86.ActiveCfg = Release|Any CPU
+		{20D9F94F-AABB-4A90-83F5-14628F75B547}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+		{20D9F94F-AABB-4A90-83F5-14628F75B547}.Debug|Any CPU.Build.0 = Debug|Any CPU
+		{20D9F94F-AABB-4A90-83F5-14628F75B547}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
+		{20D9F94F-AABB-4A90-83F5-14628F75B547}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
+		{20D9F94F-AABB-4A90-83F5-14628F75B547}.Debug|x86.ActiveCfg = Debug|Any CPU
+		{20D9F94F-AABB-4A90-83F5-14628F75B547}.Release|Any CPU.ActiveCfg = Release|Any CPU
+		{20D9F94F-AABB-4A90-83F5-14628F75B547}.Release|Any CPU.Build.0 = Release|Any CPU
+		{20D9F94F-AABB-4A90-83F5-14628F75B547}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
+		{20D9F94F-AABB-4A90-83F5-14628F75B547}.Release|Mixed Platforms.Build.0 = Release|Any CPU
+		{20D9F94F-AABB-4A90-83F5-14628F75B547}.Release|x86.ActiveCfg = Release|Any CPU
+	EndGlobalSection
+	GlobalSection(SolutionProperties) = preSolution
+		HideSolutionNode = FALSE
+	EndGlobalSection
+EndGlobal
Add a comment to this file

Source/Excel/Excel.Add-in.suo

Binary file added.

Source/Excel/Excel.AddIn/Excel.AddIn/Controller/Controller.cs

+
+using System;
+using System.Collections.Generic;
+using System.IO;
+using System.Linq;
+using System.Windows.Forms;
+using DataUp.Excel.Addin.Properties;
+using DataUp.Excel.BizLogic;
+
+namespace DataUp.Excel.Addin
+{
+    /// <summary>
+    /// TODO: Update summary.
+    /// </summary>
+    internal class Controller
+    {
+        private static Controller instance;
+        private static List<RepositoryModel> cacheRepositoryDetails;
+        private TaskPane taskPane;
+        private Ribbon ribbon;
+        private IExcelManager excelManager;
+        private IMetadataManager metadataManager;
+        private IRepositoryManager repositoryManager;
+        private string userPassword = string.Empty;
+
+        private string[] identifierList;
+        private string[] citationList;
+
+        /// <summary>
+        /// Gets the respotiory cache details list.
+        /// </summary>
+        public static List<RepositoryModel> CacheRepositoryDetails
+        {
+            get
+            {
+                return cacheRepositoryDetails;
+            }
+        }
+
+        private Controller()
+        {
+            // TODO : Need to get these list from some xml file based or somewhere else where the user can configure the values based on the selected metadata XML.
+            identifierList = new string[] { "Creator: First name", "Today's date", "Title of dataset" };
+
+            citationList = new string[] { "Creator: First name", "Today's date", "Title of dataset", "Keyword thesaurus used", "Repository name and contact information", Common.Constants.IdentifierKeyName };
+
+            cacheRepositoryDetails = new List<RepositoryModel>();
+        }
+
+        /// <summary>
+        /// Gets Controller instance
+        /// </summary>
+        internal static Controller Instance
+        {
+            get
+            {
+                if (instance == null)
+                {
+                    instance = new Controller();
+                }
+
+                return instance;
+            }
+        }
+
+        internal void Initialize(TaskPane taskPane, Ribbon ribbon)
+        {
+            if (taskPane != null && ribbon != null)
+            {
+                this.taskPane = taskPane;
+                this.ribbon = ribbon;
+
+                cacheRepositoryDetails = new List<RepositoryModel>();
+
+                Globals.ThisAddIn.Application.WorkbookActivate += new Microsoft.Office.Interop.Excel.AppEvents_WorkbookActivateEventHandler(OnWorkbookActivate);
+
+                var activeWorkBook = Globals.ThisAddIn.Application.ActiveWorkbook;
+
+                /** This condition will always be true when a new workbook has been created, 
+                    but when we reopen the existing workbook it would require some time
+                    to load the active workbook, by then its value will be null. So, wait for 
+                    WorkbookActivate event execute and hookup the SheetChange event handler inside 
+                 **/
+                if (activeWorkBook != null)
+                {
+                    activeWorkBook.SheetChange += new Microsoft.Office.Interop.Excel.WorkbookEvents_SheetChangeEventHandler(OnSheetChange);
+                }
+
+                this.AttachRibbonHandlers();
+                this.InitializeManagers();
+            }
+        }
+
+        public void FixAllErrors()
+        {
+            try
+            {
+                if (excelManager != null)
+                {
+                    excelManager.FixAll();
+                }
+            }
+            catch (Exception ex)
+            {
+                MessageBox.Show(ex.Message, Resources.DialogTitle);
+            }
+        }
+
+        public void FixError(ErrorDetailViewModel error)
+        {
+            try
+            {
+                if (excelManager != null)
+                {
+                    ErrorDetail errorDetail = new ErrorDetail();
+                    errorDetail = errorDetail.SetValuesFrom(error);
+                    excelManager.FixError(errorDetail);
+
+                    var currentSheet = this.taskPane.ErrorDetails.Model.SelectedSheet.SheetName;
+
+                    Validate(false);
+
+                    this.taskPane.ErrorDetails.Model.SelectSheet(currentSheet);
+                }
+            }
+            catch (Exception ex)
+            {
+                MessageBox.Show(ex.Message, Resources.DialogTitle);
+            }
+        }
+
+        public void FixErrors(List<ErrorDetailViewModel> errors)
+        {
+            try
+            {
+                if (excelManager != null)
+                {
+                    List<ErrorDetail> errorDetails = new List<ErrorDetail>();
+
+                    foreach (var error in errors)
+                    {
+                        ErrorDetail errorDetail = new ErrorDetail();
+                        errorDetail = errorDetail.SetValuesFrom(error);
+                        errorDetails.Add(errorDetail);
+                    }
+
+                    excelManager.FixErrors(errorDetails);
+                }
+            }
+            catch (Exception ex)
+            {
+                MessageBox.Show(ex.Message, Resources.DialogTitle);
+            }
+        }
+
+        public void SelectError(ErrorDetailViewModel error)
+        {
+            try
+            {
+                ErrorDetail errorDetail = new ErrorDetail();
+                errorDetail = errorDetail.SetValuesFrom(error);
+
+                if (excelManager != null)
+                {
+                    excelManager.Select(errorDetail);
+                }
+            }
+            catch (Exception ex)
+            {
+                MessageBox.Show(ex.Message, Resources.DialogTitle);
+            }
+        }
+
+        public void SelectSheet(string sheetName)
+        {
+            if (!string.IsNullOrWhiteSpace(sheetName))
+            {
+                this.taskPane.ErrorDetails.Model.SelectSheet(sheetName);
+            }
+        }
+
+        public void ResolveAllErrors()
+        {
+            if (MessageBox.Show(Resources.RemoveErrors, Resources.DialogTitle, MessageBoxButtons.YesNo) == DialogResult.Yes)
+            {
+                FixAllErrors();
+
+                Validate();
+            }
+        }
+
+        public void ResolveAllErrors(ErrorType typeOfError, string sheetName)
+        {
+            try
+            {
+                if (excelManager != null)
+                {
+                    excelManager.FixErrors(typeOfError, sheetName);
+                }
+            }
+            catch (Exception ex)
+            {
+                MessageBox.Show(ex.Message, Resources.DialogTitle);
+            }
+        }
+
+        public IEnumerable<ErrorDetail> GetErrors()
+        {
+            IEnumerable<ErrorDetail> errors = new List<ErrorDetail>();
+
+            try
+            {
+                if (excelManager != null)
+                {
+                    errors = excelManager.Validate();
+                }
+            }
+            catch (Exception)
+            {
+                // TODO : Error Handling
+            }
+
+            return errors;
+        }
+
+        public Dictionary<string, string> GetDocumentProperties()
+        {
+            Dictionary<string, string> documentProperties = new Dictionary<string, string>();
+            try
+            {
+                documentProperties = excelManager.GetDocumentProperties();
+            }
+            catch (Exception)
+            {
+                // TODO : Exception handling.
+                // MessageBox.Show(ex.Message, Resources.DialogTitle);
+            }
+
+            return documentProperties;
+        }
+
+        public MetadataListViewModel GetMetadata()
+        {
+            var metadata = metadataManager.GetMetadata();
+            MetadataListViewModel metadataListViewModel = new MetadataListViewModel();
+            foreach (var item in metadata)
+            {
+                MetadataViewModel model = new MetadataViewModel();
+                model.SetValuesFrom(item);
+                metadataListViewModel.MetadataList.Add(model);
+            }
+
+            var parameterMetadataList = metadataManager.GetParamterMetadata();
+            foreach (var item in parameterMetadataList)
+            {
+                if (!string.IsNullOrWhiteSpace(item.Name))
+                {
+                    ParameterMetadataViewModel model = new ParameterMetadataViewModel();
+                    model.SetValuesFrom(item);
+                    metadataListViewModel.ParameterMetadataList.Add(model);
+                }
+            }
+
+            if (!metadataManager.IsGeneralMetadataPresent())
+            {
+                Dictionary<string, string> documentProperties = GetDocumentProperties();
+                metadataListViewModel.UpdateExcelProperties(documentProperties);
+            }
+
+            return metadataListViewModel;
+        }
+
+        public void UpdateMetadata(MetadataListViewModel metadataListViewModel)
+        {
+            List<MetadataDetail> updatedMetadata = new List<MetadataDetail>();
+            foreach (var item in metadataListViewModel.MetadataList)
+            {
+                MetadataDetail model = new MetadataDetail();
+                model.SetValuesFrom(item);
+                updatedMetadata.Add(model);
+            }
+
+            List<ParameterDetail> paramterList = new List<ParameterDetail>();
+            foreach (var item in metadataListViewModel.ParameterMetadataList)
+            {
+                ParameterDetail model = new ParameterDetail();
+                model.Name = item.Name;
+                model.Description = item.Description;
+                model.Type = item.Type;
+                model.Units = item.Units;
+                paramterList.Add(model);
+            }
+
+            metadataManager.UpdateMetadata(updatedMetadata, paramterList);
+        }
+
+        public ServiceResponse GetIdentifier(MetadataListViewModel metadataListViewModel, RepositoryModel repositoryModel)
+        {
+            string author = string.Empty;
+            var authorNode = metadataListViewModel.MetadataList.Where(m => m.Name.EndsWith("First name", StringComparison.InvariantCultureIgnoreCase)).FirstOrDefault();
+            if (!string.IsNullOrWhiteSpace(authorNode.Value))
+            {
+                author = authorNode.Value;
+            }
+
+            string title = string.Empty;
+            var titleNode = metadataListViewModel.MetadataList.Where(m => m.Name.EndsWith("Title of dataset", StringComparison.InvariantCultureIgnoreCase)).FirstOrDefault();
+            if (!string.IsNullOrWhiteSpace(titleNode.Value))
+            {
+                title = titleNode.Value;
+            }
+
+            DateTime pubDateTime = DateTime.UtcNow;
+            string pubDate = string.Empty;
+            var pubDateNode = metadataListViewModel.MetadataList.Where(m => m.Name.EndsWith("Today's date", StringComparison.InvariantCultureIgnoreCase)).FirstOrDefault();
+            if (!string.IsNullOrWhiteSpace(pubDateNode.Value))
+            {
+                pubDate = pubDateNode.Value;
+
+                if (!string.IsNullOrWhiteSpace(pubDate))
+                {
+                    if (DateTime.TryParse(pubDate, out pubDateTime))
+                    {
+                        pubDate = pubDateTime.ToString(Common.Constants.DefaultDateFormat);
+                    }
+                }
+            }
+
+            IdentifierDetail identifierDetail = new IdentifierDetail();
+
+            identifierDetail.RepositoryName = repositoryModel.RepositoryName;
+            if (repositoryModel.IsPasswordRequired)
+            {
+                identifierDetail.Authorization = Convert.ToBase64String(System.Text.Encoding.UTF8.GetBytes(repositoryModel.UserName + ":" + repositoryModel.UserPassword));
+            }
+
+            identifierDetail.What = title;
+            identifierDetail.Who = author;
+            identifierDetail.When = pubDateTime;
+
+            // Get Identifier from the service            
+            return repositoryManager.GetIdentifier(identifierDetail);
+        }
+
+        public ServiceResponse PublishFile(MetadataListViewModel metadataListViewModel, bool isExcel, RepositoryModel repositoryModel)
+        {
+            ServiceResponse status = ServiceResponse.CreateSuccessStatus();
+            try
+            {
+                PostFileDetail postfileDetail = new PostFileDetail();
+
+                postfileDetail.RepositoryName = repositoryModel.RepositoryName;
+                if (repositoryModel.IsPasswordRequired)
+                {
+                    postfileDetail.Authorization = Convert.ToBase64String(System.Text.Encoding.UTF8.GetBytes(repositoryModel.UserName + ":" + repositoryModel.UserPassword));
+                }
+
+                postfileDetail.IsCompressed = !isExcel;
+
+                string author = string.Empty;
+                var authorNode = metadataListViewModel.MetadataList.Where(m => m.Name.EndsWith("First name", StringComparison.InvariantCultureIgnoreCase)).FirstOrDefault();
+                if (!string.IsNullOrWhiteSpace(authorNode.Value))
+                {
+                    author = authorNode.Value;
+                }
+
+                string title = string.Empty;
+                var titleNode = metadataListViewModel.MetadataList.Where(m => m.Name.EndsWith("Title of dataset", StringComparison.InvariantCultureIgnoreCase)).FirstOrDefault();
+                if (!string.IsNullOrWhiteSpace(titleNode.Value))
+                {
+                    title = titleNode.Value;
+                }
+
+                DateTime pubDateTime = DateTime.UtcNow;
+                string pubDate = string.Empty;
+                var pubDateNode = metadataListViewModel.MetadataList.Where(m => m.Name.EndsWith("Today's date", StringComparison.InvariantCultureIgnoreCase)).FirstOrDefault();
+                if (!string.IsNullOrWhiteSpace(pubDateNode.Value))
+                {
+                    pubDate = pubDateNode.Value;
+
+                    if (!string.IsNullOrWhiteSpace(pubDate))
+                    {
+                        if (DateTime.TryParse(pubDate, out pubDateTime))
+                        {
+                            pubDate = pubDateTime.ToString(Common.Constants.DefaultDateFormat);
+                        }
+                    }
+                }
+
+                string identifier = string.Empty;
+                var identifierNode = metadataListViewModel.MetadataList.Where(m => m.Name.EndsWith(Common.Constants.IdentifierKeyName, StringComparison.InvariantCultureIgnoreCase)).FirstOrDefault();
+                if (!string.IsNullOrWhiteSpace(identifierNode.Value))
+                {
+                    identifier = identifierNode.Value;
+                }
+                else
+                {
+                    var getIdentifierResult = GetIdentifier(metadataListViewModel, repositoryModel);
+                    if (getIdentifierResult.IsSuccess)
+                    {
+                        identifier = getIdentifierResult.Message;
+
+                        identifierNode.Value = identifier;
+
+                        // Add Identifer as part of citation if the citation is already generated.
+                        string citation = string.Empty;
+                        var citationNode = metadataListViewModel.MetadataList.Where(m => m.Name.EndsWith(Common.Constants.CitationContent, StringComparison.InvariantCultureIgnoreCase)).FirstOrDefault();
+                        if (!string.IsNullOrWhiteSpace(citationNode.Value))
+                        {
+                            citation = citationNode.Value;
+
+                            string[] values = citation.Split('.');
+
+                            if (values.Length >= 4)
+                            {
+                                values[values.Length - 1] = identifier;
+
+                                citationNode.Value = string.Join(". ", values);
+                            }
+                        }
+
+                        UpdateMetadata(metadataListViewModel);
+                    }
+                    else
+                    {
+                        status = getIdentifierResult;
+                    }
+                }
+
+                if (status.IsSuccess)
+                {
+                    postfileDetail.What = title;
+                    postfileDetail.Who = author;
+                    postfileDetail.When = pubDateTime;
+                    postfileDetail.Identifier = identifier;
+
+                    string response = string.Empty;
+                    if (isExcel)
+                    {
+                        // 6.a Save a copy of the existing file using  "Globals.ThisAddIn.Application.ActiveWorkbook.SaveCopyAs"
+                        // 6.b Stream the file which was saved as copy to the web service.
+                        string filepath = Path.Combine(Path.GetTempPath(), Path.GetFileNameWithoutExtension(excelManager.GetWorkbookName()) + ".xlsx");
+
+                        Globals.ThisAddIn.Application.ActiveWorkbook.SaveCopyAs(filepath);
+
+                        postfileDetail.Filename = filepath;
+                        postfileDetail.Content = FileToByteArray(filepath);
+                    }
+                    else
+                    {
+                        // 6.a Create different csv files for each of the sheets. Naming convention "Filename-sheetname.csv"
+                        // 6.b Create a compressed file out of the created csv files.
+                        string csvFilePath = repositoryManager.GetCsvZipFile(Path.GetFileNameWithoutExtension(excelManager.GetWorkbookName()));
+                        if (!string.IsNullOrWhiteSpace(csvFilePath))
+                        {
+                            FileInfo f = new FileInfo(csvFilePath);
+                            postfileDetail.Filename = f.FullName;
+                            postfileDetail.Content = FileToByteArray(f.FullName);
+                        }
+                    }
+
+                    status = repositoryManager.PublishFile(postfileDetail, metadataListViewModel.GetMetadataList(), metadataManager.GetParamterMetadata());
+                }
+            }
+            catch (Exception ex)
+            {
+                status = ServiceResponse.CreateFailureStatus(ex);
+            }
+
+            return status;
+        }
+
+        public List<RepositoryModel> GetRepositories()
+        {
+            return repositoryManager.GetRespositories();
+        }
+
+        public void GenerateParaMetadata()
+        {
+            try
+            {
+                bool canContinue = true;
+
+                do
+                {
+                    this.ribbon.DisableCustomTaskPaneButtons();
+
+                    var output = ThisAddIn.ExcelApplication.InputBox(Resources.ParameterMetadataDescription, Title: Resources.ParameterMetadataTitle, Type: 8);
+
+                    if (output is bool)
+                    {
+                        canContinue = (bool)output;
+                    }
+
+                    if (canContinue)
+                    {
+                        List<object> obj = metadataManager.GetHeaderRow(output as Microsoft.Office.Interop.Excel.Range);
+
+                        if (obj.Count > 0)
+                        {
+                            metadataManager.UpdateParaMetadata(obj);
+                            canContinue = false;
+                        }
+                        else
+                        {
+                            MessageBox.Show(Resources.SelectRange);
+                        }
+                    }
+                } while (canContinue);
+
+                ActivateRibbonTab();
+            }
+            catch (Exception ex)
+            {
+                MessageBox.Show(ex.Message, Resources.DialogTitle);
+            }
+            finally
+            {
+                this.ribbon.EnableCustomTaskPaneButtons();
+            }
+        }
+
+        public List<ParameterDetail> GetNewParameterList()
+        {
+            List<ParameterDetail> newParameterList = new List<ParameterDetail>();
+            try
+            {
+                bool canContinue = true;
+
+                do
+                {
+                    this.ribbon.DisableCustomTaskPaneButtons();
+
+                    var output = ThisAddIn.ExcelApplication.InputBox(Resources.ParameterMetadataDescription, Title: Resources.ParameterMetadataTitle, Type: 8);
+
+                    if (output is bool)
+                    {
+                        canContinue = (bool)output;
+                    }
+
+                    if (canContinue)
+                    {
+                        List<object> obj = metadataManager.GetHeaderRow(output as Microsoft.Office.Interop.Excel.Range);
+
+                        if (obj.Count > 0)
+                        {
+                            foreach (var item in obj)
+                            {
+                                if (item != null)
+                                {
+                                    newParameterList.Add(new ParameterDetail()
+                                    {
+                                        Name = item.ToString().Trim()
+                                    });
+                                }
+                            }
+
+                            canContinue = false;
+                        }
+                        else
+                        {
+                            MessageBox.Show(Resources.SelectRange);
+                        }
+                    }
+                } while (canContinue);
+
+                ActivateRibbonTab();
+            }
+            catch (Exception)
+            {
+                // TODO: Error handling
+                // MessageBox.Show(ex.Message, Resources.DialogTitle);
+            }
+            finally
+            {
+                this.ribbon.EnableCustomTaskPaneButtons();
+            }
+
+            return newParameterList;
+        }
+
+        public List<string> GetSheetNames()
+        {
+            var sheetsNames = this.excelManager.GetSheetNames();
+
+            return sheetsNames.OrderBy(s => s.Key).Select(s => s.Value).ToList();
+        }
+
+        public string GetUserAgreement(string repositoryName)
+        {
+            return this.repositoryManager.GetUserAgreement(repositoryName);
+        }
+
+        public void Validate(bool selectSummary = true)
+        {
+            this.taskPane.ErrorDetails.Model.Validate(selectSummary);
+        }
+
+        private static bool ContainsMetadata(MetadataListViewModel metadataListViewModel, string[] searchList)
+        {
+            bool isValid = true;
+
+            if (searchList != null && searchList.Length > 0)
+            {
+                // Check if All required fields are present for Generating the Metadata. Check requirement document more details and flow.
+                for (int searchIndex = 0; searchIndex < searchList.Length; searchIndex++)
+                {
+                    isValid = false;
+                    for (int i = 0; i < metadataListViewModel.MetadataList.Count; i++)
+                    {
+                        if ((metadataListViewModel.MetadataList[i]).Name == searchList[searchIndex])
+                        {
+                            if (!string.IsNullOrWhiteSpace(metadataListViewModel.MetadataList[i].Value))
+                            {
+                                isValid = true;
+                                break;
+                            }
+                        }
+                    }
+
+                    if (!isValid)
+                    {
+                        break;
+                    }
+                }
+            }
+
+            return isValid;
+        }
+
+        private static byte[] FileToByteArray(string fileName)
+        {
+            byte[] buff = null;
+            using (FileStream fs = new FileStream(fileName, FileMode.Open, FileAccess.Read))
+            {
+                BinaryReader br = new BinaryReader(fs);
+                long numBytes = new FileInfo(fileName).Length;
+                buff = br.ReadBytes((int)numBytes);
+            }
+            return buff;
+        }
+
+        private void AttachRibbonHandlers()
+        {
+            this.ribbon.ValidateClicked += new EventHandler(OnValidateClicked);
+            this.ribbon.FixAllErrorsClicked += new EventHandler(OnFixAllErrorsClicked);
+            this.ribbon.GenerateMetadataClicked += new EventHandler(OnGenerateMetadataClicked);
+            this.ribbon.GenerateParaMetaDataClicked += new EventHandler(OnGenerateParaMetadataClicked);
+            this.ribbon.ClearParameterMetaDataClicked += new EventHandler(OnClearParameterMetaDataClicked);
+            this.ribbon.GenerateCitationClicked += new EventHandler(OnGenerateCitationClicked);
+            this.ribbon.PostToRepositoryClicked += new EventHandler(OnPostToRepositoryClicked);
+        }
+
+        private void InitializeManagers()
+        {
+            excelManager = new ExcelManager(Globals.ThisAddIn.Application.ActiveWorkbook);
+            metadataManager = new MetadataManager(Globals.ThisAddIn.Application.ActiveWorkbook, Globals.Factory);
+            repositoryManager = new RepositoryManager(Globals.ThisAddIn.Application.ActiveWorkbook, Globals.Factory);
+        }
+
+        private void OnWorkbookActivate(Microsoft.Office.Interop.Excel.Workbook Wb)
+        {
+            this.InitializeManagers();
+
+            this.ribbon.HideCustomTaskPane();
+
+            Wb.SheetChange += new Microsoft.Office.Interop.Excel.WorkbookEvents_SheetChangeEventHandler(OnSheetChange);
+        }
+
+        private void OnSheetChange(object Sh, Microsoft.Office.Interop.Excel.Range Target)
+        {
+            try
+            {
+                Microsoft.Office.Interop.Excel.Worksheet workSheet = Sh as Microsoft.Office.Interop.Excel.Worksheet;
+
+                if (workSheet.Name.Equals(Common.Constants.MetadataSheetName))
+                {
+                    if (Target != null)
+                    {
+                        Microsoft.Office.Interop.Excel.Range activeCell = (Microsoft.Office.Interop.Excel.Range)Target;
+                        if (activeCell != null && activeCell.Column == 6)
+                        {
+                            string cellValue = activeCell.Value == null ? string.Empty : Convert.ToString(activeCell.Value);
+
+                            var unitCell = activeCell.Cells.Next;
+                            var address = Target.get_Address();
+                            if (cellValue.Equals("Numeric"))
+                            {
+                                unitCell.Validation.Delete();
+                                unitCell.Validation.Add(Microsoft.Office.Interop.Excel.XlDVType.xlValidateList
+                                    , Microsoft.Office.Interop.Excel.XlDVAlertStyle.xlValidAlertInformation
+                                    , Microsoft.Office.Interop.Excel.XlFormatConditionOperator.xlBetween
+                                    , "=$M:$M");
+
+                                unitCell.Validation.ErrorMessage = "You have entered a new custom unit.";
+                                unitCell.Validation.ErrorTitle = "DataUp.";
+                                unitCell.Validation.ShowError = false;
+
+                                unitCell.Validation.InCellDropdown = true;
+                            }
+                            else if (unitCell != null)
+                            {
+                                if (unitCell.Value != null)
+                                {
+                                    unitCell.Clear();
+                                }
+                                unitCell.Validation.Delete();
+                            }
+                        }
+                    }
+                }
+            }
+            catch { }
+        }
+
+        private void OnValidateClicked(object sender, EventArgs e)
+        {
+            Validate();
+        }
+
+        private void OnFixAllErrorsClicked(object sender, EventArgs e)
+        {
+            ResolveAllErrors();
+        }
+
+        private void OnGenerateMetadataClicked(object sender, EventArgs e)
+        {
+            try
+            {
+                MetadataViewPaneViewModel viewModel = new MetadataViewPaneViewModel()
+                {
+                    MetadataListViewModel = GetMetadata()
+                };
+
+                CreateMetadata(viewModel);
+
+                ActivateRibbonTab();
+            }
+            catch (Exception ex)
+            {
+                MessageBox.Show(ex.Message, Resources.DialogTitle);
+            }
+        }
+
+        private void OnGenerateParaMetadataClicked(object sender, EventArgs e)
+        {
+            GenerateParaMetadata();
+        }
+
+        private void OnClearParameterMetaDataClicked(object sender, EventArgs e)
+        {
+            metadataManager.ClearAllParameter();
+        }
+
+        private void OnGenerateCitationClicked(object sender, EventArgs e)
+        {
+            try
+            {
+                bool isContinue = true;
+
+                MetadataListViewModel metadataListViewModel = GetMetadata();
+
+                // 1. Is metadata sheet present?
+                if (!this.metadataManager.IsMetadataSheetAvailable())
+                {
+                    isContinue = GenerateMetadata(metadataListViewModel);
+
+                    metadataListViewModel = GetMetadata();
+                }
+
+                if (isContinue)
+                {
+                    UpdateCitation(metadataListViewModel);
+                }
+
+                ActivateRibbonTab();
+            }
+            catch (Exception ex)
+            {
+                MessageBox.Show(ex.Message, Resources.DialogTitle);
+            }
+        }
+
+        private void OnPostToRepositoryClicked(object sender, EventArgs e)
+        {
+            try
+            {
+                PostWizard dialog = new PostWizard();
+                System.Windows.Interop.WindowInteropHelper helper = new System.Windows.Interop.WindowInteropHelper(dialog);
+                helper.Owner = (IntPtr)ThisAddIn.ExcelApplication.Hwnd;
+                PostWizardViewModel postWizardViewModel = new PostWizardViewModel();
+                postWizardViewModel.RequestClose += new EventHandler(dialog.OnRequestClose);
+
+                // TODO : Initialize
+                postWizardViewModel.ShowSelectTab = true;
+
+                postWizardViewModel.Filename = excelManager.GetWorkbookName();
+
+                dialog.Model = postWizardViewModel;
+
+                dialog.UpdateLayout();
+                dialog.ShowDialog();
+
+                postWizardViewModel.RequestClose -= new EventHandler(dialog.OnRequestClose);
+
+                dialog.Close();
+
+                ActivateRibbonTab();
+            }
+            catch (Exception ex)
+            {
+                MessageBox.Show(ex.Message, Resources.DialogTitle);
+            }
+        }
+
+        private bool GenerateMetadata(MetadataListViewModel metadataListViewModel)
+        {
+            bool isContinue = false;
+            var result = AlertHelper.ShowAlert(
+                AlertType.GenerateMetadata
+                , Resources.GenerateMetadata
+                , "Generate Metadata"
+                , Resources.IgnoreButtonLabel
+                , false);
+
+            switch (result)
+            {
+                case AlertResult.Generate:
+                    {
+                        isContinue = CreateMetadata(new MetadataViewPaneViewModel() { MetadataListViewModel = metadataListViewModel });
+                        break;
+                    }
+                default:
+                    isContinue = false;
+                    break;
+            }
+
+            return isContinue;
+        }
+
+        private bool CreateMetadata(MetadataViewPaneViewModel metadataViewPaneViewModel)
+        {
+            bool isSuccess = false;
+
+            MetadataViewPane dialog = new MetadataViewPane();
+            System.Windows.Interop.WindowInteropHelper helper = new System.Windows.Interop.WindowInteropHelper(dialog);
+            helper.Owner = (IntPtr)ThisAddIn.ExcelApplication.Hwnd;
+
+            metadataViewPaneViewModel.RequestClose += new EventHandler(dialog.OnRequestClose);
+            dialog.Model = metadataViewPaneViewModel;
+
+            dialog.UpdateLayout();
+
+            dialog.ShowDialog();
+
+            if (dialog.DialogResult.HasValue && dialog.DialogResult.Value)
+            {
+                isSuccess = true;
+            }
+
+            metadataViewPaneViewModel.RequestClose -= new EventHandler(dialog.OnRequestClose);
+
+            metadataViewPaneViewModel = dialog.Model;
+
+            dialog.Close();
+
+            ActivateRibbonTab();
+
+            return isSuccess;
+        }
+
+        private void UpdateCitation(MetadataListViewModel metadataListViewModel)
+        {
+            GenerateCitationViewPane dialog = new GenerateCitationViewPane();
+            System.Windows.Interop.WindowInteropHelper helper = new System.Windows.Interop.WindowInteropHelper(dialog);
+            helper.Owner = (IntPtr)ThisAddIn.ExcelApplication.Hwnd;
+
+            GenerateCitationPaneViewModel viewModel = new GenerateCitationPaneViewModel();
+            viewModel.RequestClose += new EventHandler(dialog.OnRequestClose);
+
+            // Add Citation
+            viewModel.MetadataListViewModel = metadataListViewModel;
+
+            viewModel.CitationViewModel.LoadValues(metadataListViewModel);
+
+            dialog.Model = viewModel;
+
+            dialog.UpdateLayout();
+            dialog.ShowDialog();
+
+            //if (dialog.DialogResult.HasValue && dialog.DialogResult.Value)
+            //{
+            //    List<MetadataDetail> updatedMetadata = new List<MetadataDetail>();
+            //    foreach (var item in metadataListViewModel.MetadataList)
+            //    {
+            //        MetadataDetail model = new MetadataDetail();
+            //        if (item.Name == Common.Constants.CitationContent)
+            //        {
+            //            item.Value = metadataListViewModel.Citation;
+            //        }
+            //        model.SetValuesFrom(item);
+            //        updatedMetadata.Add(model);
+            //    }
+            //    metadataManager.UpdateMetadata(updatedMetadata);
+            //}
+
+            metadataListViewModel.RequestClose -= new EventHandler(dialog.OnRequestClose);
+            dialog.Close();
+        }
+
+        private void ActivateRibbonTab()
+        {
+            this.ribbon.RibbonUI.ActivateTab(this.ribbon.Tabs[0].ControlId.ToString());
+        }
+    }
+}

Source/Excel/Excel.AddIn/Excel.AddIn/CustomTaskPaneHost.Designer.cs

+namespace DataUp.Excel.Addin
+{
+    partial class CustomTaskPaneHost
+    {
+        /// <summary> 
+        /// Required designer variable.
+        /// </summary>
+        private System.ComponentModel.IContainer components = null;
+
+        /// <summary> 
+        /// Clean up any resources being used.
+        /// </summary>
+        /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
+        protected override void Dispose(bool disposing)
+        {
+            if (disposing && (components != null))
+            {
+                components.Dispose();
+            }
+            base.Dispose(disposing);
+        }
+
+        #region Component Designer generated code
+
+        /// <summary> 
+        /// Required method for Designer support - do not modify 
+        /// the contents of this method with the code editor.
+        /// </summary>
+        private void InitializeComponent()
+        {
+            this.elementHost1 = new System.Windows.Forms.Integration.ElementHost();
+            this.taskPane1 = new DataUp.Excel.Addin.TaskPane();
+            this.SuspendLayout();
+            // 
+            // elementHost1
+            // 
+            this.elementHost1.Dock = System.Windows.Forms.DockStyle.Fill;
+            this.elementHost1.Location = new System.Drawing.Point(0, 0);
+            this.elementHost1.Name = "elementHost1";
+            this.elementHost1.Size = new System.Drawing.Size(150, 150);
+            this.elementHost1.TabIndex = 0;
+            this.elementHost1.Text = "elementHost1";
+            this.elementHost1.Child = this.taskPane1;
+            // 
+            // CustomTaskPaneHost
+            // 
+            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
+            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+            this.Controls.Add(this.elementHost1);
+            this.Name = "CustomTaskPaneHost";
+            this.ResumeLayout(false);
+
+        }
+
+        #endregion
+
+        private System.Windows.Forms.Integration.ElementHost elementHost1;
+        private TaskPane taskPane1;
+    }
+}

Source/Excel/Excel.AddIn/Excel.AddIn/CustomTaskPaneHost.cs

+using System.Windows.Forms;
+
+namespace DataUp.Excel.Addin
+{
+    public partial class CustomTaskPaneHost : UserControl
+    {
+        public CustomTaskPaneHost()
+        {
+            InitializeComponent();
+        }
+
+        public TaskPane TaskPane
+        {
+            get { return this.taskPane1; }
+        }
+
+    }
+}

Source/Excel/Excel.AddIn/Excel.AddIn/CustomTaskPaneHost.resx

+<?xml version="1.0" encoding="utf-8"?>
+<root>
+  <!-- 
+    Microsoft ResX Schema 
+    
+    Version 2.0
+    
+    The primary goals of this format is to allow a simple XML format 
+    that is mostly human readable. The generation and parsing of the 
+    various data types are done through the TypeConverter classes 
+    associated with the data types.
+    
+    Example:
+    
+    ... ado.net/XML headers & schema ...
+    <resheader name="resmimetype">text/microsoft-resx</resheader>
+    <resheader name="version">2.0</resheader>
+    <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
+    <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
+    <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
+    <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
+    <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
+        <value>[base64 mime encoded serialized .NET Framework object]</value>
+    </data>
+    <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+        <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
+        <comment>This is a comment</comment>
+    </data>
+                
+    There are any number of "resheader" rows that contain simple 
+    name/value pairs.
+    
+    Each data row contains a name, and value. The row also contains a 
+    type or mimetype. Type corresponds to a .NET class that support 
+    text/value conversion through the TypeConverter architecture. 
+    Classes that don't support this are serialized and stored with the 
+    mimetype set.
+    
+    The mimetype is used for serialized objects, and tells the 
+    ResXResourceReader how to depersist the object. This is currently not 
+    extensible. For a given mimetype the value must be set accordingly:
+    
+    Note - application/x-microsoft.net.object.binary.base64 is the format 
+    that the ResXResourceWriter will generate, however the reader can 
+    read any of the formats listed below.
+    
+    mimetype: application/x-microsoft.net.object.binary.base64
+    value   : The object must be serialized with 
+            : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
+            : and then encoded with base64 encoding.
+    
+    mimetype: application/x-microsoft.net.object.soap.base64
+    value   : The object must be serialized with 
+            : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
+            : and then encoded with base64 encoding.
+
+    mimetype: application/x-microsoft.net.object.bytearray.base64
+    value   : The object must be serialized into a byte array 
+            : using a System.ComponentModel.TypeConverter
+            : and then encoded with base64 encoding.
+    -->
+  <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
+    <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
+    <xsd:element name="root" msdata:IsDataSet="true">
+      <xsd:complexType>
+        <xsd:choice maxOccurs="unbounded">
+          <xsd:element name="metadata">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" />
+              </xsd:sequence>
+              <xsd:attribute name="name" use="required" type="xsd:string" />
+              <xsd:attribute name="type" type="xsd:string" />
+              <xsd:attribute name="mimetype" type="xsd:string" />
+              <xsd:attribute ref="xml:space" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="assembly">
+            <xsd:complexType>
+              <xsd:attribute name="alias" type="xsd:string" />
+              <xsd:attribute name="name" type="xsd:string" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="data">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+                <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
+              </xsd:sequence>
+              <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
+              <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
+              <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
+              <xsd:attribute ref="xml:space" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="resheader">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+              </xsd:sequence>
+              <xsd:attribute name="name" type="xsd:string" use="required" />
+            </xsd:complexType>
+          </xsd:element>
+        </xsd:choice>
+      </xsd:complexType>
+    </xsd:element>
+  </xsd:schema>
+  <resheader name="resmimetype">
+    <value>text/microsoft-resx</value>
+  </resheader>
+  <resheader name="version">
+    <value>2.0</value>
+  </resheader>
+  <resheader name="reader">
+    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+  <resheader name="writer">
+    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+</root>
Add a comment to this file

Source/Excel/Excel.AddIn/Excel.AddIn/DataUp.Excel.Addin.pfx

Binary file added.

Source/Excel/Excel.AddIn/Excel.AddIn/Excel.AddIn.csproj

+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <!--
+    This section defines project-level properties.
+
+    AssemblyName
+      Name of the output assembly.
+    Configuration
+      Specifies a default value for debug.
+    OutputType
+      Must be "Library" for VSTO.
+    Platform
+      Specifies what CPU the output of this project can run on.
+    NoStandardLibraries
+      Set to "false" for VSTO.
+    RootNamespace
+      In C#, this specifies the namespace given to new files. In VB, all objects are
+      wrapped in this namespace at runtime.
+  -->
+  <PropertyGroup>
+    <ProjectTypeGuids>{BAA0C2D2-18E2-41B9-852F-F413020CAA33};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <ProjectGuid>{BA497EE4-C2F9-44D0-97CF-597EBEBF8A85}</ProjectGuid>
+    <OutputType>Library</OutputType>
+    <NoStandardLibraries>false</NoStandardLibraries>
+    <RootNamespace>DataUp.Excel.Addin</RootNamespace>
+    <AssemblyName>DataUp.Addin</AssemblyName>
+    <TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
+    <TargetFrameworkProfile>
+    </TargetFrameworkProfile>
+    <DefineConstants>VSTO40</DefineConstants>
+    <IsWebBootstrapper>False</IsWebBootstrapper>
+    <SccProjectName>
+    </SccProjectName>
+    <SccLocalPath>
+    </SccLocalPath>
+    <SccAuxPath>
+    </SccAuxPath>
+    <SccProvider>
+    </SccProvider>
+    <BootstrapperEnabled>true</BootstrapperEnabled>
+    <PublishUrl>D:\Code\Build-Excel-Aug22\</PublishUrl>
+    <InstallUrl />
+    <TargetCulture>en</TargetCulture>
+    <ApplicationVersion>1.5.1.9</ApplicationVersion>
+    <AutoIncrementApplicationRevision>true</AutoIncrementApplicationRevision>
+    <UpdateEnabled>false</UpdateEnabled>
+    <UpdateInterval>0</UpdateInterval>
+    <UpdateIntervalUnits>days</UpdateIntervalUnits>
+    <ProductName>DataUp.Addin</ProductName>
+    <PublisherName>DataUp.Addin</PublisherName>
+    <SupportUrl />
+    <FriendlyName>DataUp.Addin</FriendlyName>
+    <OfficeApplicationDescription />
+    <LoadBehavior>3</LoadBehavior>
+  </PropertyGroup>
+  <ItemGroup>
+    <BootstrapperPackage Include=".NETFramework,Version=v4.0">
+      <Visible>False</Visible>
+      <ProductName>Microsoft .NET Framework 4 %28x86 and x64%29</ProductName>
+      <Install>true</Install>
+    </BootstrapperPackage>
+    <BootstrapperPackage Include=".NETFramework,Version=v4.0,Profile=Client">
+      <Visible>False</Visible>
+      <ProductName>Microsoft .NET Framework 4 Client Profile %28x86 and x64%29</ProductName>
+      <Install>true</Install>
+    </BootstrapperPackage>
+    <BootstrapperPackage Include="Microsoft.Net.Client.3.5">
+      <Visible>False</Visible>
+      <ProductName>.NET Framework 3.5 SP1 Client Profile</ProductName>
+      <Install>false</Install>
+    </BootstrapperPackage>
+    <BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1">
+      <Visible>False</Visible>
+      <ProductName>.NET Framework 3.5 SP1</ProductName>
+      <Install>false</Install>
+    </BootstrapperPackage>
+    <BootstrapperPackage Include="Microsoft.Windows.Installer.3.1">
+      <Visible>False</Visible>
+      <ProductName>Windows Installer 3.1</ProductName>
+      <Install>true</Install>
+    </BootstrapperPackage>
+  </ItemGroup>
+  <PropertyGroup>
+    <!--
+      OfficeApplication
+        Add-in host application
+    -->
+    <OfficeApplication>Excel</OfficeApplication>
+  </PropertyGroup>
+  <!--
+    This section defines properties that are set when the "Debug" configuration is selected.
+
+    DebugSymbols
+      If "true", create symbols (.pdb). If "false", do not create symbols.
+    DefineConstants
+      Constants defined for the preprocessor.
+    EnableUnmanagedDebugging
+      If "true", starting the debugger will attach both managed and unmanaged debuggers.
+    Optimize
+      If "true", optimize the build output. If "false", do not optimize.
+    OutputPath
+      Output path of project relative to the project file.
+    WarningLevel
+      Warning level for the compiler.
+  -->
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+    <DebugSymbols>true</DebugSymbols>
+    <DebugType>full</DebugType>
+    <Optimize>false</Optimize>
+    <OutputPath>bin\Debug\</OutputPath>
+    <EnableUnmanagedDebugging>false</EnableUnmanagedDebugging>
+    <DefineConstants>$(DefineConstants);DEBUG;TRACE</DefineConstants>
+    <WarningLevel>4</WarningLevel>
+    <TreatWarningsAsErrors>true</TreatWarningsAsErrors>
+    <CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
+    <RunCodeAnalysis>true</RunCodeAnalysis>
+  </PropertyGroup>
+  <!--
+    This section defines properties that are set when the "Release" configuration is selected.
+
+    DebugSymbols
+      If "true", create symbols (.pdb). If "false", do not create symbols.
+    DefineConstants
+      Constants defined for the preprocessor.
+    EnableUnmanagedDebugging
+      If "true", starting the debugger will attach both managed and unmanaged debuggers.
+    Optimize
+      If "true", optimize the build output. If "false", do not optimize.
+    OutputPath
+      Output path of project relative to the project file.
+    WarningLevel
+      Warning level for the compiler.
+  -->
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+    <DebugType>pdbonly</DebugType>
+    <Optimize>true</Optimize>
+    <OutputPath>bin\Release\</OutputPath>
+    <EnableUnmanagedDebugging>false</EnableUnmanagedDebugging>
+    <DefineConstants>$(DefineConstants);TRACE</DefineConstants>
+    <WarningLevel>4</WarningLevel>
+    <CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
+    <RunCodeAnalysis>true</RunCodeAnalysis>
+    <TreatWarningsAsErrors>true</TreatWarningsAsErrors>
+  </PropertyGroup>
+  <!--
+    This section enables pre- and post-build steps. However, in VSTO use
+    MSBuild tasks instead of these properties.       
+  -->
+  <PropertyGroup>
+    <PreBuildEvent>
+    </PreBuildEvent>
+    <PostBuildEvent>
+    </PostBuildEvent>
+  </PropertyGroup>
+  <PropertyGroup>
+    <SignManifests>true</SignManifests>
+  </PropertyGroup>
+  <PropertyGroup>
+    <ManifestKeyFile>DataUp.Excel.Addin.pfx</ManifestKeyFile>
+  </PropertyGroup>
+  <PropertyGroup>
+    <ManifestCertificateThumbprint>4E7A8E76D1F7B5AA432DCA227C6E181F2985DAC4</ManifestCertificateThumbprint>
+  </PropertyGroup>
+  <!--
+    This section specifies references for the project.
+  -->
+  <ItemGroup>
+    <Reference Include="Accessibility" />
+    <Reference Include="Ionic.Zip">
+      <HintPath>..\..\..\..\Libs\Ionic\Ionic.Zip.dll</HintPath>
+    </Reference>
+    <Reference Include="Microsoft.Expression.Drawing">
+      <HintPath>..\..\..\..\Libs\Internal\Microsoft.Expression.Drawing.dll</HintPath>
+    </Reference>
+    <Reference Include="Microsoft.Expression.Interactions">
+      <HintPath>..\..\..\..\Libs\Internal\Microsoft.Expression.Interactions.dll</HintPath>
+    </Reference>
+    <Reference Include="PresentationCore" />
+    <Reference Include="PresentationFramework" />
+    <Reference Include="PresentationFramework.Aero" />
+    <Reference Include="System" />
+    <Reference Include="System.Configuration" />
+    <Reference Include="System.Data" />
+    <Reference Include="System.Drawing" />
+    <Reference Include="System.Runtime.Serialization" />
+    <Reference Include="System.ServiceModel" />
+    <Reference Include="System.Web.Extensions" />
+    <Reference Include="System.Windows.Forms" />
+    <Reference Include="System.Windows.Interactivity">
+      <HintPath>..\..\..\..\Libs\Internal\System.Windows.Interactivity.dll</HintPath>
+    </Reference>
+    <Reference Include="System.Xaml" />
+    <Reference Include="System.Xml" />
+    <Reference Include="System.Core" />
+    <Reference Include="System.Xml.Linq" />
+    <Reference Include="System.Data.DataSetExtensions" />
+    <Reference Include="Microsoft.CSharp" />
+    <Reference Include="UIAutomationProvider" />
+    <Reference Include="WindowsBase" />
+    <Reference Include="WindowsFormsIntegration" />
+    <Reference Include="WPFToolkit.Extended">
+      <HintPath>..\..\..\..\Libs\Internal\WPFToolkit.Extended.dll</HintPath>
+    </Reference>
+  </ItemGroup>
+  <ItemGroup>
+    <Reference Include="Microsoft.Office.Tools.v4.0.Framework, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" />
+    <Reference Include="Microsoft.VisualStudio.Tools.Applications.Runtime, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" />
+    <Reference Include="Microsoft.Office.Tools, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" />
+    <Reference Include="Microsoft.Office.Tools.Common, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" />
+    <Reference Include="Microsoft.Office.Tools.Excel, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" />
+  </ItemGroup>
+  <ItemGroup>
+    <Reference Include="Microsoft.Office.Tools.Common.v4.0.Utilities, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
+      <Private>True</Private>
+    </Reference>
+  </ItemGroup>
+  <ItemGroup>
+    <Reference Include="Office, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c">
+      <Private>False</Private>
+      <EmbedInteropTypes>true</EmbedInteropTypes>
+    </Reference>
+    <Reference Include="Microsoft.Office.Interop.Excel, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c">
+      <Private>False</Private>
+      <EmbedInteropTypes>true</EmbedInteropTypes>
+    </Reference>
+    <Reference Include="stdole, Version=7.0.3300.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
+      <Private>False</Private>
+    </Reference>
+  </ItemGroup>
+  <!--
+    This section defines the user source files that are part of the project.
+     
+    A "Compile" element specifies a source file to compile.
+    An "EmbeddedResource" element specifies an .resx file for embedded resources.
+    A "None" element specifies a file that is not to be passed to the compiler (for instance, 
+    a text file or XML file).
+    The "AppDesigner" element specifies the directory where the application properties files
+    can be found.
+  -->
+  <ItemGroup>
+    <Compile Include="Controller\Controller.cs" />
+    <Compile Include="CustomTaskPaneHost.cs">
+      <SubType>UserControl</SubType>
+    </Compile>
+    <Compile Include="CustomTaskPaneHost.Designer.cs">
+      <DependentUpon>CustomTaskPaneHost.cs</DependentUpon>