Exemplo n.º 1
0
        public DemoSyncany()
        {
            InitializeComponent();

            _workingDirectory         = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + @"\Servodroid\Droid-Infra\";
            _intSyn                   = new SyncanyAdapter();
            cloudView1.SyncanyAdapter = _intSyn;
        }
        public CloudRepositories(SyncanyAdapter syncany, string workingDirectory)
        {
            _workingDirectory = workingDirectory;
            _syncany          = syncany;

            InitializeComponent();
            Init();
        }
        public CloudRepositories()
        {
            _workingDirectory = null;
            _syncany          = null;

            InitializeComponent();
            Init();
        }
Exemplo n.º 4
0
        public CloudStatus(SyncanyAdapter syncany, string workingDirectory)
        {
            _syncany          = syncany;
            _workingDirectory = workingDirectory;

            InitializeComponent();
            Init();
        }
Exemplo n.º 5
0
        public CloudCreate()
        {
            _workingDirectory = null;
            _syncany          = null;

            InitializeComponent();
            Init();
        }
Exemplo n.º 6
0
        public CloudManage(SyncanyAdapter syncany, string workingDirectory)
        {
            _syncany          = syncany;
            _workingDirectory = workingDirectory;
            _timer            = new Timer();
            _timer.Interval   = 37000;
            _timer.Tick      += _timer_Tick;

            InitializeComponent();
        }
        private void InitSyncany()
        {
            _infraSyncany = new SyncanyAdapter();

            _viewSyncanyRepositories      = new PanelCustom(new CloudRepositories(_infraSyncany, _workingDirectory));
            _viewSyncanyRepositories.Name = "CurrentView";

            _viewSyncanyCreate      = new PanelCustom(new CloudCreate(_infraSyncany, _workingDirectory));
            _viewSyncanyCreate.Name = "CurrentView";

            _viewSyncanyManage      = new PanelCustom(new CloudManage(_infraSyncany, _workingDirectory));
            _viewSyncanyManage.Name = "CurrentView";
        }
        private void Init()
        {
            Tools4Libraries.Log.ApplicationAppData = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + @"\Servodroid\Droid-Infra";
            if (_syncany == null)
            {
                _syncany = new SyncanyAdapter();
            }

            comboBoxConnectionAddedRepo.Items.Clear();
            foreach (Plugin plugin in SyncanyCommander.AvalailablePlugins)
            {
                comboBoxConnectionAddedRepo.Items.Add(plugin.Id);
            }
            comboBoxConnectionAddedRepo.SelectedItem = "local";
        }
        public void AddInfra(string type, string name = null, string url = null)
        {
            if (string.IsNullOrEmpty(type))
            {
                return;
            }
            InfraAdapter ia = null;

            switch (type.ToLower())
            {
            case "server":
                ia = new ComputerAdapter(this);
                break;

            case "sonarqube":
                ia = new SonarAdapter(this);
                break;

            case "sql":
                ia = new SqlAdapter(this);
                break;

            //case "vpn":
            //    ia = _openvpnAdapter;
            //    break;
            //case "docker":
            //    ia = _dockerAdapter;
            //    break;
            case "team city":
                ia = new TeamCityAdapter(this);
                break;

            case "bitbucket":
                ia = new BitbucketAdapter(this);
                break;

            case "postgresql":
                ia = new PostGreAdapter(this);
                break;

            case "syncany":
                ia = new SyncanyAdapter(this);
                break;

            default:
                break;
            }

            if (ia != null)
            {
                try
                {
                    ia.Name = name != null ? name : ia.GetType().ToString().Split('.')[ia.GetType().ToString().Split('.').Length - 1].Replace("Adapter", string.Empty);
                    ia.Url  = url;
                    InfraFarm.Add(ia);
                    //GoAction("Infra_Save");
                }
                catch (Exception e)
                {
                }
            }
        }
 private void buttonPlugin_Click(object sender, EventArgs e)
 {
     SyncanyAdapter.PluginInstall(textBoxPlugin.Text);
 }
 private void buttonRestores_Click(object sender, EventArgs e)
 {
     SyncanyAdapter.Restores(textBoxRestores.Text);
 }
 private void buttonStart_Click(object sender, EventArgs e)
 {
     SyncanyAdapter.Starts();
 }
 private void InitSyncany()
 {
     _infraSyncany = new SyncanyAdapter();
 }