Example #1
0
        public Replicator(ReplicatorContext context)
        {
            this.Context = context;
            this.actions = new List <SyncAction>();

            if (context.IgnoreCertificateErrors)
            {
                ServicePointManager.ServerCertificateValidationCallback = (sender, cert, chain, errors) =>
                {
                    return(true);
                };
            }

            if (ReplicatorContext.IsRunningOnMono)
            {
                Environment.SetEnvironmentVariable("MONO_IOMAP", "all");
            }

            if (!context.Recover && context.IsRunning)
            {
                throw new AnotherInstanceIsRunningException();
            }

            context.IsRunning = true;

            context.DataDirectory.Create();

            context.Persist();
        }
Example #2
0
 public SyncActionListBuilder(ReplicatorContext context)
 {
     this.Context          = context;
     this.ActionDictionary = new Dictionary <string, SyncAction>();
     this.Actions          = new List <SyncAction>();
     this.TypeChooser      = this.CreateSyncActionTypeChooser();
 }
Example #3
0
        public async Task Reconstruct(ReplicatorContext context)
        {
            this.LocalPath  = context.LocalPath + this.CommonPath;
            this.RemotePath = context.RemotePath + this.CommonPath;

            if (this.Type == SyncActionType.Download)
            {
                this.Remote = await context.CloudService.FileSelectAsync(this.RemotePath);
            }
            else if (this.Type == SyncActionType.Upload)
            {
                this.Local = await context.LocalFilesystem.FileSelectAsync(this.LocalPath);
            }
        }
Example #4
0
 public DropboxService(ReplicatorContext context)
 {
     this.context = context;
 }
 public SyncActionTypeChooserTwoWay(ReplicatorContext context)
 {
     this.context = context;
 }
 public LocalFilesystemService(ReplicatorContext context)
 {
     this.context = context;
 }