Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / cdf / src / NetFx40 / Tools / System.Activities.Presentation / System / Activities / Presentation / ShowExpandedMultiValueConverter.cs / 1305376 / ShowExpandedMultiValueConverter.cs
//---------------------------------------------------------------- // Copyright (c) Microsoft Corporation. All rights reserved. //--------------------------------------------------------------- namespace System.Activities.Presentation { using System.Diagnostics; using System.Diagnostics.CodeAnalysis; using System.Globalization; using System.Windows.Data; using System.Activities.Presentation.Model; using System.Activities.Presentation.Internal.PropertyEditing.Model; using System.Windows; using System.Activities.Presentation.View; using System.Runtime; [SuppressMessage(FxCop.Category.Naming, FxCop.Rule.IdentifiersShouldBeSpelledCorrectly, Justification = "Following the naming of IMultiValueConverter")] internal sealed class ShowExpandedMultiValueConverter : IMultiValueConverter { //Calculates whether ShowExpanded for a given WorklfowViewElement should be true or false. public object Convert(object[] values, Type targetType, object parameter, CultureInfo culture) { ModelItem modelItem = (ModelItem)values[0]; bool isRootDesigner = (bool)values[1]; bool shouldExpandAll = (bool)values[2]; bool shouldCollapseAll = (bool)values[3]; bool expandState = (bool)values[4]; bool pinState = (bool)values[5]; WorkflowViewElement viewElement = (WorkflowViewElement)values[6]; //Pinstate should be false in following cases (Designer should be unpinned in following cases): //1. ExpandAll is not enabled. //2. ExpandAll is enabled and ExpandState is true. //Similarly for Collapse All. if ((!shouldExpandAll || expandState) && (!shouldCollapseAll || !expandState) ) { viewElement.PinState = false; } if (viewElement.IsAncestorOfRootDesigner) { return true; } return ViewUtilities.ShouldShowExpanded(isRootDesigner, viewElement.DoesParentAlwaysExpandChild(), viewElement.DoesParentAlwaysCollapseChildren(), expandState, shouldExpandAll, shouldCollapseAll, viewElement.PinState); } public object[] ConvertBack(object value, Type[] targetTypes, object parameter, CultureInfo culture) { throw FxTrace.Exception.AsError(new NotSupportedException()); } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. //---------------------------------------------------------------- // Copyright (c) Microsoft Corporation. All rights reserved. //--------------------------------------------------------------- namespace System.Activities.Presentation { using System.Diagnostics; using System.Diagnostics.CodeAnalysis; using System.Globalization; using System.Windows.Data; using System.Activities.Presentation.Model; using System.Activities.Presentation.Internal.PropertyEditing.Model; using System.Windows; using System.Activities.Presentation.View; using System.Runtime; [SuppressMessage(FxCop.Category.Naming, FxCop.Rule.IdentifiersShouldBeSpelledCorrectly, Justification = "Following the naming of IMultiValueConverter")] internal sealed class ShowExpandedMultiValueConverter : IMultiValueConverter { //Calculates whether ShowExpanded for a given WorklfowViewElement should be true or false. public object Convert(object[] values, Type targetType, object parameter, CultureInfo culture) { ModelItem modelItem = (ModelItem)values[0]; bool isRootDesigner = (bool)values[1]; bool shouldExpandAll = (bool)values[2]; bool shouldCollapseAll = (bool)values[3]; bool expandState = (bool)values[4]; bool pinState = (bool)values[5]; WorkflowViewElement viewElement = (WorkflowViewElement)values[6]; //Pinstate should be false in following cases (Designer should be unpinned in following cases): //1. ExpandAll is not enabled. //2. ExpandAll is enabled and ExpandState is true. //Similarly for Collapse All. if ((!shouldExpandAll || expandState) && (!shouldCollapseAll || !expandState) ) { viewElement.PinState = false; } if (viewElement.IsAncestorOfRootDesigner) { return true; } return ViewUtilities.ShouldShowExpanded(isRootDesigner, viewElement.DoesParentAlwaysExpandChild(), viewElement.DoesParentAlwaysCollapseChildren(), expandState, shouldExpandAll, shouldCollapseAll, viewElement.PinState); } public object[] ConvertBack(object value, Type[] targetTypes, object parameter, CultureInfo culture) { throw FxTrace.Exception.AsError(new NotSupportedException()); } } } // 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
- BypassElementCollection.cs
- CharEntityEncoderFallback.cs
- CustomExpressionEventArgs.cs
- CreateUserWizardStep.cs
- StructuredTypeEmitter.cs
- CapabilitiesSection.cs
- PeerServiceMessageContracts.cs
- WebHttpBindingCollectionElement.cs
- SerTrace.cs
- DataGridViewCell.cs
- OrthographicCamera.cs
- ToolStripButton.cs
- WindowsGraphics.cs
- ToolBarButton.cs
- GraphicsPathIterator.cs
- MulticastDelegate.cs
- EntityUtil.cs
- OracleConnectionString.cs
- XsdBuildProvider.cs
- WebReferencesBuildProvider.cs
- cookie.cs
- RijndaelCryptoServiceProvider.cs
- XmlCountingReader.cs
- OdbcFactory.cs
- FragmentQueryProcessor.cs
- DetailsView.cs
- ConnectionsZone.cs
- MouseButton.cs
- StateManager.cs
- StoreItemCollection.Loader.cs
- EntityDataSourceWrapperCollection.cs
- OptimalBreakSession.cs
- HitTestResult.cs
- ISCIIEncoding.cs
- ReferencedCollectionType.cs
- PropertyReferenceSerializer.cs
- RelatedEnd.cs
- MethodImplAttribute.cs
- LoginName.cs
- TTSEngineTypes.cs
- COM2ExtendedTypeConverter.cs
- WebBrowser.cs
- NamespaceListProperty.cs
- ProcessThreadCollection.cs
- ListBox.cs
- HttpHandlerAction.cs
- ToolboxBitmapAttribute.cs
- DataRecordObjectView.cs
- CodeAttachEventStatement.cs
- WebEventCodes.cs
- SqlFormatter.cs
- SqlTrackingQuery.cs
- CheckBoxField.cs
- UpdateManifestForBrowserApplication.cs
- TransportationConfigurationTypeInstallComponent.cs
- MultiBinding.cs
- ADMembershipProvider.cs
- __Error.cs
- GroupBox.cs
- AnnotationObservableCollection.cs
- DataListItemCollection.cs
- AnnotationResourceChangedEventArgs.cs
- StyleCollection.cs
- _TimerThread.cs
- ParagraphVisual.cs
- _OSSOCK.cs
- RowUpdatedEventArgs.cs
- MSHTMLHost.cs
- BindingExpressionUncommonField.cs
- ConnectionManagementElement.cs
- DetailsViewPagerRow.cs
- Region.cs
- StateMachine.cs
- JavaScriptObjectDeserializer.cs
- messageonlyhwndwrapper.cs
- DockingAttribute.cs
- RangeValidator.cs
- Serializer.cs
- SiteOfOriginContainer.cs
- WebResourceUtil.cs
- EventHandlingScope.cs
- ToolStripPanelRenderEventArgs.cs
- SQlBooleanStorage.cs
- MethodRental.cs
- BinaryFormatter.cs
- ContentElement.cs
- GroupBox.cs
- XpsColorContext.cs
- DataControlCommands.cs
- EmptyCollection.cs
- EnumConverter.cs
- ParserOptions.cs
- QueryStringConverter.cs
- WebPartPersonalization.cs
- ObjectSpanRewriter.cs
- MinimizableAttributeTypeConverter.cs
- SoapAttributes.cs
- CodeTypeDelegate.cs
- PointCollection.cs
- ClientConfigurationHost.cs