Exemple #1
0
        private void bNewFolder_Click(object sender, EventArgs e)
        {
            String name = Interaction.InputBox("フォルダ名称", "", "", -1, -1);

            if (name.Length == 0)
            {
                return;
            }

            using (GenRes newf = DInfo.NewFolder(UUt.CombineFile(navi, name), conn)) {
                if (!newf.Success)
                {
                    MessageBox.Show(this, "フォルダの作成に失敗しました:" + newf.err.Message, Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                }
            }
            RefreshView();
        }
Exemple #2
0
            public UTRes UploadThem(String[] alfp, Uri baseUri)
            {
                foreach (String fp in alfp)
                {
                    if (cancel.WaitOne(0, false))
                    {
                        return(UTRes.Cancel);
                    }
                    Uri uriTo = UUt.CombineFile(baseUri, Path.GetFileName(fp));
                    using (HeadRes head = DInfo.Head(uriTo, conn)) {
                        head.Dispose();
                        if (0 == (File.GetAttributes(fp) & FileAttributes.Directory))
                        {
                            if (head.Exists)
                            {
                                switch (QueryOvwr(head.baseUri.ToString()))
                                {
                                case DialogResult.Yes:
                                    break;

                                case DialogResult.No:
                                    continue;

                                case DialogResult.Cancel:
                                    return(UTRes.Cancel);
                                }
                            }
                            head.Dispose();
                            using (GenRes uploaded = DInfo.Upload2(uriTo, fp, conn, nio, cancel)) {
                                if (cancel.WaitOne(0, true))
                                {
                                    using (GenRes rest = DInfo.Delete(uriTo, conn)) {
                                    }
                                }
                            }
                            using (GenRes set = DInfo.SetMt(uriTo, fp, conn)) {
                            }
                        }
                        else
                        {
                            Uri uriDir = UUt.CombineFile(baseUri, Path.GetFileName(fp));

                            if (!head.Exists)
                            {
                                using (GenRes newf = DInfo.NewFolder(uriTo, conn)) {
                                    if (!newf.Success)
                                    {
                                        continue;
                                    }
                                }
                            }

                            switch (UploadThem(Directory.GetFileSystemEntries(fp), uriDir))
                            {
                            case UTRes.Cancel:
                                return(UTRes.Cancel);
                            }
                        }
                    }
                }
                return(UTRes.Ok);
            }