Code:
/ FX-1434 / FX-1434 / 1.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
- UInt64.cs
- SqlCommandBuilder.cs
- ValueUnavailableException.cs
- PartialCachingAttribute.cs
- DataGridViewCellStyle.cs
- TransportChannelListener.cs
- ApplicationFileCodeDomTreeGenerator.cs
- VoiceChangeEventArgs.cs
- TiffBitmapEncoder.cs
- TextRangeAdaptor.cs
- BlobPersonalizationState.cs
- OrthographicCamera.cs
- NullExtension.cs
- DiscoveryClientDocuments.cs
- GridItemCollection.cs
- AsyncResult.cs
- SqlDataReader.cs
- UInt64Storage.cs
- Task.cs
- PropertyItem.cs
- TextEffect.cs
- DocumentScope.cs
- SessionIDManager.cs
- Clipboard.cs
- AdornedElementPlaceholder.cs
- ProfileModule.cs
- ImageListDesigner.cs
- OracleBFile.cs
- ListBox.cs
- Image.cs
- DelegatingMessage.cs
- FormsIdentity.cs
- SqlConnectionHelper.cs
- ChannelSinkStacks.cs
- PreviousTrackingServiceAttribute.cs
- PopupRoot.cs
- DtrList.cs
- SmtpClient.cs
- EncoderParameter.cs
- Rule.cs
- SerializationEventsCache.cs
- ProtocolViolationException.cs
- SafeHandles.cs
- SuppressMessageAttribute.cs
- EntityDataSourceWrapperCollection.cs
- BaseDataList.cs
- LambdaCompiler.Statements.cs
- XmlDeclaration.cs
- securitycriticaldataClass.cs
- OleDbException.cs
- CompoundFileStorageReference.cs
- GlyphRunDrawing.cs
- VirtualizingStackPanel.cs
- TableDesigner.cs
- NavigationPropertyEmitter.cs
- WebPartConnectionCollection.cs
- ToolboxItemCollection.cs
- CapabilitiesAssignment.cs
- AutomationElement.cs
- OutputScopeManager.cs
- ServiceDesigner.cs
- SerializationSectionGroup.cs
- XmlCDATASection.cs
- IconHelper.cs
- BmpBitmapEncoder.cs
- LogReserveAndAppendState.cs
- CommandLineParser.cs
- WorkflowEnvironment.cs
- TaskCanceledException.cs
- FileLoadException.cs
- GraphicsContext.cs
- ElapsedEventArgs.cs
- TypedTableBaseExtensions.cs
- XmlAttribute.cs
- TypeValidationEventArgs.cs
- QueueProcessor.cs
- ApplicationSettingsBase.cs
- DeclarationUpdate.cs
- TableRowGroup.cs
- ThreadStateException.cs
- PackagingUtilities.cs
- ObjectKeyFrameCollection.cs
- ContextMarshalException.cs
- TileBrush.cs
- UIElement3D.cs
- Animatable.cs
- GenericIdentity.cs
- XmlSchemaNotation.cs
- UnsafeNetInfoNativeMethods.cs
- CopyCodeAction.cs
- ApplicationDirectoryMembershipCondition.cs
- DefaultClaimSet.cs
- Style.cs
- TimeoutValidationAttribute.cs
- IntSecurity.cs
- SmtpCommands.cs
- SqlNotificationRequest.cs
- GeneralTransform.cs
- MemberCollection.cs
- EntityType.cs