コード例 #1
0
		private void ChooseFileClicked (object sender, RoutedEventArgs e) {
			this.shortcut = (WebPageShortcut) this.Shortcut;

			OpenFileDialog dialog = new OpenFileDialog ();
			
			if (File.Exists (this.shortcut.Browser)) {
				dialog.InitialDirectory = System.IO.Path.GetDirectoryName (this.shortcut.Browser);
			}

			dialog.FileName = this.shortcut.Browser;
			dialog.CheckFileExists = true;
			dialog.CheckPathExists = true;
			bool? result = dialog.ShowDialog ();
			
			if (result.HasValue && result.Value) {
				this.shortcut.Browser = dialog.FileName;
			}
		}
コード例 #2
0
		private void TestUrlClicked (object sender, RoutedEventArgs e) {
			this.shortcut = (WebPageShortcut) this.Shortcut;

			Process.Start (new ProcessStartInfo (this.shortcut.Url));
			e.Handled = true;
		}