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
- StandardCommands.cs
- KnownTypeAttribute.cs
- MultiByteCodec.cs
- UnionCodeGroup.cs
- RenderingEventArgs.cs
- TextFormatter.cs
- ConfigurationValues.cs
- InheritablePropertyChangeInfo.cs
- GridItemPattern.cs
- SlotInfo.cs
- AnonymousIdentificationModule.cs
- AnnotationComponentChooser.cs
- NativeMethods.cs
- ActivationServices.cs
- ToolboxItemFilterAttribute.cs
- IgnoreSectionHandler.cs
- dataobject.cs
- ProfileInfo.cs
- SecondaryIndex.cs
- CustomWebEventKey.cs
- Int64Converter.cs
- TableCell.cs
- SrgsSubset.cs
- BitmapEditor.cs
- SmtpReplyReaderFactory.cs
- DefaultSection.cs
- ProviderMetadata.cs
- ImageResources.Designer.cs
- OLEDB_Util.cs
- RegistryConfigurationProvider.cs
- PresentationTraceSources.cs
- BitmapEffectInput.cs
- StyleBamlRecordReader.cs
- ControlAdapter.cs
- BuilderInfo.cs
- SearchForVirtualItemEventArgs.cs
- SQLInt16Storage.cs
- UnmanagedMarshal.cs
- HtmlCommandAdapter.cs
- TypographyProperties.cs
- PixelFormats.cs
- KeyInstance.cs
- Base64Stream.cs
- ControlSerializer.cs
- ClientSettingsStore.cs
- Typeface.cs
- XAMLParseException.cs
- SystemWebSectionGroup.cs
- SectionUpdates.cs
- backend.cs
- DataSourceDesigner.cs
- ItemList.cs
- ACL.cs
- XmlSchemaSimpleContentExtension.cs
- ValueSerializer.cs
- TabControl.cs
- WinFormsComponentEditor.cs
- _ListenerRequestStream.cs
- ClrPerspective.cs
- AnonymousIdentificationModule.cs
- DictionaryEditChange.cs
- PersonalizationProviderHelper.cs
- CacheManager.cs
- GridViewPageEventArgs.cs
- MimePart.cs
- OperandQuery.cs
- BitmapFrame.cs
- FloaterParagraph.cs
- DataSourceView.cs
- TableLayoutSettingsTypeConverter.cs
- MatrixValueSerializer.cs
- SocketAddress.cs
- RoutedUICommand.cs
- TaskFormBase.cs
- ApplyTemplatesAction.cs
- ToolStripOverflowButton.cs
- HttpCachePolicyElement.cs
- ProbeMatchesMessage11.cs
- MailAddress.cs
- Comparer.cs
- TypeHelpers.cs
- PackagePartCollection.cs
- ConnectionInterfaceCollection.cs
- Helper.cs
- Lookup.cs
- RoutedEvent.cs
- WindowsNonControl.cs
- RSAOAEPKeyExchangeFormatter.cs
- SafeArrayRankMismatchException.cs
- BitVec.cs
- DoubleAnimationClockResource.cs
- UrlPath.cs
- BitmapPalette.cs
- PersonalizationStateInfo.cs
- RouteData.cs
- PointLightBase.cs
- SmiContextFactory.cs
- ellipse.cs
- ToolboxItemCollection.cs
- BufferAllocator.cs