mirror of
https://github.com/Microsoft/calculator.git
synced 2025-08-21 22:03:11 -07:00
parent
f9a1ae1a28
commit
9817738307
2 changed files with 32 additions and 12 deletions
|
@ -282,11 +282,26 @@ void GraphingCalculator::ViewModel::set(GraphingCalculatorViewModel ^ vm)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void CalculatorApp::GraphingCalculator::OnShareClick(Platform::Object ^ sender, Windows::UI::Xaml::RoutedEventArgs ^ e)
|
void GraphingCalculator::OnShareClick(Object ^ sender, RoutedEventArgs ^ e)
|
||||||
{
|
{
|
||||||
// Ask the OS to start a share action.
|
// Ask the OS to start a share action.
|
||||||
|
try
|
||||||
|
{
|
||||||
DataTransferManager::ShowShareUI();
|
DataTransferManager::ShowShareUI();
|
||||||
TraceLogger::GetInstance()->LogGraphButtonClicked(GraphButton::Share, GraphButtonValue::None);
|
TraceLogger::GetInstance()->LogGraphButtonClicked(GraphButton::Share, GraphButtonValue::None);
|
||||||
|
}
|
||||||
|
catch (COMException ^ ex)
|
||||||
|
{
|
||||||
|
if (ex->HResult == RPC_E_SERVERCALL_RETRYLATER)
|
||||||
|
{
|
||||||
|
ShowShareError();
|
||||||
|
TraceLogger::GetInstance()->LogPlatformException(ViewMode::Graphing, __FUNCTIONW__, ex);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
throw;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// When share is invoked (by the user or programmatically) the event handler we registered will be called to populate the data package with the
|
// When share is invoked (by the user or programmatically) the event handler we registered will be called to populate the data package with the
|
||||||
|
@ -394,15 +409,19 @@ void GraphingCalculator::OnDataRequested(DataTransferManager ^ sender, DataReque
|
||||||
}
|
}
|
||||||
catch (Exception ^ ex)
|
catch (Exception ^ ex)
|
||||||
{
|
{
|
||||||
|
ShowShareError();
|
||||||
TraceLogger::GetInstance()->LogPlatformException(ViewMode::Graphing, __FUNCTIONW__, ex);
|
TraceLogger::GetInstance()->LogPlatformException(ViewMode::Graphing, __FUNCTIONW__, ex);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void GraphingCalculator::ShowShareError()
|
||||||
|
{
|
||||||
// Something went wrong, notify the user.
|
// Something went wrong, notify the user.
|
||||||
|
auto resourceLoader = ResourceLoader::GetForCurrentView();
|
||||||
auto errDialog = ref new ContentDialog();
|
auto errDialog = ref new ContentDialog();
|
||||||
errDialog->Content = resourceLoader->GetString(L"ShareActionErrorMessage");
|
errDialog->Content = resourceLoader->GetString(L"ShareActionErrorMessage");
|
||||||
errDialog->CloseButtonText = resourceLoader->GetString(L"ShareActionErrorOk");
|
errDialog->CloseButtonText = resourceLoader->GetString(L"ShareActionErrorOk");
|
||||||
errDialog->ShowAsync();
|
errDialog->ShowAsync();
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void GraphingCalculator::GraphingControl_VariablesUpdated(Object ^, Object ^)
|
void GraphingCalculator::GraphingControl_VariablesUpdated(Object ^, Object ^)
|
||||||
|
|
|
@ -106,6 +106,7 @@ public ref class GraphingCalculator sealed : public Windows::UI::Xaml::Data::INo
|
||||||
void OnVisualStateChanged(Platform::Object ^ sender, Windows::UI::Xaml::VisualStateChangedEventArgs ^ e);
|
void OnVisualStateChanged(Platform::Object ^ sender, Windows::UI::Xaml::VisualStateChangedEventArgs ^ e);
|
||||||
std::wstringstream FormatTraceValue(double min, double max, float pointValue);
|
std::wstringstream FormatTraceValue(double min, double max, float pointValue);
|
||||||
void GraphViewButton_Click(Platform::Object ^ sender, Windows::UI::Xaml::RoutedEventArgs ^ e);
|
void GraphViewButton_Click(Platform::Object ^ sender, Windows::UI::Xaml::RoutedEventArgs ^ e);
|
||||||
|
void ShowShareError();
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue