none
Pas de définitions .hasCurrent .MoveNext RRS feed

  • Question

  • Bonjour,

    Je suis les explications de cette page : http://msdn.microsoft.com/en-us/library/windows/apps/xaml/hh977055.aspx

    A la variable iter, je n'ai pas les définitions :

    Il me manque un using ? :

    using System;
    using System.Collections;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    using System.Threading.Tasks;
    using Windows.ApplicationModel.Background;
    
    namespace TaskTile
    {
        public sealed class ScheduledAgent : IBackgroundTask
        {
            public void Run(IBackgroundTaskInstance taskInstance)   
    
            {
                var taskRegistered = false;
                var exampleTaskName = "ExampleBackgroundTask";
    
                var iter = Windows.ApplicationModel.Background.BackgroundTaskRegistration.AllTasks.First();
                while (iter.hasCurrent)
                {
                    var task = iter.current.value;
    
                    if (task.name == exampleTaskName)
                    {
                        taskRegistered = true;
                        break;
                    }
    
                    iter.moveNext();
                }
            }        
        }
    }
    Merci de votre aide, christophe


    Christophe

    dimanche 21 octobre 2012 15:51

Réponses