Пример #1
0
        private void DataGridView1_MouseDoubleClick(object sender, MouseEventArgs e)
        {
            if (dataGridView1.Rows.Count <= 0)
            {
                return;
            }
            int ind = dataGridView1.Rows.IndexOf(dataGridView1.SelectedRows[0]);

            if (ind >= 0)
            {
                ToggleButtons(DownloaderList[ind]);

                if (DownloaderList[ind].DownloadStatus == Downloader.Status.Downloading)
                {
                    CurrentDownloadWindow cdw = new CurrentDownloadWindow();
                    cdw.Downloader = DownloaderList[ind];
                    cdw.UpdateProgress(DownloaderList[ind].File);
                    cdw.ShowDialog();
                }
                else
                {
                    FilePropertiesWindow fpw = new FilePropertiesWindow();
                    fpw.Downloader = DownloaderList[ind];
                    fpw.ShowDialog();
                }
            }
        }
Пример #2
0
 static WindowManager()
 {
     NotepadWindows = new List <NotepadWindow>();
     WindowPreviews = new WindowManagerView();
     PropertiesView = new FilePropertiesWindow();
     ClipboardWin   = new ClipboardWindow();
     Preferences    = new PreferencesWindow();
     Help           = new HelpWindow();
 }
Пример #3
0
        private void filePropertiesMenuItem_Activated(object sender, EventArgs args)
        {
            IDirectoryItem item = GetSelectedItem();

            if (item is IFile)
            {
                FilePropertiesWindow win = new FilePropertiesWindow((IFile)item);
                win.Show();
            }
        }
Пример #4
0
        private void propertiesCmd()
        {
            int headerOffset         = (int)fsctrl.getFileHeaderOffset(selection.FileHeader.NamePlusExtensionWithoutZeros, fsctrl.CurrDirCluster, false);
            FilePropertiesWindow fpw = new FilePropertiesWindow(selection.FileHeader);

            if (fpw.ShowDialog().Value)
            {
                fsctrl.writeBytes(headerOffset, selection.FileHeader.toByteArray());
                selection.refresh();
            }
        }
Пример #5
0
        /// <summary>
        /// Show file property.
        /// </summary>
        public void ShowProperties(string fileDisplayedName, string fileLocation, MediaType mediaType, string duration, string resolution)
        {
            if (!File.Exists(fileLocation))
            {
                MyMessageBox.Show("文件不存在 !", MessageBoxButton.OK, MessageBoxImage.Warning);
                return;
            }

            FilePropertiesWindow fpw = new FilePropertiesWindow();

            fpw.FileDisplayedName = fileDisplayedName;
            fpw.FileLocation      = fileLocation;
            fpw.MediaType         = mediaType;
            fpw.Duration          = duration;
            fpw.Resolution        = resolution;
            fpw.ShowDialog();
        }
Пример #6
0
		void FilePropertiesButtonClicked (object sender, EventArgs args)
		{
			try {
				TreeIter iter;
				if (resultsTree.Selection.GetSelected(out iter)) {
					SearchResult selectedResult = resultsTree.Model.GetValue(iter, 0) as SearchResult;
					if (selectedResult != null && selectedResult.Type == SearchResultType.File) {
						var path = PathUtil.Join(selectedResult.Node.Directory.FullPath, selectedResult.FileListing.FullPath);
						Runtime.Core.FileSystem.BeginGetFileDetails(path, delegate (IFile file) {
							Application.Invoke(delegate {
								var win = new FilePropertiesWindow(file);
								win.Show();
							});
						});
					}
				}
			} catch (Exception ex) {
				LoggingService.LogError(ex);
				Gui.ShowErrorDialog(ex.Message);
			}
		}
Пример #7
0
        private void createCmd(bool isDirectory)
        {
            FileHeader fh = new FileHeader(Session.userInfo);

            fh.IsDirectory = isDirectory;
            if (isDirectory)
            {
                fh.Name      = "newdir";
                fh.Extension = "";
            }

            FilePropertiesWindow fpw = new FilePropertiesWindow(fh);

            if (fpw.ShowDialog().Value)
            {
                try
                {
                    fsctrl.writeFile(fsctrl.CurrDir, fh, null, true);
                    FileView fv = addFileView(fh);
                    onFileViewMouseDown(fv, null);
                }
                catch (Exception e)
                {
                    MessageBox.Show(e.Message, "Ошибка", MessageBoxButton.OK, MessageBoxImage.Error);
                    if (e is RootdirOutOfSpaceException || e is DiskOutOfSpaceException)
                    {
                        try
                        {
                            fsctrl.deleteFile(fsctrl.CurrDir, fh, false);
                        }
                        catch
                        {
                            //ignore
                        }
                    }
                }
            }
        }
Пример #8
0
        protected BaseL3dFileViewModel(LoksimFile openFile, Window parentWindow)
        {
            CurrentFile  = openFile;
            ParentWindow = parentWindow;

            _fileSaveCmd = new RelayCommand(obj =>
            {
                SaveOrSaveAs(false);
            },
                                            obj =>
            {
                return(CurrentFile != null && !L3dFilePath.IsNullOrEmpty(CurrentFile.OwnPath));
            }
                                            );


            _fileSaveAsCmd = new RelayCommand(obj =>
            {
                SaveOrSaveAs(true);
            },
                                              obj =>
            {
                return(CurrentFile != null);
            }
                                              );

            FilePropertiesCmd = new RelayCommand(obj =>
            {
                Window dlg = new FilePropertiesWindow(CurrentFile);
                dlg.Owner  = ParentWindow;
                dlg.ShowDialog();
            },
                                                 obj =>
            {
                return(CurrentFile != null);
            }
                                                 );

            UndoCmd = new RelayCommand(obj =>
            {
                UndoAwareFile f = CurrentFile as UndoAwareFile;
                if (f != null)
                {
                    f.Undo();
                }
            },
                                       obj =>
            {
                UndoAwareFile f = CurrentFile as UndoAwareFile;
                return(f != null && f.UndoPossible);
            }
                                       );

            RedoCmd = new RelayCommand(obj =>
            {
                UndoAwareFile f = CurrentFile as UndoAwareFile;
                if (f != null)
                {
                    f.Redo();
                }
            },
                                       obj =>
            {
                UndoAwareFile f = CurrentFile as UndoAwareFile;
                return(f != null && f.RedoPossible);
            }
                                       );
        }
Пример #9
0
 private void showFilePropertiesButton_clicked(object sender, EventArgs args)
 {
     FilePropertiesWindow win = new FilePropertiesWindow(transfer.File);
     win.Show();
 }
Пример #10
0
        private void showFilePropertiesButton_clicked(object sender, EventArgs args)
        {
            FilePropertiesWindow win = new FilePropertiesWindow(transfer.File);

            win.Show();
        }