Skip to content

Commit

Permalink
revert rebased changes
Browse files Browse the repository at this point in the history
  • Loading branch information
dnenov committed Apr 9, 2024
1 parent 8b15fd2 commit cbb704b
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 8 deletions.
27 changes: 19 additions & 8 deletions src/Libraries/DSOffice/CSVNodes.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
using System.Collections.Generic;
using System.IO;
using System.Linq;
using DSOffice.Properties;

namespace DSOffice
{
Expand All @@ -20,20 +21,30 @@ public static partial class Data
/// <search>write,text,file</search>
public static void ExportCSV(string filePath, object[][] data)
{
using (var writer = new StreamWriter(DSCore.IO.FileSystem.AbsolutePath(filePath)))
try
{
foreach (var line in data)
using (var writer = new StreamWriter(DSCore.IO.FileSystem.AbsolutePath(filePath)))
{
int count = 0;
foreach (var entry in line)
foreach (var line in data)
{
writer.Write(entry);
if (++count < line.Length)
writer.Write(",");
int count = 0;
foreach (var entry in line)
{
writer.Write(entry);
if (++count < line.Length)
writer.Write(",");
}
writer.WriteLine();
}
writer.WriteLine();
}
}
catch (Exception ex)
{
if (ex is DirectoryNotFoundException)
throw new Exception(Resources.StreamWriterNotFoundException);
else
throw;
}
}

/// <summary>
Expand Down
14 changes: 14 additions & 0 deletions src/Libraries/DSOffice/DSOffice.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,11 @@
<Compile Include="CSVNodes.cs" />
<Compile Include="Excel.cs" Condition=" $(RuntimeIdentifier.Contains('win')) " />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Properties\Resources.Designer.cs">
<DesignTime>True</DesignTime>
<AutoGen>True</AutoGen>
<DependentUpon>Resources.resx</DependentUpon>
</Compile>
</ItemGroup>
<ItemGroup>
<Content Include="DSOffice.Migrations.xml">
Expand Down Expand Up @@ -53,6 +58,15 @@
<Name>CoreNodes</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<EmbeddedResource Update="Properties\Resources.en-US.resx">
<Generator>ResXFileCodeGenerator</Generator>
</EmbeddedResource>
<EmbeddedResource Update="Properties\Resources.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
</EmbeddedResource>
</ItemGroup>
<Target Name="GenerateFiles" AfterTargets="ResolveSateliteResDeps" Condition=" '$(OS)' != 'Unix' ">
<!-- Generate customization dll -->
<GenerateResource SdkToolsPath="$(TargetFrameworkSDKToolsDirectory)" UseSourcePath="true" Sources="$(ProjectDir)DSOfficeImages.resx" OutputResources="$(ProjectDir)DSOfficeImages.resources" />
Expand Down

0 comments on commit cbb704b

Please sign in to comment.