Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
59 changes: 14 additions & 45 deletions ExcelUI_Engine/ExcelUI_Engine.csproj
Original file line number Diff line number Diff line change
@@ -1,35 +1,20 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{56039ED6-FBD5-4F45-936B-2116399AEEC3}</ProjectGuid>
<TargetFramework>net472</TargetFramework>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>BH.Engine.Excel</RootNamespace>
<AssemblyName>ExcelUI_Engine</AssemblyName>
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<Deterministic>true</Deterministic>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>..\Build\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>..\Build\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
<AssemblyTitle>ExcelUI_Engine</AssemblyTitle>
<Description>https://github.com/BHoM/Excel_UI</Description>
<Product>BHoM</Product>
<Copyright>Copyright � https://github.com/BHoM</Copyright>
<AssemblyVersion>9.0.0.0</AssemblyVersion>
<FileVersion>9.1.0.0</FileVersion>
</PropertyGroup>
<Target Name="PostBuild" AfterTargets="PostBuildEvent">
<Exec Command="xcopy &quot;$(TargetPath)&quot; &quot;$(ProgramData)\BHoM\Assemblies&quot; /Y" />
</Target>
<ItemGroup>
<Reference Include="BHoM">
<HintPath>$(ProgramData)\BHoM\Assemblies\BHoM.dll</HintPath>
Expand All @@ -46,23 +31,7 @@
<Private>False</Private>
<SpecificVersion>False</SpecificVersion>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Xml" />
<PackageReference Include="Microsoft.CSharp" Version="4.7.0" />
<PackageReference Include="System.Data.DataSetExtensions" Version="4.5.0" />
</ItemGroup>
<ItemGroup>
<Compile Include="Compute\ParseEnum.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Query\ExcelUIWiki.cs" />
<Compile Include="Query\Explode.cs" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<PropertyGroup>
<PostBuildEvent>xcopy "$(TargetPath)" "$(ProgramData)\BHoM\Assemblies" /Y</PostBuildEvent>
</PropertyGroup>
</Project>
65 changes: 0 additions & 65 deletions ExcelUI_Engine/Properties/AssemblyInfo.cs

This file was deleted.

