public StartParameters(string moduleName, HeaderImage image, SelectCB select, ContinueCB cont, CancelCB cancel)
            {
                this.moduleName = moduleName;
                this.image      = image;
                this.select     = async(dynamic selectPar) =>
                {
                    object[]          pluginObjs = selectPar.plugins;
                    IEnumerable <int> pluginIds  = pluginObjs.Select(id => (int)id);
                    select(selectPar.stepId, selectPar.groupId, pluginIds.ToArray());
                    return(await Task.FromResult <object>(null));
                };

                this.cont = async(dynamic direction) =>
                {
                    cont(((string)direction == "forward"));
                    return(await Task.FromResult <object>(null));
                };
                this.cancel = async(dynamic dummy) =>
                {
                    cancel();
                    return(await Task.FromResult <object>(null));
                };
            }
 public async void StartDialog(string moduleName, HeaderImage image, SelectCB select, ContinueCB cont, CancelCB cancel)
 {
     try
     {
         await TaskHelper.Timeout(
             mStartDialog(new StartParameters(moduleName, image, select, cont, cancel)), Defaults.TIMEOUT_MS);
     } catch (Exception e)
     {
         Console.WriteLine("exception in start dialog: {0}", e);
     }
 }
예제 #3
0
            public StartParameters(string moduleName, HeaderImage image, SelectCB select, ContinueCB cont, CancelCB cancel)
            {
                this.moduleName = moduleName;
                this.image      = image;
                this.select     = async(dynamic selectPar) =>
                {
                    object[]          pluginObjs = selectPar.plugins;
                    IEnumerable <int> pluginIds  = pluginObjs.Select(id => (int)id);
                    select(selectPar.stepId, selectPar.groupId, pluginIds.ToArray());
                    return(await Task.FromResult <object>(null));
                };

                this.cont = async(dynamic continuePar) =>
                {
                    string direction   = continuePar.direction;
                    int    currentStep = -1;
                    try
                    {
                        currentStep = continuePar.currentStepId;
                    }
                    catch (RuntimeBinderException)
                    {
                        // no problem, we'll just not validate if the message is for the expected page
                    }
                    cont(direction == "forward", currentStep);
                    return(await Task.FromResult <object>(null));
                };

                this.cancel = async(dynamic dummy) =>
                {
                    cancel();
                    return(await Task.FromResult <object>(null));
                };
            }