public static string GetSettingsFile() { string fileDir = ClouderSyncPackage.GetVSAppFolder(); fileName = Path.Combine(fileDir, "connectionentry.xml"); return(fileName); }
protected void WriteLog(string Message) { resultMessages.Append(Message); resultMessages.AppendLine(" \n"); Message += '\n'; AppendTextBox(Message); ClouderSyncPackage.Log(Message); // editLog.Text = Message; }
private void backgroundWorker1_DoWork(object sender, DoWorkEventArgs e) { ClouderSyncPackage.Log("Starting connection test..."); // WriteLog("Starting connection test..."); SFTPSyncClient client = null; resultMessages.Clear(); TestConnection(ref client); testResult = resultMessages.ToString(); if (client != null) { testResult = client.getLogMessages(); } //WriteLog(testResult); MessageBox.Show(testResult, "Test Result", MessageBoxButtons.OK, MessageBoxIcon.Information); }
public bool SaveEntry() { try { string xmlFile = GetSettingsFile(); XmlSerializer serializer = new XmlSerializer(typeof(CONNECTENTRY));// typeof(CONNECTENTRY)); TextWriter textWriter = new StreamWriter(xmlFile); serializer.Serialize(textWriter, (CONNECTENTRY)this.ce); textWriter.Close(); } catch (Exception eWrite) { ClouderSyncPackage.Log(eWrite.Message); return(false); } return(true); }
protected bool ReadEntry(ref CONNECTENTRY ceDest) { try { string xmlFile = GetSettingsFile(); XmlSerializer serializer = new XmlSerializer(typeof(CONNECTENTRY));// typeof(CONNECTENTRY)); FileStream textReader = new FileStream(xmlFile, FileMode.Open); ceDest = (CONNECTENTRY)serializer.Deserialize(textReader); textReader.Close(); } catch (Exception eRead) { ClouderSyncPackage.Log(eRead.Message); return(false); } return(true); }
public ConnectionEntryForm(ClouderSyncPackage _package, string projectRoot = null) { package = _package; resultMessages = new StringBuilder(); connectEntry = new ConnectEntryData(); if (projectRoot != null) { projectDirectory = projectRoot; } InitializeComponent(); connectEntry.ReadEntry(); if (projectDirectory != null && projectDirectory != string.Empty) { connectEntry.ce.localsrcpath = projectDirectory; } BindControls(); }
public void Log(string message) { LogToStringBuilder(resultMessages, message); ClouderSyncPackage.WriteToOutputWindow(message, "ClouderSync", null, false); }
protected void InitOutputPane() { pane = ClouderSyncPackage.GetWindowPane(Guid.Empty, "ClouderSync", true, true); }
public ConnectionList(ClouderSyncPackage _package) { package = _package; InitializeComponent(); }