Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / cdf / src / NetFx40 / Tools / System.Activities.Presentation / System / Activities / Presentation / WorkflowElementDialogWindow.xaml.cs / 1407647 / WorkflowElementDialogWindow.xaml.cs
//----------------------------------------------------------------
// Copyright (c) Microsoft Corporation. All rights reserved.
//---------------------------------------------------------------
namespace System.Activities.Presentation
{
using System.Runtime;
using System.Windows;
using System.Diagnostics.CodeAnalysis;
using System.Runtime.InteropServices;
using System.Activities.Presentation.View;
using System.Windows.Interop;
using System.Windows.Input;
using System.ComponentModel;
[Fx.Tag.XamlVisible(false)]
internal partial class WorkflowElementDialogWindow
{
WorkflowElementDialog payload;
bool okCancel;
//default MinButton and MaxButton to true
private bool enableMinButton = true;
private bool enableMaxButton = true;
private Func onOk;
public WorkflowElementDialogWindow(WorkflowElementDialog payload, bool okCancel, bool enableMinButton, bool enableMaxButton, Func onOk)
{
this.payload = payload;
this.okCancel = okCancel;
this.enableMinButton = enableMinButton;
this.enableMaxButton = enableMaxButton;
this.onOk = onOk;
InitializeComponent();
}
protected override void OnInitialized(EventArgs e)
{
base.OnInitialized(e);
this.payload.Window = this;
this.payloadHolder.Child = this.payload;
this.MinWidth = this.payload.MinWidth;
this.MinHeight = this.payload.MinHeight;
this.MaxWidth = this.payload.MaxWidth;
this.MaxHeight = this.payload.MaxHeight;
this.ResizeMode = this.payload.WindowResizeMode;
this.SizeToContent = this.payload.WindowSizeToContent;
this.Context = payload.Context;
if (payload.HelpKeyword != null)
{
this.HelpKeyword = payload.HelpKeyword;
}
if (0.0 != this.payload.MinWidth)
{
this.Width = this.payload.MinWidth;
}
if (0.0 != this.payload.MinHeight)
{
this.Height = this.payload.MinHeight;
}
this.payload.MinWidth = this.payload.MinHeight = 0.0;
this.payload.MaxWidth = this.payload.MaxWidth = double.PositiveInfinity;
if (!this.okCancel)
{
this.buttonPanel.Children.Remove(this.cancelButton);
}
}
void OK_Click(object sender, RoutedEventArgs e)
{
if (this.onOk == null || this.onOk())
{
this.DialogResult = true;
}
}
[SuppressMessage(FxCop.Category.Performance, FxCop.Rule.AvoidUncalledPrivateCode,
Justification = "This function is called in the xaml file")]
void OnWindowClosed(object sender, EventArgs e)
{
this.payload.Window = null;
this.payloadHolder.Child = null;
}
}
}
// File provided for Reference Use Only by Microsoft Corporation (c) 2007.
//----------------------------------------------------------------
// Copyright (c) Microsoft Corporation. All rights reserved.
//---------------------------------------------------------------
namespace System.Activities.Presentation
{
using System.Runtime;
using System.Windows;
using System.Diagnostics.CodeAnalysis;
using System.Runtime.InteropServices;
using System.Activities.Presentation.View;
using System.Windows.Interop;
using System.Windows.Input;
using System.ComponentModel;
[Fx.Tag.XamlVisible(false)]
internal partial class WorkflowElementDialogWindow
{
WorkflowElementDialog payload;
bool okCancel;
//default MinButton and MaxButton to true
private bool enableMinButton = true;
private bool enableMaxButton = true;
private Func onOk;
public WorkflowElementDialogWindow(WorkflowElementDialog payload, bool okCancel, bool enableMinButton, bool enableMaxButton, Func onOk)
{
this.payload = payload;
this.okCancel = okCancel;
this.enableMinButton = enableMinButton;
this.enableMaxButton = enableMaxButton;
this.onOk = onOk;
InitializeComponent();
}
protected override void OnInitialized(EventArgs e)
{
base.OnInitialized(e);
this.payload.Window = this;
this.payloadHolder.Child = this.payload;
this.MinWidth = this.payload.MinWidth;
this.MinHeight = this.payload.MinHeight;
this.MaxWidth = this.payload.MaxWidth;
this.MaxHeight = this.payload.MaxHeight;
this.ResizeMode = this.payload.WindowResizeMode;
this.SizeToContent = this.payload.WindowSizeToContent;
this.Context = payload.Context;
if (payload.HelpKeyword != null)
{
this.HelpKeyword = payload.HelpKeyword;
}
if (0.0 != this.payload.MinWidth)
{
this.Width = this.payload.MinWidth;
}
if (0.0 != this.payload.MinHeight)
{
this.Height = this.payload.MinHeight;
}
this.payload.MinWidth = this.payload.MinHeight = 0.0;
this.payload.MaxWidth = this.payload.MaxWidth = double.PositiveInfinity;
if (!this.okCancel)
{
this.buttonPanel.Children.Remove(this.cancelButton);
}
}
void OK_Click(object sender, RoutedEventArgs e)
{
if (this.onOk == null || this.onOk())
{
this.DialogResult = true;
}
}
[SuppressMessage(FxCop.Category.Performance, FxCop.Rule.AvoidUncalledPrivateCode,
Justification = "This function is called in the xaml file")]
void OnWindowClosed(object sender, EventArgs e)
{
this.payload.Window = null;
this.payloadHolder.Child = null;
}
}
}
// 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
- CryptoProvider.cs
- ContentValidator.cs
- CapabilitiesSection.cs
- IProvider.cs
- ConfigXmlWhitespace.cs
- DataGridViewColumnConverter.cs
- KnowledgeBase.cs
- DBCommandBuilder.cs
- ExtensionDataReader.cs
- PrtTicket_Editor.cs
- DbExpressionRules.cs
- TableLayoutStyle.cs
- ConfigXmlElement.cs
- DataGridViewRowEventArgs.cs
- StylusPointPropertyInfoDefaults.cs
- DummyDataSource.cs
- ProxyGenerationError.cs
- Triangle.cs
- xmlsaver.cs
- RemoteWebConfigurationHostServer.cs
- CfgArc.cs
- BaseTemplateCodeDomTreeGenerator.cs
- NumberFunctions.cs
- WebPartVerbCollection.cs
- ApplicationFileParser.cs
- IssuerInformation.cs
- RequestCacheManager.cs
- Attributes.cs
- SafeLocalMemHandle.cs
- AudioBase.cs
- LineServicesRun.cs
- SmtpMail.cs
- ConnectivityStatus.cs
- UrlMappingCollection.cs
- MarshalByRefObject.cs
- IPAddress.cs
- NamedPipeTransportManager.cs
- TextViewSelectionProcessor.cs
- FilePresentation.cs
- NetworkInformationPermission.cs
- GeneralTransform3DTo2DTo3D.cs
- RowTypeElement.cs
- MonitoringDescriptionAttribute.cs
- DictionaryEntry.cs
- RegexCompiler.cs
- TypeUsageBuilder.cs
- _TLSstream.cs
- MatrixConverter.cs
- DaylightTime.cs
- FunctionDetailsReader.cs
- ProcessHostMapPath.cs
- CodeSpit.cs
- StrongTypingException.cs
- ExpressionBuilder.cs
- Substitution.cs
- X509ClientCertificateCredentialsElement.cs
- CheckBoxRenderer.cs
- CustomWebEventKey.cs
- Converter.cs
- Socket.cs
- Assembly.cs
- StateMachineWorkflowInstance.cs
- ObjectStateManagerMetadata.cs
- DetailsViewDesigner.cs
- FileNotFoundException.cs
- AstNode.cs
- ObjectTag.cs
- UICuesEvent.cs
- RequestStatusBarUpdateEventArgs.cs
- DnsEndPoint.cs
- dtdvalidator.cs
- Crc32.cs
- TypedTableBase.cs
- LocalBuilder.cs
- XmlStringTable.cs
- RectAnimation.cs
- BitmapPalettes.cs
- PartitionerQueryOperator.cs
- ReversePositionQuery.cs
- CrossSiteScriptingValidation.cs
- DependencyObjectPropertyDescriptor.cs
- URLString.cs
- MediaPlayerState.cs
- TripleDESCryptoServiceProvider.cs
- ThreadStartException.cs
- Freezable.cs
- LinkedResource.cs
- ToolboxComponentsCreatedEventArgs.cs
- SystemResourceKey.cs
- CanExpandCollapseAllConverter.cs
- PopupRoot.cs
- SecurityTokenSpecification.cs
- SolidColorBrush.cs
- Int64.cs
- XmlQueryRuntime.cs
- GlyphCollection.cs
- TypeDelegator.cs
- RtfFormatStack.cs
- CancelRequestedRecord.cs
- HierarchicalDataBoundControl.cs