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
- ScalarOps.cs
- ModelVisual3D.cs
- CodeCommentStatement.cs
- TextTreeRootTextBlock.cs
- DataPagerField.cs
- MailAddressCollection.cs
- OptimizedTemplateContent.cs
- WebPartConnectionsConfigureVerb.cs
- TogglePatternIdentifiers.cs
- StrokeFIndices.cs
- Control.cs
- Rect3DValueSerializer.cs
- DesignerAttributeInfo.cs
- PersonalizationDictionary.cs
- ConfigurationManagerInternal.cs
- ExponentialEase.cs
- QueryCacheEntry.cs
- ReadOnlyDictionary.cs
- XmlWrappingReader.cs
- DefaultBindingPropertyAttribute.cs
- Double.cs
- MetadataItem.cs
- HeaderedContentControl.cs
- CryptoApi.cs
- AddingNewEventArgs.cs
- ConfigurationLocation.cs
- DataGridViewComboBoxCell.cs
- HttpRuntimeSection.cs
- XmlNamespaceDeclarationsAttribute.cs
- xml.cs
- SimpleHandlerBuildProvider.cs
- FilteredXmlReader.cs
- ScriptRef.cs
- EventTrigger.cs
- DecoderReplacementFallback.cs
- MailWriter.cs
- TextFindEngine.cs
- PkcsUtils.cs
- PointUtil.cs
- NullableFloatMinMaxAggregationOperator.cs
- PropertyValueChangedEvent.cs
- OleDbError.cs
- SqlUdtInfo.cs
- SchemaElementDecl.cs
- NamespaceCollection.cs
- SafeRightsManagementPubHandle.cs
- SqlXmlStorage.cs
- Compiler.cs
- CodeIndexerExpression.cs
- SafeEventLogReadHandle.cs
- ZipIOLocalFileHeader.cs
- HTMLTagNameToTypeMapper.cs
- ClusterUtils.cs
- RotateTransform.cs
- FormCollection.cs
- DateTimeValueSerializer.cs
- PersistChildrenAttribute.cs
- XmlRootAttribute.cs
- EventLogPermissionEntryCollection.cs
- SignedPkcs7.cs
- Thread.cs
- InputLangChangeRequestEvent.cs
- GridViewRowPresenterBase.cs
- SystemNetHelpers.cs
- SecureStringHasher.cs
- WebPartZoneCollection.cs
- MailDefinitionBodyFileNameEditor.cs
- CroppedBitmap.cs
- ParallelSeparator.xaml.cs
- DocumentPage.cs
- CombinedHttpChannel.cs
- SerializationInfoEnumerator.cs
- CancellationTokenSource.cs
- GeometryCollection.cs
- CheckBox.cs
- ActiveDocumentEvent.cs
- BooleanToVisibilityConverter.cs
- RectangleF.cs
- RequestStatusBarUpdateEventArgs.cs
- AdvancedBindingPropertyDescriptor.cs
- CellParaClient.cs
- ProtocolsConfigurationEntry.cs
- ConfigurationValidatorAttribute.cs
- ObjectListShowCommandsEventArgs.cs
- VarInfo.cs
- SqlInternalConnection.cs
- ListViewUpdateEventArgs.cs
- sitestring.cs
- CryptographicAttribute.cs
- AmbientLight.cs
- GenericPrincipal.cs
- XmlIterators.cs
- XmlDataLoader.cs
- Parser.cs
- PreProcessor.cs
- DynamicContractTypeBuilder.cs
- SetMemberBinder.cs
- XmlDocumentSchema.cs
- CqlErrorHelper.cs
- PassportAuthentication.cs