//Constructor
        public CloudSyncService(IAgentContextProvider agentContextProvider)
        {
            _agentContextProvider = agentContextProvider;

            CloudConfig cc = InitConfig();

            if (_isActive)
            {
                switch (cc.provider)
                {
                case CloudConfig.Provider.WebDav:
                    _syncService = new WebdavSyncService(cc);
                    break;

                case CloudConfig.Provider.GoogleDrive:
                    //ToDo
                    break;

                case CloudConfig.Provider.OneDrive:
                    //ToDo
                    break;

                //...
                default:
                    break;
                }
            }
        }
        //Sets the cloud configuration
        private CloudConfig InitConfig()
        {
            //ToDo: Load saved configuration
            _isActive = true;

            if (_isActive)
            {
                CloudConfig cloudConfig = new CloudConfig();
                cloudConfig.provider      = CloudConfig.Provider.WebDav;
                cloudConfig.uri           = "https://example.org/webdav/remote.php/";
                cloudConfig.username      = "******";
                cloudConfig.password      = "******";
                cloudConfig.pathToDir     = "Path/To/Dir";
                cloudConfig.encryptionKey = "SecretKeyForAgentContext";

                return(cloudConfig);
            }

            return(null);
        }
Ejemplo n.º 3
0
 //Constructor
 public WebdavSyncService(CloudConfig cloudConfig)
 {
     _cloudConfig = cloudConfig;
 }