Ejemplo n.º 1
0
        public void runner()
        {
            IFlickrConnect fc = new FlickrConnect();
            IDriveEnumerator de = new DriveEnumerator();
            IFolderEnumerator fe = new FolderEnumerator();

            FlickrDriveSynchronizer syncer = new FlickrDriveSynchronizer(de, fe, fc);
            try
            {
                syncer.Sync(m_root_folder);
            }
            catch (Exception e)
            {
                DisplayException(e);
            }

            if (Application.Current.Dispatcher.CheckAccess())
                EnableStartButton();
            else
            {
                Application.Current.Dispatcher.BeginInvoke(DispatcherPriority.Normal,
                    new Action(() => { EnableStartButton(); }));
            }
        }
        FlickrDriveSynchronizer_Accessor CreateAccessor(IFlickrConnect fc)
        {
            IDriveEnumerator de = new FakeDriveEnumerator();
            IFolderEnumerator fe = new FakeFolderEnumerator();

            FlickrDriveSynchronizer fds = new FlickrDriveSynchronizer(de, fe, fc);
            //FlickrDriveSynchronizer fds = new FlickrDriveSynchronizerTestExtend(de, fe, fc);

            PrivateObject param0 = new PrivateObject(fds);
            FlickrDriveSynchronizer_Accessor retval = new FlickrDriveSynchronizer_Accessor(param0);
            retval.ILocalPictureObjectType = typeof(FakeLocalPicture);

            return retval;
        }