Enhance export demo
This commit is contained in:
@ -29,10 +29,10 @@
|
||||
<RadzenTabs RenderMode="TabRenderMode.Client" Style="height: 100%;">
|
||||
<Tabs>
|
||||
<RadzenTabsItem Text="Запрос">
|
||||
<RadzenTextArea @bind-Value=@messageBody Disabled="true" />
|
||||
<RadzenTextArea @ref=@messageTextArea Value=@messageBody Disabled="true" ReadOnly="true" Style="resize: none; white-space: pre; overflow-wrap: normal; overflow-x: auto;" class="rz-w-stretch" />
|
||||
</RadzenTabsItem>
|
||||
<RadzenTabsItem Text="Результат">
|
||||
<RadzenTextArea @bind-Value=@responseBody Disabled="true" />
|
||||
<RadzenTextArea @ref=@responseTextArea Value=@responseBody Disabled="true" ReadOnly="true" Style="resize: none; white-space: pre; overflow-wrap: normal; overflow-x: auto;" class="rz-w-stretch" />
|
||||
</RadzenTabsItem>
|
||||
</Tabs>
|
||||
</RadzenTabs>
|
||||
@ -45,6 +45,8 @@
|
||||
@code {
|
||||
EventConsole console = default!;
|
||||
bool inputDisabled = false;
|
||||
RadzenTextArea messageTextArea;
|
||||
RadzenTextArea responseTextArea;
|
||||
string messageBody;
|
||||
string responseBody;
|
||||
|
||||
@ -85,7 +87,8 @@
|
||||
{
|
||||
catchMessageBody = false;
|
||||
|
||||
messageBody = File.ReadAllText(fileName);
|
||||
messageBody = XmlBeautifier.Beautify(File.ReadAllText(fileName));
|
||||
messageTextArea.Rows = messageBody.Count(c => c.Equals('\n')) + 2;
|
||||
}
|
||||
}
|
||||
|
||||
@ -96,7 +99,7 @@
|
||||
StartExport();
|
||||
|
||||
await client.Nsi.ExportDataProviderNsiItemAsync(exportDataProviderNsiItemRequestRegistryNumber.Item1);
|
||||
|
||||
|
||||
EndExport();
|
||||
}
|
||||
catch
|
||||
@ -118,6 +121,7 @@
|
||||
void EndExport()
|
||||
{
|
||||
inputDisabled = false;
|
||||
responseBody = File.ReadAllText(messageCapturer.LastFileName);
|
||||
responseBody = XmlBeautifier.Beautify(File.ReadAllText(messageCapturer.LastFileName));
|
||||
responseTextArea.Rows = responseBody.Count(c => c.Equals('\n')) + 2;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user