Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / Services / Messaging / System / Messaging / Design / QueuePathEditor.cs / 1305376 / QueuePathEditor.cs
//------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //----------------------------------------------------------------------------- namespace System.Messaging.Design { using System; using System.Drawing; using System.Drawing.Design; using System.Windows.Forms; using System.Windows.Forms.ComponentModel; using System.Windows.Forms.Design; using System.ComponentModel; using System.ComponentModel.Design; using System.Messaging; ////// /// // permissions demanded by parent class [System.Security.Permissions.PermissionSetAttribute(System.Security.Permissions.SecurityAction.LinkDemand, Name="FullTrust")] [System.Security.Permissions.PermissionSetAttribute(System.Security.Permissions.SecurityAction.InheritanceDemand, Name="FullTrust")] public class QueuePathEditor : UITypeEditor { ///[To be supplied.] ////// /// Edits the given object value using the editor style provided by /// GetEditorStyle. A service provider is provided so that any /// required editing services can be obtained. /// public override object EditValue(ITypeDescriptorContext context, IServiceProvider provider, object value) { if (provider != null) { IWindowsFormsEditorService edSvc = (IWindowsFormsEditorService)provider.GetService(typeof(IWindowsFormsEditorService)); if (edSvc != null) { QueuePathDialog dialog = new QueuePathDialog(provider); MessageQueue queue = null; if (value is MessageQueue) queue = (MessageQueue)value; else if (value is string) queue = new MessageQueue((string)value); else if (value != null) return value; if (queue != null) dialog.SelectQueue(queue); IDesignerHost host = (IDesignerHost)provider.GetService(typeof(IDesignerHost)); DesignerTransaction trans = null; if (host != null) trans = host.CreateTransaction(); try { if ((context == null || context.OnComponentChanging()) && edSvc.ShowDialog(dialog) == DialogResult.OK) { if (dialog.Path != String.Empty) { if (context.Instance is MessageQueue || context.Instance is MessageQueueInstaller) value = dialog.Path; else { value = MessageQueueConverter.GetFromCache(dialog.Path); if (value == null) { value = new MessageQueue(dialog.Path); MessageQueueConverter.AddToCache((MessageQueue)value); if (context != null) context.Container.Add((IComponent)value); } } context.OnComponentChanged(); } } } finally { if (trans != null) { trans.Commit(); } } } } return value; } ////// /// Retrieves the editing style of the Edit method. If the method /// is not supported, this will return None. /// public override UITypeEditorEditStyle GetEditStyle(ITypeDescriptorContext context) { return UITypeEditorEditStyle.Modal; } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007.
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- CreateParams.cs
- HMACSHA512.cs
- Mouse.cs
- OperationCanceledException.cs
- Subset.cs
- NetworkStream.cs
- Activator.cs
- Path.cs
- ResourcesBuildProvider.cs
- LockingPersistenceProvider.cs
- WindowsRebar.cs
- CodeMemberField.cs
- ConsoleKeyInfo.cs
- PropertyNames.cs
- UnauthorizedAccessException.cs
- CustomDictionarySources.cs
- ServerValidateEventArgs.cs
- httpapplicationstate.cs
- LogicalExpressionEditor.cs
- ServiceModelStringsVersion1.cs
- AutomationPatternInfo.cs
- MatrixAnimationUsingKeyFrames.cs
- Utils.cs
- WSDualHttpBindingElement.cs
- MembershipValidatePasswordEventArgs.cs
- TreeNodeCollection.cs
- MetabaseServerConfig.cs
- CommonDialog.cs
- KeyFrames.cs
- ParseChildrenAsPropertiesAttribute.cs
- TimeZone.cs
- StaticSiteMapProvider.cs
- NullReferenceException.cs
- ZipIOCentralDirectoryFileHeader.cs
- XPathParser.cs
- DrawingBrush.cs
- ParsedAttributeCollection.cs
- GridEntryCollection.cs
- ObjectHelper.cs
- PriorityChain.cs
- FixedLineResult.cs
- BevelBitmapEffect.cs
- DesignRelation.cs
- RunWorkerCompletedEventArgs.cs
- EdgeProfileValidation.cs
- Brush.cs
- MouseDevice.cs
- WebPartHelpVerb.cs
- NumberFunctions.cs
- WindowsProgressbar.cs
- XXXOnTypeBuilderInstantiation.cs
- StylusButton.cs
- PageStatePersister.cs
- TripleDESCryptoServiceProvider.cs
- RadioButtonList.cs
- InstalledFontCollection.cs
- RemotingConfigParser.cs
- MetadataArtifactLoaderCompositeFile.cs
- CodeAttachEventStatement.cs
- KeyToListMap.cs
- FontFaceLayoutInfo.cs
- _ListenerAsyncResult.cs
- ParameterElement.cs
- SettingsAttributes.cs
- ClrPerspective.cs
- String.cs
- ReferencedAssembly.cs
- IntSecurity.cs
- ControlCachePolicy.cs
- DataContractSerializerSection.cs
- ProfilePropertyMetadata.cs
- BindableTemplateBuilder.cs
- VectorAnimationBase.cs
- thaishape.cs
- Transform3D.cs
- EncoderExceptionFallback.cs
- SpecialNameAttribute.cs
- RadioButtonFlatAdapter.cs
- PackageDigitalSignatureManager.cs
- SiteMapSection.cs
- DeflateEmulationStream.cs
- VirtualizedCellInfoCollection.cs
- HttpDictionary.cs
- TouchFrameEventArgs.cs
- SizeChangedEventArgs.cs
- Substitution.cs
- ResponseStream.cs
- NegotiateStream.cs
- PersonalizationStateInfo.cs
- XmlIlGenerator.cs
- DbSourceCommand.cs
- DictionarySurrogate.cs
- PrintPageEvent.cs
- KeyConstraint.cs
- JapaneseCalendar.cs
- XamlSerializationHelper.cs
- CompilationUnit.cs
- UnknownBitmapEncoder.cs
- LoginName.cs
- SecurityCriticalDataForSet.cs