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
- SetStoryboardSpeedRatio.cs
- TextRange.cs
- XmlHierarchicalDataSourceView.cs
- AsyncOperation.cs
- NameTable.cs
- InfoCardConstants.cs
- XpsFont.cs
- TemplateControlBuildProvider.cs
- TypeLoadException.cs
- controlskin.cs
- UrlMappingsSection.cs
- InvokeMemberBinder.cs
- SoapObjectWriter.cs
- TypedReference.cs
- DBConnection.cs
- ListViewHitTestInfo.cs
- TypeKeyValue.cs
- WebPartTransformerCollection.cs
- ZeroOpNode.cs
- GridViewColumnCollectionChangedEventArgs.cs
- DetailsViewCommandEventArgs.cs
- SqlDataReader.cs
- Literal.cs
- RegexBoyerMoore.cs
- ResourcePermissionBaseEntry.cs
- DurableErrorHandler.cs
- EntryWrittenEventArgs.cs
- BufferedConnection.cs
- FlowDocumentReader.cs
- GridSplitter.cs
- CryptoStream.cs
- WebPartVerbsEventArgs.cs
- ItemDragEvent.cs
- BezierSegment.cs
- HttpContextBase.cs
- MLangCodePageEncoding.cs
- ResourcesChangeInfo.cs
- TdsParserStaticMethods.cs
- invalidudtexception.cs
- AdRotatorDesigner.cs
- DefaultShape.cs
- ObjectQuery.cs
- GroupByExpressionRewriter.cs
- BitmapEffectInput.cs
- SecurityHelper.cs
- SectionInformation.cs
- WebPartConnectVerb.cs
- MediaElementAutomationPeer.cs
- Normalizer.cs
- ByteAnimationUsingKeyFrames.cs
- DataGridColumnCollection.cs
- JsonWriter.cs
- LabelDesigner.cs
- _BufferOffsetSize.cs
- LongPath.cs
- RadialGradientBrush.cs
- InstanceHandleReference.cs
- SQLDecimalStorage.cs
- FrameworkElementFactoryMarkupObject.cs
- CodeTypeReferenceExpression.cs
- EmptyTextWriter.cs
- TableParagraph.cs
- ExpressionContext.cs
- SimpleType.cs
- ToolStripDropTargetManager.cs
- Int16.cs
- Geometry3D.cs
- SamlSecurityTokenAuthenticator.cs
- StyleSelector.cs
- PasswordTextContainer.cs
- bindurihelper.cs
- CollectionChangeEventArgs.cs
- ByteConverter.cs
- HandoffBehavior.cs
- X509Certificate2.cs
- AttachInfo.cs
- FilterElement.cs
- JobCollate.cs
- EventEntry.cs
- PropertyGridEditorPart.cs
- HyperLink.cs
- ColorTransformHelper.cs
- XmlQualifiedName.cs
- SafeCryptContextHandle.cs
- BindingOperations.cs
- LineSegment.cs
- ParallelForEach.cs
- VectorKeyFrameCollection.cs
- ValidationRuleCollection.cs
- CollectionEditorDialog.cs
- ToolStripDropDown.cs
- DelegatedStream.cs
- OdbcConnectionFactory.cs
- TemplateParser.cs
- Optimizer.cs
- FullTextState.cs
- PenLineCapValidation.cs
- MetaModel.cs
- XmlSchema.cs
- CrossAppDomainChannel.cs