Exemplo n.º 1
0
        private void InfiniumFileList_ItemDoubleClick(object sender, int FolderID, int FileID)
        {
            if (FileID > -1)//open file
            {
                PhantomForm PhantomForm = new PhantomForm();
                PhantomForm.Show();

                UploadFileForm UploadFileForm = new UploadFileForm(ref InfiniumFiles.FM, ref InfiniumFiles,
                                                                   InfiniumFileList.FileItems[InfiniumFileList.Selected].Caption,
                                                                   InfiniumFileList.FileItems[InfiniumFileList.Selected].FolderID,
                                                                   InfiniumFileList.FileItems[InfiniumFileList.Selected].FileID,
                                                                   false, "", ref TopForm);

                TopForm = UploadFileForm;

                UploadFileForm.ShowDialog();

                if (UploadFileForm.bOk == 0)
                {
                    InfiniumTips.ShowTip(this, 50, 85, "Отсутствует файл либо нет доступа к интернет", 5000);
                }

                PhantomForm.Close();
                PhantomForm.Dispose();

                TopForm = null;
                UploadFileDialog.Dispose();

                return;
            }

            if (FolderID != -1)
            {
                Thread T = new Thread(delegate()
                {
                    SplashWindow.CreateCoverSplash(InfiniumFileList.Top + UpdatePanel.Top, InfiniumFileList.Left + UpdatePanel.Left,
                                                   InfiniumFileList.Height, InfiniumFileList.Width);
                });
                T.Start();

                while (!SplashWindow.bSmallCreated)
                {
                    ;
                }


                InfiniumFiles.EnterFolder(FolderID);

                InfiniumFileList.ItemsDataTable = InfiniumFiles.CurrentItemsDataTable.Copy();

                InfiniumFileList.EnterInFolder(FolderID);
                InfiniumFileList.Entered = FolderID;

                bC = true;
            }
        }
Exemplo n.º 2
0
        private void RemoveButton_Click(object sender, EventArgs e)
        {
            if (InfiniumFileList.Selected == -1)
            {
                return;
            }

            if (InfiniumFileList.FileItems[InfiniumFileList.Selected].Caption == "[...]")
            {
                return;
            }

            if (InfiniumFiles.CurrentItemsDataTable.Select("FolderID = " +
                                                           InfiniumFileList.FileItems[InfiniumFileList.Selected].FolderID)[0]["Extension"].ToString() == "folder")
            {
                if (InfiniumFiles.CheckFolderPermission(Security.CurrentUserID, InfiniumFileList.FileItems[InfiniumFileList.Selected].FolderID) == false)
                {
                    InfiniumTips.ShowTip(this, 50, 85, "Недостаточно прав", 3600);
                    return;
                }
            }
            else
            {
                if (InfiniumFiles.CanEditFile(Security.CurrentUserID, InfiniumFileList.FileItems[InfiniumFileList.Selected].FileID) == false)
                {
                    InfiniumTips.ShowTip(this, 50, 85, "Недостаточно прав", 3600);
                    return;
                }
            }



            if (InfiniumFileList.CheckVisible)
            {
                int r = InfiniumFiles.CheckCheckedItems(InfiniumFileList.ItemsDataTable);

                if (r == 0)
                {
                    InfiniumTips.ShowTip(this, 50, 85, "Выберите один или несколько файлов", 5600);

                    return;
                }

                bool OK = LightMessageBox.Show(ref TopForm, true,
                                               "Удалить выбранные файлы\\папки?", "Удаление");

                if (!OK)
                {
                    return;
                }

                InfiniumFiles.RemoveFolder(InfiniumFileList.ItemsDataTable);
                InfiniumFiles.RemoveFile(InfiniumFileList.ItemsDataTable);
            }
            else
            {
                if (InfiniumFileList.Selected > -1)
                {
                    bool OK = LightMessageBox.Show(ref TopForm, true,
                                                   "Удалить?", "Удаление");

                    if (!OK)
                    {
                        return;
                    }

                    if (InfiniumFiles.CurrentItemsDataTable.Select("FolderID = " +
                                                                   InfiniumFileList.FileItems[InfiniumFileList.Selected].FolderID)[0]["Extension"].ToString() == "folder")
                    {
                        if (InfiniumFiles.RemoveFolder(InfiniumFileList.FileItems[InfiniumFileList.Selected].FolderID) == false)
                        {
                            InfiniumTips.ShowTip(this, 50, 85, "Ошибка удаления папки с хостинга", 4000);
                        }
                    }
                    else
                    {
                        InfiniumFiles.RemoveFile(InfiniumFileList.FileItems[InfiniumFileList.Selected].FileID,
                                                 InfiniumFileList.FileItems[InfiniumFileList.Selected].FolderID,
                                                 InfiniumFileList.FileItems[InfiniumFileList.Selected].Caption);
                    }
                }
            }


            Thread T = new Thread(delegate()
            {
                SplashWindow.CreateCoverSplash(InfiniumFileList.Top + UpdatePanel.Top, InfiniumFileList.Left + UpdatePanel.Left,
                                               InfiniumFileList.Height, InfiniumFileList.Width);
            });

            T.Start();

            while (!SplashWindow.bSmallCreated)
            {
                ;
            }


            InfiniumFiles.EnterFolder(InfiniumFileList.Entered);

            InfiniumFileList.ItemsDataTable = InfiniumFiles.CurrentItemsDataTable;
            InfiniumFileList.EnterInFolder(InfiniumFileList.Entered);


            if (InfiniumFileList.CheckVisible)
            {
                InfiniumFileList.CheckVisible = false;
                CheckMultipleButton.BringToFront();
            }

            bC = true;
        }
Exemplo n.º 3
0
        private void AddFolderButton_Click(object sender, EventArgs e)
        {
            if (InfiniumFileList.Entered > -1)
            {
                if (InfiniumFileList.CheckVisible)
                {
                    InfiniumFileList.CheckVisible = false;
                    CheckMultipleButton.BringToFront();
                }

                if (InfiniumFiles.CheckInheritedPermission(Security.CurrentUserID, InfiniumFileList.Entered) == false)
                {
                    InfiniumTips.ShowTip(this, 50, 85, "Недостаточно прав", 3600);
                    return;
                }

                PhantomForm PhantomForm = new PhantomForm();
                PhantomForm.Show();

                CreateFolderForm CreateFolderForm = new CreateFolderForm(ref InfiniumFiles, ref TopForm);

                TopForm = CreateFolderForm;

                CreateFolderForm.ShowDialog();

                PhantomForm.Close();
                PhantomForm.Dispose();

                TopForm = null;

                if (CreateFolderForm.Canceled)
                {
                    return;
                }


                Thread T = new Thread(delegate()
                {
                    SplashWindow.CreateCoverSplash(InfiniumFileList.Top + UpdatePanel.Top, InfiniumFileList.Left + UpdatePanel.Left,
                                                   InfiniumFileList.Height, InfiniumFileList.Width);
                });
                T.Start();

                while (!SplashWindow.bSmallCreated)
                {
                    ;
                }


                InfiniumFiles.CreateFolder(InfiniumFileList.Entered, CreateFolderForm.FolderName);

                InfiniumFiles.EnterFolder(InfiniumFileList.Entered);

                InfiniumFileList.ItemsDataTable = InfiniumFiles.CurrentItemsDataTable;
                InfiniumFileList.EnterInFolder(InfiniumFileList.Entered);

                CreateFolderForm.Dispose();

                bC = true;
            }
        }