Skip to content

Commit

Permalink
Catch exception when Account_key is empty.
Browse files Browse the repository at this point in the history
  • Loading branch information
chriswendt1 committed Feb 23, 2020
1 parent a54e0ed commit d4237df
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi"
xmlns:util="http://schemas.microsoft.com/wix/UtilExtension">

<?define ProductVersion="2.5.4" ?>
<?define ProductVersion="2.5.5" ?>
<!--<?define ProductInstallationDirVersion="1.0.0" ?>-->
<?define ProductInstallationDir="Microsoft Document Translator"?>
<?define UpgradeCode="{69CB62B3-53BB-4BF5-9E53-B5677940AB8E}"?>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
<StackPanel MinWidth="200">
<TextBlock Text="{x:Static p:Resources.DocumentTranslator_name}" Margin="0,0,0,8" TextWrapping="Wrap" Style="{StaticResource Heading1}" />
<TextBlock Text="" Margin="0,0,0,8" TextWrapping="Wrap" Style="{StaticResource Heading2}" />
<TextBlock Text="Version 2.5.4" Margin="0,0,0,8" TextWrapping="Wrap" Style="{StaticResource Heading2}" />
<TextBlock Text="Version 2.5.5" Margin="0,0,0,8" TextWrapping="Wrap" Style="{StaticResource Heading2}" />
<TextBlock Text="Microsoft Corporation" Style="{StaticResource Heading2}" />

<TextBlock Style="{StaticResource Heading2}" >
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
<Grid x:Name="CustomEndpointText" HorizontalAlignment="Left" Margin="0,10,0,0">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition MinWidth="320" />
<ColumnDefinition MinWidth="300" />
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,11 @@ public class DocumentTranslation : Notifyer
/// </summary>
public DocumentTranslation()
{
TranslationServiceFacade.Initialize();
try
{
TranslationServiceFacade.Initialize();
}
catch (CredentialsMissingException) { }
this.PopulateAvailableLanguages();
this.PopulateTranslateMode();
this.ShowProgressBar = false;
Expand All @@ -129,6 +133,7 @@ public DocumentTranslation()
this.StatusText = Properties.Resources.Common_SelectDocuments;
this.PopulateReadyToTranslateMessage(true);
}
ShowStatus();


SingletonEventAggregator.Instance.GetEvent<AccountValidationEvent>().Unsubscribe(PopulateReadyToTranslateMessage);
Expand Down Expand Up @@ -562,6 +567,20 @@ private void PopulateReadyToTranslateMessage(bool successful)
}
}

private async void ShowStatus()
{

if (await TranslationServices.Core.TranslationServiceFacade.IsTranslationServiceReadyAsync())
{
this.StatusText = Properties.Resources.Common_Ready;
}
else
{
this.StatusText = Properties.Resources.Error_PleaseSubscribe;
}
}


#endregion
}
}

0 comments on commit d4237df

Please sign in to comment.