6 changes: 3 additions & 3 deletions Excel_UI.sln
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@


Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.0.32126.317
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Excel_UI", "Excel_UI\Excel_UI.csproj", "{0FAF6FEB-80C3-474A-92BB-C886424CCBC8}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Excel_UI", "Excel_UI\Excel_UI.csproj", "{0FAF6FEB-80C3-474A-92BB-C886424CCBC8}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ExcelUI_Engine", "ExcelUI_Engine\ExcelUI_Engine.csproj", "{56039ED6-FBD5-4F45-936B-2116399AEEC3}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ExcelUI_Engine", "ExcelUI_Engine\ExcelUI_Engine.csproj", "{56039ED6-FBD5-4F45-936B-2116399AEEC3}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Expand Down
6 changes: 3 additions & 3 deletions Excel_UI/Addin/AddIn_BackwardCompatibility.cs
Original file line number Diff line number Diff line change
Expand Up @@ -77,15 +77,15 @@ private static List<Tuple<string, string>> Old_GetFormulas()
string callerType = "";
try
{
Range cell = row.Cells[1, 2];
Range cell = (Range)row.Cells[1, 2];
callerType = cell.Value.ToString();

int col = 3;
cell = row.Cells[1, col++];
cell = (Range)row.Cells[1, col++];
while (cell.Value != null && cell.Value is string && (cell.Value as string).Length > 0)
{
str += cell.Value;
cell = row.Cells[1, col++];
cell = (Range)row.Cells[1, col++];
}
}
catch { }
Expand Down
22 changes: 11 additions & 11 deletions Excel_UI/Addin/AddIn_Formulas.cs
Original file line number Diff line number Diff line change
Expand Up @@ -104,9 +104,9 @@ public static void RestoreFormulas()
for (int i = 2; i < 10000; i++)
{
// Recover the information about the formula
string formulaName = sheet.Cells[i, 1].Value as string;
string callerJson = sheet.Cells[i, 2].Value as string;
string oldFunction = sheet.Cells[i, 3].Value as string;
string formulaName = ((Range)sheet.Cells[i, 1]).Value as string;
string callerJson = ((Range)sheet.Cells[i, 2]).Value as string;
string oldFunction = ((Range)sheet.Cells[i, 3]).Value as string;
if (formulaName == null || formulaName.Length == 0 || callerJson == null || callerJson.Length == 0)
break;

Expand Down Expand Up @@ -169,13 +169,13 @@ private static void UpdateEnumValues(string collectionName)
{
try
{
string name = choicesSheet.Cells[i, 1].Value as string;
string name = ((Range)choicesSheet.Cells[i, 1]).Value as string;
if (string.IsNullOrEmpty(name))
{
// Need to add the choices here - this should not be needed on loading a sheet, but as a safety net
choicesSheet.Cells[i, 1].Value = collectionName;
((Range)choicesSheet.Cells[i, 1]).Value = collectionName;
for (int j = 0; j < enumChoices.Length; j++)
choicesSheet.Cells[i, j + 2].Value = enumChoices.GetValue(j).ToString();
((Range)choicesSheet.Cells[i, j + 2]).Value = enumChoices.GetValue(j).ToString();
break;
}
else
Expand Down Expand Up @@ -247,11 +247,11 @@ private static void SaveCallerToHiddenSheet(CallerFormula caller)
lock(m_Mutex)
{
// Get teh sheet ID
string sheetId = sheet.Cells[1, 1].Value as string;
string sheetId = ((Range)sheet.Cells[1, 1]).Value as string;
if (sheetId == null)
{
sheetId = ToString(Guid.NewGuid());
sheet.Cells[1, 1].Value = sheetId;
((Range)sheet.Cells[1, 1]).Value = sheetId;
}

// Make sure there is a list of saved callers for this worksheet
Expand All @@ -264,9 +264,9 @@ private static void SaveCallerToHiddenSheet(CallerFormula caller)
m_SavedOnWorkbook[sheetId].Add(caller.Function);
int row = m_SavedOnWorkbook[sheetId].Count + 1;

sheet.Cells[row, 1].Value = caller.Caller.GetType().Name;
sheet.Cells[row, 2].Value = caller.Caller.Write();
sheet.Cells[row, 3].Value = caller.Function;
((Range)sheet.Cells[row, 1]).Value = caller.Caller.GetType().Name;
((Range)sheet.Cells[row, 2]).Value = caller.Caller.Write();
((Range)sheet.Cells[row, 3]).Value = caller.Function;
}
}
});
Expand Down
4 changes: 2 additions & 2 deletions Excel_UI/Addin/AddIn_Internalise.cs
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ private static void WriteJsonToSheet(string sheetName, Dictionary<string, object
{
try
{
sheet.Cells[index, 1].Value = json.Substring(i, Math.Min(characterLimit, json.Length - i));
((Range)sheet.Cells[index, 1]).Value = json.Substring(i, Math.Min(characterLimit, json.Length - i));
index++;
}
catch { }
Expand All @@ -129,7 +129,7 @@ private static Dictionary<string, object> ReadJsonFromSheet(string sheetName)
{
try
{
string segment = sheet.Cells[i, 1].Value as string;
string segment = ((Range)sheet.Cells[i, 1]).Value as string;
if (string.IsNullOrEmpty(segment))
break;
else
Expand Down
6 changes: 3 additions & 3 deletions Excel_UI/Addin/AddIn_Workbook.cs
Original file line number Diff line number Diff line change
Expand Up @@ -66,12 +66,12 @@ public static Worksheet Sheet(string name, bool addIfMissing = true, bool isHidd
// Look for the sheet in the active workbook
Worksheet sheet = null;
if (workbook.Sheets.OfType<Worksheet>().Any(x => x.Name == name))
sheet = workbook.Sheets[name];
sheet = (Worksheet)workbook.Sheets[name];

// If sheet doesn't exist, create it if requested
if (sheet == null && addIfMissing)
{
sheet = workbook.Sheets.Add();
sheet = (Worksheet)workbook.Sheets.Add();
sheet.Name = name;

if (isHidden)
Expand Down Expand Up @@ -155,7 +155,7 @@ public static string WorkbookId(Workbook workbook = null)
if (workbook == null)
return null;

DocumentProperties properties = workbook.CustomDocumentProperties;
DocumentProperties properties = (DocumentProperties)workbook.CustomDocumentProperties;
foreach (DocumentProperty prop in properties)
{
if (prop.Name == "BHoM_Guid")
Expand Down
Loading