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
- ConfigurationSectionGroupCollection.cs
- Matrix3DValueSerializer.cs
- ModelVisual3D.cs
- SyndicationSerializer.cs
- DataGridToolTip.cs
- UnsafeNativeMethods.cs
- DataGridViewUtilities.cs
- PropertyGeneratedEventArgs.cs
- DescriptionAttribute.cs
- CodeGenerator.cs
- ObjectViewFactory.cs
- UriTemplatePathPartiallyEquivalentSet.cs
- SafePEFileHandle.cs
- Model3D.cs
- CFStream.cs
- PickBranchDesigner.xaml.cs
- SizeChangedEventArgs.cs
- TextEditor.cs
- TreeView.cs
- CodeTryCatchFinallyStatement.cs
- ProvidersHelper.cs
- AsyncOperationManager.cs
- WebPartConnectionsEventArgs.cs
- HttpContext.cs
- CodeRemoveEventStatement.cs
- TextProperties.cs
- WebPart.cs
- CodeIdentifier.cs
- LayoutTableCell.cs
- AmbiguousMatchException.cs
- DrawingContextWalker.cs
- HtmlDocument.cs
- ImageIndexConverter.cs
- figurelength.cs
- PageAsyncTaskManager.cs
- FigureParagraph.cs
- NativeMethods.cs
- LocationSectionRecord.cs
- TreeNode.cs
- Content.cs
- BitmapDownload.cs
- ToolBarButton.cs
- FocusWithinProperty.cs
- ResourceBinder.cs
- EventLogPropertySelector.cs
- OracleParameterBinding.cs
- OutputCacheSection.cs
- WebHttpElement.cs
- SecurityToken.cs
- XamlParser.cs
- LogicalTreeHelper.cs
- ListView.cs
- PagerSettings.cs
- CanonicalXml.cs
- SecurityElement.cs
- OptimalBreakSession.cs
- Rect3D.cs
- RotateTransform3D.cs
- TagPrefixInfo.cs
- webproxy.cs
- GridViewUpdateEventArgs.cs
- HtmlTitle.cs
- DataPager.cs
- XmlSchemaSequence.cs
- DayRenderEvent.cs
- Rect3D.cs
- QueueProcessor.cs
- TextTreeInsertUndoUnit.cs
- Control.cs
- EventManager.cs
- OpenTypeMethods.cs
- TrayIconDesigner.cs
- TypeNameConverter.cs
- SelectorAutomationPeer.cs
- Pool.cs
- DataShape.cs
- PointAnimationUsingKeyFrames.cs
- PlacementWorkspace.cs
- KeyMatchBuilder.cs
- UserMapPath.cs
- TypedTableBaseExtensions.cs
- XmlQueryTypeFactory.cs
- ImageInfo.cs
- MetafileHeader.cs
- HtmlInputFile.cs
- MsmqChannelFactory.cs
- PropertyEmitter.cs
- FilteredXmlReader.cs
- ImageCreator.cs
- XmlSchemaComplexType.cs
- WrappedReader.cs
- odbcmetadatacollectionnames.cs
- AssemblyUtil.cs
- XmlTextAttribute.cs
- HttpDebugHandler.cs
- ListMarkerSourceInfo.cs
- datacache.cs
- SqlStream.cs
- ReadOnlyActivityGlyph.cs
- ActiveXHelper.cs