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
- SessionEndingCancelEventArgs.cs
- MobileDeviceCapabilitiesSectionHandler.cs
- CultureNotFoundException.cs
- WsiProfilesElement.cs
- XmlWriterSettings.cs
- XmlSchemaComplexContentRestriction.cs
- SiteMapProvider.cs
- RepeatButtonAutomationPeer.cs
- SplitterEvent.cs
- TextBlock.cs
- BatchParser.cs
- CellTreeNodeVisitors.cs
- Version.cs
- Screen.cs
- ManifestResourceInfo.cs
- ModelMemberCollection.cs
- WebEncodingValidator.cs
- XmlSchemaCompilationSettings.cs
- TailCallAnalyzer.cs
- _FixedSizeReader.cs
- Screen.cs
- EventWaitHandleSecurity.cs
- MetafileEditor.cs
- BridgeDataRecord.cs
- WebServiceEndpoint.cs
- WmfPlaceableFileHeader.cs
- SQLChars.cs
- SpecialFolderEnumConverter.cs
- XmlExpressionDumper.cs
- StringFunctions.cs
- CapabilitiesPattern.cs
- WebPartTransformerCollection.cs
- HotSpotCollectionEditor.cs
- ThemeDictionaryExtension.cs
- RegexCharClass.cs
- Int32.cs
- NativeRecognizer.cs
- MouseButtonEventArgs.cs
- SwitchLevelAttribute.cs
- MultiPropertyDescriptorGridEntry.cs
- PublisherIdentityPermission.cs
- PolyQuadraticBezierSegment.cs
- DesignerWebPartChrome.cs
- ComboBoxItem.cs
- ExtensionQuery.cs
- HtmlForm.cs
- InvokerUtil.cs
- JsonQueryStringConverter.cs
- BamlMapTable.cs
- Parameter.cs
- XmlProcessingInstruction.cs
- AstTree.cs
- ScriptControlManager.cs
- ToolStripContentPanel.cs
- WorkflowDesignerMessageFilter.cs
- QilInvokeEarlyBound.cs
- CodeDirectoryCompiler.cs
- SplineKeyFrames.cs
- Helper.cs
- AggregateNode.cs
- Point.cs
- OwnerDrawPropertyBag.cs
- TaskFormBase.cs
- HierarchicalDataBoundControlAdapter.cs
- PropertyToken.cs
- oledbmetadatacollectionnames.cs
- PropertyContainer.cs
- MimeFormImporter.cs
- CachedBitmap.cs
- EntityContainer.cs
- Guid.cs
- URLString.cs
- EntityCommandCompilationException.cs
- TextBoxBase.cs
- IntMinMaxAggregationOperator.cs
- ComponentDispatcher.cs
- GenerateScriptTypeAttribute.cs
- DesignerActionList.cs
- MenuItem.cs
- GridViewUpdatedEventArgs.cs
- TextTreePropertyUndoUnit.cs
- PropertyGeneratedEventArgs.cs
- _CommandStream.cs
- Mapping.cs
- SecurityKeyIdentifier.cs
- EntityDataSourceMemberPath.cs
- SoapAttributeOverrides.cs
- WmlCommandAdapter.cs
- ScriptResourceMapping.cs
- Domain.cs
- DropSource.cs
- AutoGeneratedField.cs
- ReflectEventDescriptor.cs
- DirectoryObjectSecurity.cs
- CustomCategoryAttribute.cs
- SqlDataSourceConnectionPanel.cs
- StackOverflowException.cs
- MulticastOption.cs
- DateTimeConverter2.cs
- TextBoxBase.cs