Inheritance: System.Xml.XmlDocument
Esempio n. 1
0
        public BaseRepository (string path, Configuration config)
        {
            Logger.LogInfo (path, "Initializing...");

            Status            = SyncStatus.Idle;
            Error             = ErrorStatus.None;
            this.local_config = config;
            LocalPath         = path;
            Name              = Path.GetFileName (LocalPath);
            RemoteUrl         = new Uri (this.local_config.UrlByName (Name));
            IsBuffering       = false;
            this.identifier   = Identifier;
            ChangeSets        = GetChangeSets ();

            string storage_type = this.local_config.GetFolderOptionalAttribute (Name, "storage_type");

            if (!string.IsNullOrEmpty (storage_type))
                StorageType = (StorageType) Enum.Parse(typeof(StorageType), storage_type);

            string is_paused = this.local_config.GetFolderOptionalAttribute (Name, "paused");
            if (is_paused != null && is_paused.Equals (bool.TrueString))
                Status = SyncStatus.Paused;

            string identifier_file_path = Path.Combine (LocalPath, ".sparkleshare");
            File.SetAttributes (identifier_file_path, FileAttributes.Hidden);

            if (!UseCustomWatcher)
                this.watcher = new Watcher (LocalPath);

            new Thread (() => CreateListener ()).Start ();

            this.remote_timer.Elapsed += RemoteTimerElapsedDelegate;
        }
Esempio n. 2
0
        public BaseController ()
        {
            string app_data_path = Environment.GetFolderPath (Environment.SpecialFolder.ApplicationData);

            if (InstallationInfo.OperatingSystem != OS.Windows && InstallationInfo.OperatingSystem != OS.Mac)
                app_data_path = Path.Combine (Environment.GetFolderPath (Environment.SpecialFolder.Personal), ".config");

            string config_path = Path.Combine (app_data_path, "org.sparkleshare.SparkleShare");
            
            Config = new Configuration (config_path, "projects.xml");
            Configuration.DefaultConfiguration = Config;

            UserAuthenticationInfo = new SSHAuthenticationInfo ();
            SSHAuthenticationInfo.DefaultAuthenticationInfo = UserAuthenticationInfo;

            FoldersPath = Config.FoldersPath;
        }