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
- Timer.cs
- WebScriptEndpointElement.cs
- XmlSchemaSimpleTypeUnion.cs
- ClientSettingsSection.cs
- TrackingMemoryStream.cs
- FileBasedResourceGroveler.cs
- DrawingState.cs
- DPTypeDescriptorContext.cs
- TextElement.cs
- WindowInteractionStateTracker.cs
- HttpProfileGroupBase.cs
- FileDialogPermission.cs
- AutomationProperties.cs
- ServiceDesigner.cs
- HttpRequest.cs
- StubHelpers.cs
- XPathNavigatorReader.cs
- ScriptingJsonSerializationSection.cs
- MarginCollapsingState.cs
- QilSortKey.cs
- BufferedGraphics.cs
- InternalBufferOverflowException.cs
- login.cs
- NetNamedPipeBindingCollectionElement.cs
- XmlDigitalSignatureProcessor.cs
- InspectionWorker.cs
- RootBrowserWindow.cs
- RawStylusInput.cs
- DataObjectMethodAttribute.cs
- StrongNamePublicKeyBlob.cs
- RC2.cs
- MarkupExtensionReturnTypeAttribute.cs
- WindowsMenu.cs
- LinkLabelLinkClickedEvent.cs
- CornerRadiusConverter.cs
- IndexedString.cs
- OutputWindow.cs
- TypeContext.cs
- HwndMouseInputProvider.cs
- XNameConverter.cs
- SelectedDatesCollection.cs
- SqlBinder.cs
- ReadOnlyTernaryTree.cs
- OleDragDropHandler.cs
- InputLangChangeRequestEvent.cs
- StylusTip.cs
- BitmapEffectInput.cs
- PeerToPeerException.cs
- DynamicUpdateCommand.cs
- CssTextWriter.cs
- IPEndPointCollection.cs
- DBConcurrencyException.cs
- CheckedListBox.cs
- BooleanAnimationBase.cs
- ReaderWriterLock.cs
- MarkupExtensionParser.cs
- DBConnectionString.cs
- SplitterPanelDesigner.cs
- PrinterSettings.cs
- TextDecorationCollectionConverter.cs
- ScriptingWebServicesSectionGroup.cs
- EmptyEnumerator.cs
- UpDownBaseDesigner.cs
- IdentityHolder.cs
- FlagsAttribute.cs
- FrameworkContentElement.cs
- AsymmetricSignatureFormatter.cs
- QilUnary.cs
- FormsAuthenticationUser.cs
- control.ime.cs
- AttributeProviderAttribute.cs
- LogicalExpr.cs
- RandomDelayQueuedSendsAsyncResult.cs
- Simplifier.cs
- EditorPartDesigner.cs
- TextDecorations.cs
- MulticastIPAddressInformationCollection.cs
- CssClassPropertyAttribute.cs
- NamespaceDisplay.xaml.cs
- Profiler.cs
- NetworkInformationPermission.cs
- ModuleBuilderData.cs
- WebColorConverter.cs
- NativeMethods.cs
- MethodExecutor.cs
- SqlCacheDependency.cs
- Oid.cs
- ContextInformation.cs
- XmlDataCollection.cs
- PropertyToken.cs
- EntityDesignerDataSourceView.cs
- PageRouteHandler.cs
- RandomNumberGenerator.cs
- ProtectedConfigurationSection.cs
- AttachInfo.cs
- FileLogRecordStream.cs
- VarRefManager.cs
- HandlerFactoryCache.cs
- GridLengthConverter.cs
- PartialToken.cs