Example #1
0
        public static string GetSettingsFile()
        {
            string fileDir = ClouderSyncPackage.GetVSAppFolder();

            fileName = Path.Combine(fileDir, "connectionentry.xml");
            return(fileName);
        }
Example #2
0
        protected void WriteLog(string Message)
        {
            resultMessages.Append(Message);
            resultMessages.AppendLine(" \n");

            Message += '\n';
            AppendTextBox(Message);
            ClouderSyncPackage.Log(Message);
//            editLog.Text = Message;
        }
Example #3
0
        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);
        }
Example #4
0
 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);
 }
Example #5
0
 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);
 }
Example #6
0
        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();
        }
Example #7
0
 public void Log(string message)
 {
     LogToStringBuilder(resultMessages, message);
     ClouderSyncPackage.WriteToOutputWindow(message, "ClouderSync", null, false);
 }
Example #8
0
 protected void InitOutputPane()
 {
     pane = ClouderSyncPackage.GetWindowPane(Guid.Empty, "ClouderSync", true, true);
 }
Example #9
0
 public ConnectionList(ClouderSyncPackage _package)
 {
     package = _package;
     InitializeComponent();
 }