Code:
/ DotNET / DotNET / 8.0 / untmp / whidbey / REDBITS / ndp / fx / src / WinForms / Managed / System / WinForms / FileDialogCustomPlacesCollection.cs / 1 / FileDialogCustomPlacesCollection.cs
//------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //----------------------------------------------------------------------------- using System; using System.Collections.ObjectModel; using System.IO; using System.Security; using System.Security.Permissions; namespace System.Windows.Forms { public class FileDialogCustomPlacesCollection : Collection{ internal void Apply(FileDialogNative.IFileDialog dialog) { //Assert FileIOPermission for getting the paths for the favorites new FileIOPermission(PermissionState.Unrestricted).Assert(); //Walk backwards for (int i = this.Items.Count - 1; i >= 0; --i) { FileDialogCustomPlace customPlace = this.Items[i]; try { FileDialogNative.IShellItem shellItem = customPlace.GetNativePath(); if (null != shellItem) { dialog.AddPlace(shellItem, 0); } } catch (FileNotFoundException) { } //Silently absorb FileNotFound exceptions (these could be caused by a path that disappeared after the place was added to the dialog). } } public void Add(string path) { Add(new FileDialogCustomPlace(path)); } public void Add(Guid knownFolderGuid) { Add(new FileDialogCustomPlace(knownFolderGuid)); } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. // Copyright (c) Microsoft Corporation. All rights reserved.
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- SubstitutionList.cs
- DialogWindow.cs
- AddInServer.cs
- SignalGate.cs
- TextFragmentEngine.cs
- FormViewInsertedEventArgs.cs
- TypeDescriptionProvider.cs
- XmlSchemaNotation.cs
- SystemGatewayIPAddressInformation.cs
- ImageListUtils.cs
- Lasso.cs
- OneToOneMappingSerializer.cs
- BoundsDrawingContextWalker.cs
- CodeThrowExceptionStatement.cs
- SqlTypesSchemaImporter.cs
- SqlMultiplexer.cs
- TableCellAutomationPeer.cs
- TrackBar.cs
- PathData.cs
- DetailsViewDeletedEventArgs.cs
- SqlUnionizer.cs
- IndicFontClient.cs
- oledbconnectionstring.cs
- EventLogQuery.cs
- WebPartVerb.cs
- XmlAttribute.cs
- RepeatButton.cs
- ColorTransform.cs
- Rijndael.cs
- ProtocolsConfiguration.cs
- AutoSizeToolBoxItem.cs
- RewritingPass.cs
- DataGridViewTopLeftHeaderCell.cs
- CqlLexer.cs
- TreeNodeStyle.cs
- PrivilegedConfigurationManager.cs
- DateTimeValueSerializer.cs
- TreeNode.cs
- FixedHyperLink.cs
- EventMap.cs
- StrongNameKeyPair.cs
- DataControlButton.cs
- ArrayWithOffset.cs
- TemplateInstanceAttribute.cs
- CultureSpecificCharacterBufferRange.cs
- RetrieveVirtualItemEventArgs.cs
- ExtenderProviderService.cs
- TextServicesHost.cs
- Console.cs
- RegexRunner.cs
- Environment.cs
- CurrentTimeZone.cs
- OutArgument.cs
- UmAlQuraCalendar.cs
- SvcMapFileSerializer.cs
- odbcmetadatacolumnnames.cs
- SystemIcons.cs
- InputReport.cs
- Bitmap.cs
- ElementFactory.cs
- IndexedWhereQueryOperator.cs
- RemoteHelper.cs
- panel.cs
- Bits.cs
- ObjectResult.cs
- PageEventArgs.cs
- TextBoxAutoCompleteSourceConverter.cs
- SingleAnimationBase.cs
- CustomError.cs
- HtmlPageAdapter.cs
- ToolboxDataAttribute.cs
- StylusSystemGestureEventArgs.cs
- BmpBitmapDecoder.cs
- CursorInteropHelper.cs
- DataColumnMappingCollection.cs
- PublishLicense.cs
- PageParserFilter.cs
- Char.cs
- VScrollProperties.cs
- HttpClientCertificate.cs
- XmlAttributeProperties.cs
- ViewCellSlot.cs
- TextServicesContext.cs
- UpdateException.cs
- XomlCompilerResults.cs
- WmfPlaceableFileHeader.cs
- SdlChannelSink.cs
- DataReaderContainer.cs
- BitmapCodecInfo.cs
- FormsIdentity.cs
- Odbc32.cs
- SearchForVirtualItemEventArgs.cs
- ReferencedAssembly.cs
- XmlNodeChangedEventManager.cs
- DataColumnMapping.cs
- ItemDragEvent.cs
- PropertyChangingEventArgs.cs
- HttpListenerContext.cs
- Margins.cs
- SQLBytes.cs