コード例 #1
0
        public void Initialize(SPFTask task)
        {
            IAsyncTaskProgress asyncProgress = new MyDefaultSingleTaskReporter();

            Mirror mirror = GetNewMirror(task);

            SourcePosition.MirrorControlerBox mirrorControler = new SourcePosition.MirrorControlerBox(task, mirror, asyncProgress);

            SourcePosition.SetMirrorControler(mirrorControler);

            //设置滚动条进度
            asyncProgress.ProgressChanged += (o, e) =>
            {
                ProgressPosition.FinishedSize = (int)e.Progress;
            };
            asyncProgress.Terminated += (o, e) =>
            {
                if (e.IsCompleted)
                {
                    ProgressPosition.FinishedSize = ProgressPosition.TotalSize;
                }
            };
        }