private void PropertyFrm_Load(object sender, EventArgs e)
        {
            this.Text = FileMeta.filename;

            FileManager fm = new FileManager(Program.fsConnect);
            fm.GetStatus(FileMeta.FilePath, 2, FileMeta.filename, new FileSyncAPIRequest.FileSyncRequestCompletedHandler(GetStatusFinish));
        }
        private void GetFolder(string path)
        {
            if (path == "/")
            {
                path = "share_root";
            }

            if (this.FileSync != null)
            {
                FileManager fm = new FileManager(this.FileSync);
                fm.GetTree(false, path, new FileSyncAPIRequest.FileSyncRequestCompletedHandler(GetTreeFinish));
            }
        }
Exemple #3
0
        private void ShowLoginWindow()
        {
            this.Hide();

            LoginFrm loginFrm = new LoginFrm();
            loginFrm.Owner = this;
            DialogResult result = loginFrm.ShowDialog();

            if (result == DialogResult.OK)
            {
                tvTree.FileSync = Program.fsConnect;
                fm = new FileManager(Program.fsConnect);
                loginFrm.Close();
                this.Show();

                //UiLog.Log(FileSyncSDK.FileSync.CurrentUser.SessionID);
            }
            else
            {
                this.Close();
            }
        }
        protected TaskForm()
        {
            InitializeComponent();

            fm = new FileManager(Program.fsConnect);
        }
Exemple #5
0
        private void RenametoolStripMenuItem_Click(object sender, EventArgs e)
        {
            if (listView1.SelectedItems != null && listView1.SelectedItems.Count > 0)
            {
                ListViewItem item = listView1.SelectedItems[0];
                FileMeta meta = item.Tag as FileMeta;

                FSTypingDialog dlg = new FSTypingDialog();
                dlg.InputText = meta.filename;

                if (dlg.ShowDialog() == DialogResult.OK)
                {
                    FileManager fm = new FileManager(Program.fsConnect);
                    fm.Rename(meta.FilePath, meta.filename, dlg.InputText, new FileSyncAPIRequest.FileSyncRequestCompletedHandler(RenameFinish));
                }
            }
        }
Exemple #6
0
        private void deleteToolStripMenuItem_Click(object sender, EventArgs e)
        {
            if (listView1.SelectedItems != null && listView1.SelectedItems.Count > 0)
            {
                if (MessageBox.Show("确认删除文件吗?\r\n文件一经删除,将无法找回。请谨慎操作。", Program.AppName, MessageBoxButtons.OKCancel) == DialogResult.OK)
                {
                    FileManager fm = new FileManager(Program.fsConnect);

                    for (int i = 0; i < listView1.SelectedItems.Count; i++)
                    {
                        ListViewItem lvItem = listView1.SelectedItems[i];
                        FileMeta meta = lvItem.Tag as FileMeta;
                        fm.Delete(meta.FilePath, 1, meta.filename, new FileSyncAPIRequest.FileSyncRequestCompletedHandler(DeleteFinish));
                    }
                }
            }
        }
Exemple #7
0
        private void tsbNewFolder_Click(object sender, EventArgs e)
        {
            FSTypingDialog dlg = new FSTypingDialog();
            dlg.Owner = this;
            dlg.Text = "New Folder";

            if (dlg.ShowDialog() == DialogResult.OK)
            {
                FileManager fm = new FileManager(Program.fsConnect);
                fm.CreateDir(dlg.InputText, tbUrl.Text, new FileSyncAPIRequest.FileSyncRequestCompletedHandler(CreateDirFinish));
            }
        }
Exemple #8
0
        private void btnUpload_Click(object sender, EventArgs e)
        {
            if (openFileDialog1.ShowDialog() == DialogResult.OK)
            {
                string selectedFile = openFileDialog1.FileName;
                string newFileName = Guid.NewGuid().ToString() + "_" + System.IO.Path.GetFileName(selectedFile);

                FileManager mgr = new FileManager(Program.fsConnect);
                mgr.Upload(tbUrl.Text, false, selectedFile, newFileName, new FileSyncAPIRequest.FileSyncRequestCompletedHandler(UploadFinish));
            }
        }
Exemple #9
0
 private void aboutToolStripMenuItem_Click(object sender, EventArgs e)
 {
     FileManager fm = new FileManager(Program.fsConnect);
     fm.GetDomainIPList(new FileSyncAPIRequest.FileSyncRequestCompletedHandler(GetDomainIPListFinish));
 }