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
- ConnectorDragDropGlyph.cs
- Hex.cs
- QilXmlReader.cs
- StringInfo.cs
- ScrollBar.cs
- LocatorBase.cs
- _Rfc2616CacheValidators.cs
- HostingEnvironment.cs
- MetadataSource.cs
- CodeDomComponentSerializationService.cs
- Exceptions.cs
- CommandPlan.cs
- DateBoldEvent.cs
- PrefixQName.cs
- SelectionRange.cs
- SpecialNameAttribute.cs
- FormViewCommandEventArgs.cs
- XmlSerializerNamespaces.cs
- DbConnectionStringCommon.cs
- BoundColumn.cs
- CqlParserHelpers.cs
- TextRange.cs
- BindingBase.cs
- ToolTipAutomationPeer.cs
- HebrewNumber.cs
- ReadOnlyHierarchicalDataSourceView.cs
- ReadOnlyDictionary.cs
- MsmqNonTransactedPoisonHandler.cs
- TypedDatasetGenerator.cs
- TraceLevelStore.cs
- MorphHelpers.cs
- LocatorManager.cs
- SBCSCodePageEncoding.cs
- QualifiedCellIdBoolean.cs
- SecurityHelper.cs
- UserControlBuildProvider.cs
- DropDownList.cs
- Padding.cs
- TransformedBitmap.cs
- SecurityTokenProvider.cs
- DataBoundControl.cs
- LineGeometry.cs
- RootBuilder.cs
- StandardToolWindows.cs
- FileEnumerator.cs
- MeshGeometry3D.cs
- HostedBindingBehavior.cs
- Operators.cs
- CustomTypeDescriptor.cs
- XmlSerializerVersionAttribute.cs
- DataGridViewBand.cs
- UpdatableGenericsFeature.cs
- PolicyVersionConverter.cs
- PackagePart.cs
- QilExpression.cs
- ListBox.cs
- EntitySqlQueryCacheKey.cs
- ParameterModifier.cs
- JsonFormatGeneratorStatics.cs
- FrameworkContentElement.cs
- MimeParameterWriter.cs
- CodeMethodReturnStatement.cs
- Enlistment.cs
- Block.cs
- ResumeStoryboard.cs
- LostFocusEventManager.cs
- PasswordDeriveBytes.cs
- XamlToRtfWriter.cs
- PartitionerStatic.cs
- ActiveXHelper.cs
- MessageDecoder.cs
- NetPeerTcpBindingCollectionElement.cs
- PortCache.cs
- DataConnectionHelper.cs
- WeakReference.cs
- AssemblyUtil.cs
- DataGridViewSortCompareEventArgs.cs
- CharKeyFrameCollection.cs
- KnownBoxes.cs
- RotateTransform.cs
- EntryIndex.cs
- VectorConverter.cs
- PasswordDeriveBytes.cs
- HuffCodec.cs
- OrderedDictionaryStateHelper.cs
- PersonalizationProvider.cs
- ZipIOZip64EndOfCentralDirectoryLocatorBlock.cs
- TransactionScopeDesigner.cs
- Compress.cs
- AddInProcess.cs
- BaseCodeDomTreeGenerator.cs
- FindCriteriaElement.cs
- NativeWindow.cs
- NativeWindow.cs
- MetadataSerializer.cs
- Int16AnimationUsingKeyFrames.cs
- ReplacementText.cs
- ValueType.cs
- CodePrimitiveExpression.cs
- TypeElement.cs