Commit 754d495a authored by bastien penavayre's avatar bastien penavayre Committed by Hugo Beauzée-Luyssen

Update libVLCX::Question so that it can work with C#

Replace "using Question = ..." and "namespace New = Old" and replace it by a new public enum class, for C# compatibility
Signed-off-by: default avatarHugo Beauzée-Luyssen <hugo@beauzee.fr>
parent 224142eb
......@@ -141,7 +141,7 @@ namespace libVLCX
login(ref new Dialog(std::move(dialog)), ToPlatformString(std::move(title)), ToPlatformString(std::move(text)), ToPlatformString(std::move(defaultUserName)), askToStore);
},
[question](VLC::Dialog &&dialog, std::string &&title, std::string &&text, VLC::Question qType, std::string &&cancel, std::string &&action1, std::string &&action2) {
question(ref new Dialog(std::move(dialog)), ToPlatformString(std::move(title)), ToPlatformString(std::move(text)), (unsigned)qType, ToPlatformString(std::move(cancel)), ToPlatformString(std::move(action1)), ToPlatformString(std::move(action2)));
question(ref new Dialog(std::move(dialog)), ToPlatformString(std::move(title)), ToPlatformString(std::move(text)), (libVLCX::Question)qType, ToPlatformString(std::move(cancel)), ToPlatformString(std::move(action1)), ToPlatformString(std::move(action2)));
},
[dspProgress](VLC::Dialog &&dialog, std::string &&title, std::string &&text, bool intermediate, float position, std::string &&cancel) {
dspProgress(ref new Dialog(std::move(dialog)), ToPlatformString(std::move(title)), ToPlatformString(std::move(text)), intermediate, position, ToPlatformString(std::move(cancel)));
......
......@@ -35,13 +35,12 @@ namespace libVLCX
{
public delegate void LogCallback(int, Platform::String^);
/**
* Use unsigned to replace the VLC::Question type because enum type are
* forbiden in delegate's argument list
*/
using Question = unsigned;
namespace DialogType = VLC::DialogType;
public enum class Question
{
normal = VLC::DialogType::normal,
warning = VLC::DialogType::warning,
critical = VLC::DialogType::critical
};
namespace DialogCallback
{
......@@ -79,7 +78,7 @@ namespace libVLCX
* \param dialog used to interact with the dialog
* \param title title of the diaog
* \param text text of the dialog
* \param qtype question type (or severity) of the dialog (\see DialogType)
* \param qtype question type (or severity) of the dialog (\see Question)
* \param cancel text of the cancel button
* \param action1 text of the first button, if NULL, don't display this
* button
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment