You've already forked linux-packaging-mono
Imported Upstream version 4.6.0.125
Former-commit-id: a2155e9bd80020e49e72e86c44da02a8ac0e57a4
This commit is contained in:
parent
a569aebcfd
commit
e79aa3c0ed
@@ -0,0 +1 @@
|
||||
febb8669aa2a93ee6107a06d46ce5338fd8406cb
|
@@ -0,0 +1,226 @@
|
||||
#pragma warning disable 1634, 1691
|
||||
namespace System.Workflow.ComponentModel.Design
|
||||
{
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Drawing;
|
||||
using System.CodeDom;
|
||||
using System.Diagnostics;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Windows.Forms;
|
||||
using System.ComponentModel;
|
||||
using System.Globalization;
|
||||
using System.Drawing.Design;
|
||||
using System.Drawing.Imaging;
|
||||
using System.Drawing.Drawing2D;
|
||||
using System.Windows.Forms.Design;
|
||||
using System.ComponentModel.Design;
|
||||
using System.Collections.Specialized;
|
||||
using System.ComponentModel.Design.Serialization;
|
||||
using System.Workflow.ComponentModel.Compiler;
|
||||
using System.Workflow.ComponentModel.Serialization;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.Reflection;
|
||||
using System.Workflow.ComponentModel.Design;
|
||||
using System.Runtime.Serialization.Formatters.Binary;
|
||||
|
||||
//
|
||||
|
||||
#region Class ActivityDesignerAccessibleObject
|
||||
/// <summary>
|
||||
/// Accessibility object class for the ActivityDesigner
|
||||
/// </summary>
|
||||
[Obsolete("The System.Workflow.* types are deprecated. Instead, please use the new types from System.Activities.*")]
|
||||
public class ActivityDesignerAccessibleObject : AccessibleObject
|
||||
{
|
||||
private ActivityDesigner activityDesigner;
|
||||
|
||||
/// <summary>
|
||||
/// Constructs the accessibility class for ActivityDesigner
|
||||
/// </summary>
|
||||
/// <param name="activityDesigner">ActivityDesigner associated with accessiblity object</param>
|
||||
public ActivityDesignerAccessibleObject(ActivityDesigner activityDesigner)
|
||||
{
|
||||
if (activityDesigner == null)
|
||||
throw new ArgumentNullException("activityDesigner");
|
||||
if (activityDesigner.Activity == null)
|
||||
throw new ArgumentException(DR.GetString(DR.DesignerNotInitialized), "activityDesigner");
|
||||
|
||||
this.activityDesigner = activityDesigner;
|
||||
}
|
||||
|
||||
public override Rectangle Bounds
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.activityDesigner.InternalRectangleToScreen(this.activityDesigner.Bounds);
|
||||
}
|
||||
}
|
||||
|
||||
public override string DefaultAction
|
||||
{
|
||||
get
|
||||
{
|
||||
return DR.GetString(DR.AccessibleAction);
|
||||
}
|
||||
}
|
||||
|
||||
public override string Description
|
||||
{
|
||||
get
|
||||
{
|
||||
return DR.GetString(DR.ActivityDesignerAccessibleDescription, this.activityDesigner.Activity.GetType().Name);
|
||||
}
|
||||
}
|
||||
|
||||
public override string Help
|
||||
{
|
||||
get
|
||||
{
|
||||
return DR.GetString(DR.ActivityDesignerAccessibleHelp, this.activityDesigner.Activity.GetType().Name);
|
||||
}
|
||||
}
|
||||
|
||||
public override string Name
|
||||
{
|
||||
get
|
||||
{
|
||||
Activity activity = this.activityDesigner.Activity as Activity;
|
||||
if (activity != null)
|
||||
{
|
||||
if (TypeDescriptor.GetProperties(activity)["TypeName"] != null)
|
||||
return TypeDescriptor.GetProperties(activity)["TypeName"].GetValue(activity) as string;
|
||||
else if (!string.IsNullOrEmpty(activity.QualifiedName))
|
||||
return activity.QualifiedName;
|
||||
else
|
||||
return activity.GetType().FullName;
|
||||
}
|
||||
else
|
||||
{
|
||||
return base.Name;
|
||||
}
|
||||
}
|
||||
|
||||
set
|
||||
{
|
||||
//We do not allow setting ID programatically
|
||||
}
|
||||
}
|
||||
|
||||
public override AccessibleObject Parent
|
||||
{
|
||||
get
|
||||
{
|
||||
CompositeActivityDesigner compositeDesigner = this.activityDesigner.ParentDesigner;
|
||||
return (compositeDesigner != null) ? compositeDesigner.AccessibilityObject : null;
|
||||
}
|
||||
}
|
||||
|
||||
public override AccessibleRole Role
|
||||
{
|
||||
get
|
||||
{
|
||||
return AccessibleRole.Diagram;
|
||||
}
|
||||
}
|
||||
|
||||
public override AccessibleStates State
|
||||
{
|
||||
get
|
||||
{
|
||||
AccessibleStates state = (this.activityDesigner.IsSelected) ? AccessibleStates.Selected : AccessibleStates.Selectable;
|
||||
state |= AccessibleStates.MultiSelectable;
|
||||
state |= (this.activityDesigner.IsPrimarySelection) ? AccessibleStates.Focused : AccessibleStates.Focusable;
|
||||
|
||||
if (this.activityDesigner.IsLocked)
|
||||
state |= AccessibleStates.ReadOnly;
|
||||
else
|
||||
state |= AccessibleStates.Moveable;
|
||||
|
||||
if (!this.activityDesigner.IsVisible)
|
||||
state |= AccessibleStates.Invisible;
|
||||
|
||||
return state;
|
||||
}
|
||||
}
|
||||
|
||||
public override void DoDefaultAction()
|
||||
{
|
||||
ISelectionService selectionService = GetService(typeof(ISelectionService)) as ISelectionService;
|
||||
if (selectionService != null)
|
||||
selectionService.SetSelectedComponents(new object[] { this.activityDesigner.Activity }, SelectionTypes.Replace);
|
||||
else
|
||||
base.DoDefaultAction();
|
||||
}
|
||||
|
||||
public override AccessibleObject Navigate(AccessibleNavigation navdir)
|
||||
{
|
||||
if (navdir == AccessibleNavigation.FirstChild)
|
||||
{
|
||||
return GetChild(0);
|
||||
}
|
||||
else if (navdir == AccessibleNavigation.LastChild)
|
||||
{
|
||||
return GetChild(GetChildCount() - 1);
|
||||
}
|
||||
else
|
||||
{
|
||||
CompositeActivityDesigner compositeDesigner = this.activityDesigner.ParentDesigner;
|
||||
if (compositeDesigner != null)
|
||||
{
|
||||
DesignerNavigationDirection navigate = default(DesignerNavigationDirection);
|
||||
if (navdir == AccessibleNavigation.Left)
|
||||
navigate = DesignerNavigationDirection.Left;
|
||||
else if (navdir == AccessibleNavigation.Right)
|
||||
navigate = DesignerNavigationDirection.Right;
|
||||
else if (navdir == AccessibleNavigation.Up || navdir == AccessibleNavigation.Previous)
|
||||
navigate = DesignerNavigationDirection.Up;
|
||||
else if (navdir == AccessibleNavigation.Down || navdir == AccessibleNavigation.Next)
|
||||
navigate = DesignerNavigationDirection.Down;
|
||||
|
||||
ActivityDesigner activityDesigner = ActivityDesigner.GetDesigner(compositeDesigner.GetNextSelectableObject(this.activityDesigner.Activity, navigate) as Activity);
|
||||
if (activityDesigner != null)
|
||||
return activityDesigner.AccessibilityObject;
|
||||
}
|
||||
}
|
||||
|
||||
return base.Navigate(navdir);
|
||||
}
|
||||
|
||||
public override void Select(AccessibleSelection flags)
|
||||
{
|
||||
ISelectionService selectionService = GetService(typeof(ISelectionService)) as ISelectionService;
|
||||
if (selectionService != null)
|
||||
{
|
||||
if (((flags & AccessibleSelection.TakeFocus) > 0) || ((flags & AccessibleSelection.TakeSelection) > 0))
|
||||
selectionService.SetSelectedComponents(new object[] { this.activityDesigner.Activity }, SelectionTypes.Replace);
|
||||
else if ((flags & AccessibleSelection.AddSelection) > 0)
|
||||
selectionService.SetSelectedComponents(new object[] { this.activityDesigner.Activity }, SelectionTypes.Add);
|
||||
else if ((flags & AccessibleSelection.RemoveSelection) > 0)
|
||||
selectionService.SetSelectedComponents(new object[] { this.activityDesigner.Activity }, SelectionTypes.Remove);
|
||||
}
|
||||
}
|
||||
|
||||
protected object GetService(Type serviceType)
|
||||
{
|
||||
if (serviceType == null)
|
||||
throw new ArgumentNullException("serviceType");
|
||||
|
||||
if (this.ActivityDesigner.Activity != null && this.ActivityDesigner.Activity.Site != null)
|
||||
return this.ActivityDesigner.Activity.Site.GetService(serviceType);
|
||||
else
|
||||
return null;
|
||||
}
|
||||
|
||||
protected ActivityDesigner ActivityDesigner
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.activityDesigner;
|
||||
}
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
}
|
@@ -0,0 +1,454 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using System.ComponentModel;
|
||||
using System.ComponentModel.Design;
|
||||
using System.ComponentModel.Design.Serialization;
|
||||
using System.Reflection;
|
||||
using System.Xml;
|
||||
using System.Workflow.ComponentModel.Serialization;
|
||||
using System.Drawing;
|
||||
|
||||
namespace System.Workflow.ComponentModel.Design
|
||||
{
|
||||
#region Class ActivityDesignerLayoutSerializer
|
||||
[Obsolete("The System.Workflow.* types are deprecated. Instead, please use the new types from System.Activities.*")]
|
||||
public class ActivityDesignerLayoutSerializer : WorkflowMarkupSerializer
|
||||
{
|
||||
protected override void OnBeforeSerialize(WorkflowMarkupSerializationManager serializationManager, object obj)
|
||||
{
|
||||
base.OnBeforeSerialize(serializationManager, obj);
|
||||
|
||||
//For root activity we will go through all the nested activities and put the namespaces at the top level
|
||||
ActivityDesigner activityDesigner = obj as ActivityDesigner;
|
||||
XmlWriter writer = serializationManager.WorkflowMarkupStack[typeof(XmlWriter)] as XmlWriter;
|
||||
if (activityDesigner.Activity != null && activityDesigner.Activity.Parent == null && writer != null)
|
||||
{
|
||||
string prefix = String.Empty;
|
||||
XmlQualifiedName xmlQualifiedName = serializationManager.GetXmlQualifiedName(typeof(Point), out prefix);
|
||||
writer.WriteAttributeString("xmlns", prefix, null, xmlQualifiedName.Namespace);
|
||||
}
|
||||
}
|
||||
|
||||
protected override object CreateInstance(WorkflowMarkupSerializationManager serializationManager, Type type)
|
||||
{
|
||||
if (serializationManager == null)
|
||||
throw new ArgumentNullException("serializationManager");
|
||||
if (type == null)
|
||||
throw new ArgumentNullException("type");
|
||||
|
||||
object designer = null;
|
||||
|
||||
IDesignerHost host = serializationManager.GetService(typeof(IDesignerHost)) as IDesignerHost;
|
||||
XmlReader reader = serializationManager.WorkflowMarkupStack[typeof(XmlReader)] as XmlReader;
|
||||
if (host != null && reader != null)
|
||||
{
|
||||
//Find the associated activity
|
||||
string associatedActivityName = String.Empty;
|
||||
while (reader.MoveToNextAttribute() && !reader.LocalName.Equals("Name", StringComparison.Ordinal));
|
||||
if (reader.LocalName.Equals("Name", StringComparison.Ordinal) && reader.ReadAttributeValue())
|
||||
associatedActivityName = reader.Value;
|
||||
reader.MoveToElement();
|
||||
|
||||
if (!String.IsNullOrEmpty(associatedActivityName))
|
||||
{
|
||||
CompositeActivityDesigner parentDesigner = serializationManager.Context[typeof(CompositeActivityDesigner)] as CompositeActivityDesigner;
|
||||
if (parentDesigner == null)
|
||||
{
|
||||
Activity activity = host.RootComponent as Activity;
|
||||
if (activity != null && !associatedActivityName.Equals(activity.Name, StringComparison.Ordinal))
|
||||
{
|
||||
foreach (IComponent component in host.Container.Components)
|
||||
{
|
||||
activity = component as Activity;
|
||||
if (activity != null && associatedActivityName.Equals(activity.Name, StringComparison.Ordinal))
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (activity != null)
|
||||
designer = host.GetDesigner(activity);
|
||||
}
|
||||
else
|
||||
{
|
||||
CompositeActivity compositeActivity = parentDesigner.Activity as CompositeActivity;
|
||||
if (compositeActivity != null)
|
||||
{
|
||||
Activity matchingActivity = null;
|
||||
foreach (Activity activity in compositeActivity.Activities)
|
||||
{
|
||||
if (associatedActivityName.Equals(activity.Name, StringComparison.Ordinal))
|
||||
{
|
||||
matchingActivity = activity;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (matchingActivity != null)
|
||||
designer = host.GetDesigner(matchingActivity);
|
||||
}
|
||||
}
|
||||
|
||||
if (designer == null)
|
||||
serializationManager.ReportError(SR.GetString(SR.Error_LayoutSerializationActivityNotFound, reader.LocalName, associatedActivityName, "Name"));
|
||||
}
|
||||
else
|
||||
{
|
||||
serializationManager.ReportError(SR.GetString(SR.Error_LayoutSerializationAssociatedActivityNotFound, reader.LocalName, "Name"));
|
||||
}
|
||||
}
|
||||
|
||||
return designer;
|
||||
}
|
||||
|
||||
protected internal override PropertyInfo[] GetProperties(WorkflowMarkupSerializationManager serializationManager, object obj)
|
||||
{
|
||||
if (serializationManager == null)
|
||||
throw new ArgumentNullException("serializationManager");
|
||||
if (obj == null)
|
||||
throw new ArgumentNullException("obj");
|
||||
|
||||
List<PropertyInfo> properties = new List<PropertyInfo>(base.GetProperties(serializationManager, obj));
|
||||
|
||||
ActivityDesigner activityDesigner = obj as ActivityDesigner;
|
||||
if (activityDesigner != null)
|
||||
{
|
||||
PropertyInfo nameProperty = activityDesigner.GetType().GetProperty("Name", BindingFlags.Instance | BindingFlags.NonPublic);
|
||||
if (nameProperty != null)
|
||||
properties.Insert(0, nameProperty);
|
||||
}
|
||||
|
||||
return properties.ToArray();
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Class CompositeActivityDesignerLayoutSerializer
|
||||
[Obsolete("The System.Workflow.* types are deprecated. Instead, please use the new types from System.Activities.*")]
|
||||
public class CompositeActivityDesignerLayoutSerializer : ActivityDesignerLayoutSerializer
|
||||
{
|
||||
protected internal override PropertyInfo[] GetProperties(WorkflowMarkupSerializationManager serializationManager, object obj)
|
||||
{
|
||||
List<PropertyInfo> properties = new List<PropertyInfo>(base.GetProperties(serializationManager, obj));
|
||||
properties.Add(typeof(CompositeActivityDesigner).GetProperty("Designers", BindingFlags.Instance | BindingFlags.NonPublic));
|
||||
return properties.ToArray();
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Class FreeformActivityDesignerLayoutSerializer
|
||||
[Obsolete("The System.Workflow.* types are deprecated. Instead, please use the new types from System.Activities.*")]
|
||||
public class FreeformActivityDesignerLayoutSerializer : CompositeActivityDesignerLayoutSerializer
|
||||
{
|
||||
protected internal override PropertyInfo[] GetProperties(WorkflowMarkupSerializationManager serializationManager, object obj)
|
||||
{
|
||||
if (serializationManager == null)
|
||||
throw new ArgumentNullException("serializationManager");
|
||||
if (obj == null)
|
||||
throw new ArgumentNullException("obj");
|
||||
|
||||
XmlWriter writer = serializationManager.WorkflowMarkupStack[typeof(XmlWriter)] as XmlWriter;
|
||||
PropertyInfo[] properties = base.GetProperties(serializationManager, obj);
|
||||
FreeformActivityDesigner freeformDesigner = obj as FreeformActivityDesigner;
|
||||
if (freeformDesigner != null)
|
||||
{
|
||||
List<PropertyInfo> serializableProperties = new List<PropertyInfo>();
|
||||
foreach (PropertyInfo property in properties)
|
||||
{
|
||||
//Only filter this property out when we are writting
|
||||
if (writer != null &&
|
||||
property.Name.Equals("AutoSizeMargin", StringComparison.Ordinal) &&
|
||||
freeformDesigner.AutoSizeMargin == FreeformActivityDesigner.DefaultAutoSizeMargin)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
serializableProperties.Add(property);
|
||||
}
|
||||
|
||||
serializableProperties.Add(typeof(FreeformActivityDesigner).GetProperty("DesignerConnectors", BindingFlags.Instance | BindingFlags.NonPublic));
|
||||
properties = serializableProperties.ToArray();
|
||||
}
|
||||
|
||||
return properties;
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region ConnectorLayoutSerializer
|
||||
[Obsolete("The System.Workflow.* types are deprecated. Instead, please use the new types from System.Activities.*")]
|
||||
public class ConnectorLayoutSerializer : WorkflowMarkupSerializer
|
||||
{
|
||||
protected internal override PropertyInfo[] GetProperties(WorkflowMarkupSerializationManager serializationManager, object obj)
|
||||
{
|
||||
if (serializationManager == null)
|
||||
throw new ArgumentNullException("serializationManager");
|
||||
if (obj == null)
|
||||
throw new ArgumentNullException("obj");
|
||||
|
||||
List<PropertyInfo> properties = new List<PropertyInfo>(base.GetProperties(serializationManager, obj));
|
||||
properties.Add(typeof(Connector).GetProperty("SourceActivity", BindingFlags.Instance | BindingFlags.NonPublic));
|
||||
properties.Add(typeof(Connector).GetProperty("SourceConnectionIndex", BindingFlags.Instance | BindingFlags.NonPublic));
|
||||
properties.Add(typeof(Connector).GetProperty("SourceConnectionEdge", BindingFlags.Instance | BindingFlags.NonPublic));
|
||||
properties.Add(typeof(Connector).GetProperty("TargetActivity", BindingFlags.Instance | BindingFlags.NonPublic));
|
||||
properties.Add(typeof(Connector).GetProperty("TargetConnectionIndex", BindingFlags.Instance | BindingFlags.NonPublic));
|
||||
properties.Add(typeof(Connector).GetProperty("TargetConnectionEdge", BindingFlags.Instance | BindingFlags.NonPublic));
|
||||
properties.Add(typeof(Connector).GetProperty("Segments", BindingFlags.Instance | BindingFlags.NonPublic));
|
||||
return properties.ToArray();
|
||||
}
|
||||
|
||||
protected override object CreateInstance(WorkflowMarkupSerializationManager serializationManager, Type type)
|
||||
{
|
||||
if (serializationManager == null)
|
||||
throw new ArgumentNullException("serializationManager");
|
||||
if (type == null)
|
||||
throw new ArgumentNullException("type");
|
||||
|
||||
Connector connector = null;
|
||||
|
||||
IReferenceService referenceService = serializationManager.GetService(typeof(IReferenceService)) as IReferenceService;
|
||||
FreeformActivityDesigner freeformDesigner = serializationManager.Context[typeof(FreeformActivityDesigner)] as FreeformActivityDesigner;
|
||||
if (freeformDesigner != null && referenceService != null)
|
||||
{
|
||||
ConnectionPoint sourceConnection = null;
|
||||
ConnectionPoint targetConnection = null;
|
||||
|
||||
try
|
||||
{
|
||||
Dictionary<string, string> constructionArguments = GetConnectorConstructionArguments(serializationManager, type);
|
||||
|
||||
if (constructionArguments.ContainsKey("SourceActivity") &&
|
||||
constructionArguments.ContainsKey("SourceConnectionIndex") &&
|
||||
constructionArguments.ContainsKey("SourceConnectionEdge"))
|
||||
{
|
||||
ActivityDesigner sourceDesigner = ActivityDesigner.GetDesigner(referenceService.GetReference(constructionArguments["SourceActivity"] as string) as Activity);
|
||||
DesignerEdges sourceEdge = (DesignerEdges)Enum.Parse(typeof(DesignerEdges), constructionArguments["SourceConnectionEdge"] as string);
|
||||
int sourceIndex = Convert.ToInt32(constructionArguments["SourceConnectionIndex"] as string, System.Globalization.CultureInfo.InvariantCulture);
|
||||
if (sourceDesigner != null && sourceEdge != DesignerEdges.None && sourceIndex >= 0)
|
||||
sourceConnection = new ConnectionPoint(sourceDesigner, sourceEdge, sourceIndex);
|
||||
}
|
||||
|
||||
if (constructionArguments.ContainsKey("TargetActivity") &&
|
||||
constructionArguments.ContainsKey("TargetConnectionIndex") &&
|
||||
constructionArguments.ContainsKey("TargetConnectionEdge"))
|
||||
{
|
||||
ActivityDesigner targetDesigner = ActivityDesigner.GetDesigner(referenceService.GetReference(constructionArguments["TargetActivity"] as string) as Activity);
|
||||
DesignerEdges targetEdge = (DesignerEdges)Enum.Parse(typeof(DesignerEdges), constructionArguments["TargetConnectionEdge"] as string);
|
||||
int targetIndex = Convert.ToInt32(constructionArguments["TargetConnectionIndex"] as string, System.Globalization.CultureInfo.InvariantCulture);
|
||||
if (targetDesigner != null && targetEdge != DesignerEdges.None && targetIndex >= 0)
|
||||
targetConnection = new ConnectionPoint(targetDesigner, targetEdge, targetIndex);
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
}
|
||||
|
||||
if (sourceConnection != null && targetConnection != null)
|
||||
connector = freeformDesigner.AddConnector(sourceConnection, targetConnection);
|
||||
}
|
||||
|
||||
return connector;
|
||||
}
|
||||
|
||||
protected override void OnAfterDeserialize(WorkflowMarkupSerializationManager serializationManager, object obj)
|
||||
{
|
||||
base.OnAfterDeserialize(serializationManager, obj);
|
||||
|
||||
//The following code is needed in order to making sure that we set the modification flag correctly after deserialization
|
||||
Connector connector = obj as Connector;
|
||||
if (connector != null)
|
||||
connector.SetConnectorModified(true);
|
||||
}
|
||||
|
||||
protected Dictionary<string, string> GetConnectorConstructionArguments(WorkflowMarkupSerializationManager serializationManager, Type type)
|
||||
{
|
||||
Dictionary<string, string> argumentDictionary = new Dictionary<string, string>();
|
||||
|
||||
XmlReader reader = serializationManager.WorkflowMarkupStack[typeof(XmlReader)] as XmlReader;
|
||||
if (reader != null && reader.NodeType == XmlNodeType.Element)
|
||||
{
|
||||
while (reader.MoveToNextAttribute())
|
||||
{
|
||||
string attributeName = reader.LocalName;
|
||||
if (!argumentDictionary.ContainsKey(attributeName))
|
||||
{
|
||||
reader.ReadAttributeValue();
|
||||
argumentDictionary.Add(attributeName, reader.Value);
|
||||
}
|
||||
}
|
||||
reader.MoveToElement();
|
||||
}
|
||||
|
||||
return argumentDictionary;
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Class ActivityDesignerLayoutSerializerProvider
|
||||
internal sealed class ActivityDesignerLayoutSerializerProvider : IDesignerSerializationProvider
|
||||
{
|
||||
#region IDesignerSerializationProvider Members
|
||||
object IDesignerSerializationProvider.GetSerializer(IDesignerSerializationManager manager, object currentSerializer, Type objectType, Type serializerType)
|
||||
{
|
||||
if (typeof(System.Drawing.Color) == objectType)
|
||||
currentSerializer = new ColorMarkupSerializer();
|
||||
else if (typeof(System.Drawing.Size) == objectType)
|
||||
currentSerializer = new SizeMarkupSerializer();
|
||||
else if (typeof(System.Drawing.Point) == objectType)
|
||||
currentSerializer = new PointMarkupSerializer();
|
||||
return currentSerializer;
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Class ColorMarkupSerializer
|
||||
internal sealed class ColorMarkupSerializer : WorkflowMarkupSerializer
|
||||
{
|
||||
protected internal override bool CanSerializeToString(WorkflowMarkupSerializationManager serializationManager, object value)
|
||||
{
|
||||
return (value is System.Drawing.Color);
|
||||
}
|
||||
|
||||
protected internal override string SerializeToString(WorkflowMarkupSerializationManager serializationManager, object value)
|
||||
{
|
||||
if (serializationManager == null)
|
||||
throw new ArgumentNullException("serializationManager");
|
||||
if (value == null)
|
||||
throw new ArgumentNullException("value");
|
||||
|
||||
string stringValue = String.Empty;
|
||||
if (value is System.Drawing.Color)
|
||||
{
|
||||
System.Drawing.Color color = (System.Drawing.Color)value;
|
||||
long colorValue = (long)((uint)(color.A << 24 | color.R << 16 | color.G << 8 | color.B)) & 0xFFFFFFFF;
|
||||
stringValue = "0X" + colorValue.ToString("X08", System.Globalization.CultureInfo.InvariantCulture);
|
||||
}
|
||||
return stringValue;
|
||||
}
|
||||
|
||||
protected internal override object DeserializeFromString(WorkflowMarkupSerializationManager serializationManager, Type propertyType, string value)
|
||||
{
|
||||
if (propertyType.IsAssignableFrom(typeof(System.Drawing.Color)))
|
||||
{
|
||||
string colorValue = value as string;
|
||||
if (!String.IsNullOrEmpty(colorValue))
|
||||
{
|
||||
if (colorValue.StartsWith("0X", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
long propertyValue = Convert.ToInt64((string)value, 16) & 0xFFFFFFFF;
|
||||
return System.Drawing.Color.FromArgb((Byte)(propertyValue >> 24), (Byte)(propertyValue >> 16), (Byte)(propertyValue >> 8), (Byte)(propertyValue));
|
||||
}
|
||||
else
|
||||
{
|
||||
return base.DeserializeFromString(serializationManager, propertyType, value);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Class SizeMarkupSerializer
|
||||
internal sealed class SizeMarkupSerializer : WorkflowMarkupSerializer
|
||||
{
|
||||
protected internal override bool CanSerializeToString(WorkflowMarkupSerializationManager serializationManager, object value)
|
||||
{
|
||||
return (value is System.Drawing.Size);
|
||||
}
|
||||
|
||||
protected internal override PropertyInfo[] GetProperties(WorkflowMarkupSerializationManager serializationManager, object obj)
|
||||
{
|
||||
List<PropertyInfo> properties = new List<PropertyInfo>();
|
||||
if (obj is Size)
|
||||
{
|
||||
properties.Add(typeof(Size).GetProperty("Width"));
|
||||
properties.Add(typeof(Size).GetProperty("Height"));
|
||||
}
|
||||
return properties.ToArray();
|
||||
}
|
||||
|
||||
protected internal override string SerializeToString(WorkflowMarkupSerializationManager serializationManager, object value)
|
||||
{
|
||||
string convertedValue = String.Empty;
|
||||
|
||||
TypeConverter converter = TypeDescriptor.GetConverter(value);
|
||||
if (converter != null && converter.CanConvertTo(typeof(string)))
|
||||
convertedValue = converter.ConvertTo(value, typeof(string)) as string;
|
||||
else
|
||||
convertedValue = base.SerializeToString(serializationManager, value);
|
||||
return convertedValue;
|
||||
}
|
||||
|
||||
protected internal override object DeserializeFromString(WorkflowMarkupSerializationManager serializationManager, Type propertyType, string value)
|
||||
{
|
||||
object size = Size.Empty;
|
||||
|
||||
string sizeValue = value as string;
|
||||
if (!String.IsNullOrEmpty(sizeValue))
|
||||
{
|
||||
TypeConverter converter = TypeDescriptor.GetConverter(typeof(Size));
|
||||
if (converter != null && converter.CanConvertFrom(typeof(string)) && !IsValidCompactAttributeFormat(sizeValue))
|
||||
size = converter.ConvertFrom(value);
|
||||
else
|
||||
size = base.SerializeToString(serializationManager, value);
|
||||
}
|
||||
|
||||
return size;
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Class PointMarkupSerializer
|
||||
internal sealed class PointMarkupSerializer : WorkflowMarkupSerializer
|
||||
{
|
||||
protected internal override bool CanSerializeToString(WorkflowMarkupSerializationManager serializationManager, object value)
|
||||
{
|
||||
return (value is Point);
|
||||
}
|
||||
|
||||
protected internal override PropertyInfo[] GetProperties(WorkflowMarkupSerializationManager serializationManager, object obj)
|
||||
{
|
||||
List<PropertyInfo> properties = new List<PropertyInfo>();
|
||||
if (obj is Point)
|
||||
{
|
||||
properties.Add(typeof(Point).GetProperty("X"));
|
||||
properties.Add(typeof(Point).GetProperty("Y"));
|
||||
}
|
||||
return properties.ToArray();
|
||||
}
|
||||
|
||||
protected internal override string SerializeToString(WorkflowMarkupSerializationManager serializationManager, object value)
|
||||
{
|
||||
string convertedValue = String.Empty;
|
||||
|
||||
TypeConverter converter = TypeDescriptor.GetConverter(value);
|
||||
if (converter != null && converter.CanConvertTo(typeof(string)))
|
||||
convertedValue = converter.ConvertTo(value, typeof(string)) as string;
|
||||
else
|
||||
convertedValue = base.SerializeToString(serializationManager, value);
|
||||
return convertedValue;
|
||||
}
|
||||
|
||||
protected internal override object DeserializeFromString(WorkflowMarkupSerializationManager serializationManager, Type propertyType, string value)
|
||||
{
|
||||
object point = Point.Empty;
|
||||
|
||||
string pointValue = value as string;
|
||||
if (!String.IsNullOrEmpty(pointValue))
|
||||
{
|
||||
TypeConverter converter = TypeDescriptor.GetConverter(typeof(Point));
|
||||
if (converter != null && converter.CanConvertFrom(typeof(string)) && !IsValidCompactAttributeFormat(pointValue))
|
||||
point = converter.ConvertFrom(value);
|
||||
else
|
||||
point = base.SerializeToString(serializationManager, value);
|
||||
}
|
||||
|
||||
return point;
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
}
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,74 @@
|
||||
#pragma warning disable 1634, 1691
|
||||
namespace System.Workflow.ComponentModel.Design
|
||||
{
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Drawing;
|
||||
using System.CodeDom;
|
||||
using System.Diagnostics;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Windows.Forms;
|
||||
using System.ComponentModel;
|
||||
using System.Globalization;
|
||||
using System.Drawing.Design;
|
||||
using System.Drawing.Imaging;
|
||||
using System.Drawing.Drawing2D;
|
||||
using System.Windows.Forms.Design;
|
||||
using System.ComponentModel.Design;
|
||||
using System.Collections.Specialized;
|
||||
using System.ComponentModel.Design.Serialization;
|
||||
using System.Workflow.ComponentModel.Compiler;
|
||||
using System.Workflow.ComponentModel.Serialization;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.Reflection;
|
||||
using System.Workflow.ComponentModel.Design;
|
||||
using System.Runtime.Serialization.Formatters.Binary;
|
||||
|
||||
//
|
||||
|
||||
#region Class CompositeDesignerAccessibleObject
|
||||
/// <summary>
|
||||
/// Represents accessibility object associated with CompositeActivityDesigner
|
||||
/// </summary>
|
||||
[Obsolete("The System.Workflow.* types are deprecated. Instead, please use the new types from System.Activities.*")]
|
||||
public class CompositeDesignerAccessibleObject : ActivityDesignerAccessibleObject
|
||||
{
|
||||
/// <summary>
|
||||
/// Constructor for accessibility object
|
||||
/// </summary>
|
||||
/// <param name="activityDesigner">Designer which is associated with accessibility object</param>
|
||||
public CompositeDesignerAccessibleObject(CompositeActivityDesigner activityDesigner)
|
||||
: base(activityDesigner)
|
||||
{
|
||||
}
|
||||
|
||||
public override AccessibleStates State
|
||||
{
|
||||
get
|
||||
{
|
||||
AccessibleStates state = base.State;
|
||||
CompositeActivityDesigner compositeDesigner = base.ActivityDesigner as CompositeActivityDesigner;
|
||||
state |= (compositeDesigner.Expanded) ? AccessibleStates.Expanded : AccessibleStates.Collapsed;
|
||||
return state;
|
||||
}
|
||||
}
|
||||
|
||||
public override AccessibleObject GetChild(int index)
|
||||
{
|
||||
CompositeActivityDesigner compositeDesigner = base.ActivityDesigner as CompositeActivityDesigner;
|
||||
if (index >= 0 && index < compositeDesigner.ContainedDesigners.Count)
|
||||
return compositeDesigner.ContainedDesigners[index].AccessibilityObject;
|
||||
else
|
||||
return base.GetChild(index);
|
||||
}
|
||||
|
||||
public override int GetChildCount()
|
||||
{
|
||||
CompositeActivityDesigner compositeDesigner = base.ActivityDesigner as CompositeActivityDesigner;
|
||||
return compositeDesigner.ContainedDesigners.Count;
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
}
|
@@ -0,0 +1 @@
|
||||
d07dd2b28b9fbc053a988f7a5072208f7d8b02c6
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,257 @@
|
||||
#region Using Directives
|
||||
using System;
|
||||
using System.Resources;
|
||||
using System.Drawing;
|
||||
using System.Globalization;
|
||||
#endregion
|
||||
|
||||
namespace System.Workflow.ComponentModel.Design
|
||||
{
|
||||
#region Class DesignerResources (DR)
|
||||
internal static class DR
|
||||
{
|
||||
internal const string ResourceSet = "System.Workflow.ComponentModel.Design.DesignerResources";
|
||||
private static ResourceManager resourceManager = new ResourceManager(ResourceSet, System.Reflection.Assembly.GetExecutingAssembly());
|
||||
|
||||
internal const string ViewPreviousActivity = "ViewPreviousActivity";
|
||||
internal const string ViewNextActivity = "ViewNextActivity";
|
||||
internal const string PreviewActivity = "PreviewActivity";
|
||||
internal const string EditActivity = "EditActivity";
|
||||
internal const string GenerateEventHandlers = "GenerateEventHandlers";
|
||||
internal const string PromoteBindings = "PromoteBindings";
|
||||
internal const string BindSelectedProperty = "BindSelectedProperty";
|
||||
internal const string BindSelectedPropertyFormat = "BindSelectedPropertyFormat";
|
||||
internal const string BindProperty = "BindProperty";
|
||||
internal const string PackageFileInvalid = "PackageFileInvalid";
|
||||
internal const string PackageFileInvalidChars = "PackageFileInvalidChars";
|
||||
internal const string PackageFileDefault = "PackageFileDefault";
|
||||
internal const string PackageInvalidValidatorType = "PackageInvalidValidatorType";
|
||||
internal const string PackageFileExist = "PackageFileExist";
|
||||
internal const string OpenfileDialogTitle = "OpenfileDialogTitle";
|
||||
internal const string PackageAssemblyReferenceFilter = "PackageAssemblyReferenceFilter";
|
||||
internal const string CreatePackageTitle = "CreatePackageTitle";
|
||||
internal const string ActivitySetDefaultName = "ActivitySetDefaultName";
|
||||
internal const string ActivitySetNoName = "ActivitySetNoName";
|
||||
internal const string ActivitySetNoActivity = "ActivitySetNoActivity";
|
||||
internal const string ModifyPackageTitle = "ModifyPackageTitle";
|
||||
internal const string ViewPackageTitle = "ViewPackageTitle";
|
||||
internal const string ErrorInitPackage = "ErrorInitPackage";
|
||||
internal const string CheckAll = "CheckAll";
|
||||
internal const string NoHelpAvailable = "NoHelpAvailable";
|
||||
internal const string ActivitySetDefaultFileName = "ActivitySetDefaultFileName";
|
||||
internal const string TypeInvalid = "TypeInvalid";
|
||||
internal const string FilterDescription = "FilterDescription";
|
||||
internal const string Zoom400Mode = "Zoom400Mode";
|
||||
internal const string Zoom300Mode = "Zoom300Mode";
|
||||
internal const string Zoom200Mode = "Zoom200Mode";
|
||||
internal const string Zoom150Mode = "Zoom150Mode";
|
||||
internal const string Zoom100Mode = "Zoom100Mode";
|
||||
internal const string Zoom75Mode = "Zoom75Mode";
|
||||
internal const string Zoom50Mode = "Zoom50Mode";
|
||||
internal const string ZoomShowAll = "ZoomShowAll";
|
||||
internal const string ActivityInsertError = "ActivityInsertError";
|
||||
internal const string InvalidOperationBadClipboardFormat = "InvalidOperationBadClipboardFormat";
|
||||
internal const string ArgumentExceptionDesignerVerbIdsRange = "ArgumentExceptionDesignerVerbIdsRange";
|
||||
internal const string InvalidOperationStoreAlreadyClosed = "InvalidOperationStoreAlreadyClosed";
|
||||
internal const string InvalidOperationDeserializationReturnedNonActivity = "InvalidOperationDeserializationReturnedNonActivity";
|
||||
internal const string AccessibleAction = "AccessibleAction";
|
||||
internal const string LeftScrollButtonAccessibleDescription = "LeftScrollButtonAccessibleDescription";
|
||||
internal const string RightScrollButtonAccessibleDescription = "RightScrollButtonAccessibleDescription";
|
||||
internal const string ActivityDesignerAccessibleDescription = "ActivityDesignerAccessibleDescription";
|
||||
internal const string LeftScrollButtonAccessibleHelp = "LeftScrollButtonAccessibleHelp";
|
||||
internal const string RightScrollButtonAccessibleHelp = "RightScrollButtonAccessibleHelp";
|
||||
internal const string ActivityDesignerAccessibleHelp = "ActivityDesignerAccessibleHelp";
|
||||
internal const string LeftScrollButtonName = "LeftScrollButtonName";
|
||||
internal const string RightScrollButtonName = "RightScrollButtonName";
|
||||
internal const string SelectActivityDesc = "SelectActivityDesc";
|
||||
internal const string PreviewMode = "PreviewMode";
|
||||
internal const string EditMode = "EditMode";
|
||||
internal const string PreviewButtonAccessibleDescription = "PreviewButtonAccessibleDescription";
|
||||
internal const string PreviewButtonAccessibleHelp = "PreviewButtonAccessibleHelp";
|
||||
internal const string PreviewButtonName = "PreviewButtonName";
|
||||
internal const string CancelDescriptionString = "CancelDescriptionString";
|
||||
internal const string HeaderFooterStringNone = "HeaderFooterStringNone";
|
||||
internal const string HeaderFooterStringCustom = "HeaderFooterStringCustom";
|
||||
internal const string HeaderFooterFormat1 = "HeaderFooterFormat1";
|
||||
internal const string HeaderFooterFormat2 = "HeaderFooterFormat2";
|
||||
internal const string HeaderFooterFormat3 = "HeaderFooterFormat3";
|
||||
internal const string HeaderFooterFormat4 = "HeaderFooterFormat4";
|
||||
internal const string HeaderFooterFormat5 = "HeaderFooterFormat5";
|
||||
internal const string HeaderFooterFormat6 = "HeaderFooterFormat6";
|
||||
internal const string HeaderFooterFormat7 = "HeaderFooterFormat7";
|
||||
internal const string HeaderFooterFormat8 = "HeaderFooterFormat8";
|
||||
internal const string HeaderFooterFormat9 = "HeaderFooterFormat9";
|
||||
internal const string EnteredMarginsAreNotValidErrorMessage = "EnteredMarginsAreNotValidErrorMessage";
|
||||
internal const string ChildActivitiesNotConfigured = "ChildActivitiesNotConfigured";
|
||||
internal const string ConnectorAccessibleDescription = "ConnectorAccessibleDescription";
|
||||
internal const string ConnectorAccessibleHelp = "ConnectorAccessibleHelp";
|
||||
internal const string ConnectorDesc = "ConnectorDesc";
|
||||
internal const string WorkflowDesc = "WorkflowDesc";
|
||||
internal const string AddBranch = "AddBranch";
|
||||
internal const string DropActivitiesHere = "DropActivitiesHere";
|
||||
internal const string DesignerNotInitialized = "DesignerNotInitialized";
|
||||
internal const string MyFavoriteTheme = "MyFavoriteTheme";
|
||||
internal const string AmbientThemeException = "AmbientThemeException";
|
||||
internal const string ThemeTypesMismatch = "ThemeTypesMismatch";
|
||||
internal const string DesignerThemeException = "DesignerThemeException";
|
||||
internal const string CustomStyleNotSupported = "CustomStyleNotSupported";
|
||||
internal const string EmptyFontFamilyNotSupported = "EmptyFontFamilyNotSupported";
|
||||
internal const string FontFamilyNotSupported = "FontFamilyNotSupported";
|
||||
internal const string ContentAlignmentNotSupported = "ContentAlignmentNotSupported";
|
||||
internal const string ZoomLevelException2 = "ZoomLevelException2";
|
||||
internal const string ShadowDepthException = "ShadowDepthException";
|
||||
internal const string ThereIsNoPrinterInstalledErrorMessage = "ThereIsNoPrinterInstalledErrorMessage";
|
||||
internal const string WorkflowViewAccessibleDescription = "WorkflowViewAccessibleDescription";
|
||||
internal const string WorkflowViewAccessibleHelp = "WorkflowViewAccessibleHelp";
|
||||
internal const string WorkflowViewAccessibleName = "WorkflowViewAccessibleName";
|
||||
internal const string SelectedPrinterIsInvalidErrorMessage = "SelectedPrinterIsInvalidErrorMessage";
|
||||
internal const string ObjectDoesNotSupportIPropertyValuesProvider = "ObjectDoesNotSupportIPropertyValuesProvider";
|
||||
internal const string ThemeFileFilter = "ThemeFileFilter";
|
||||
internal const string ThemeConfig = "ThemeConfig";
|
||||
internal const string ThemeNameNotValid = "ThemeNameNotValid";
|
||||
internal const string ThemePathNotValid = "ThemePathNotValid";
|
||||
internal const string ThemeFileNotXml = "ThemeFileNotXml";
|
||||
internal const string UpdateRelativePaths = "UpdateRelativePaths";
|
||||
internal const string ThemeDescription = "ThemeDescription";
|
||||
internal const string ThemeFileCreationError = "ThemeFileCreationError";
|
||||
internal const string Preview = "Preview";
|
||||
internal const string ArgumentExceptionSmartActionIdsRange = "ArgumentExceptionSmartActionIdsRange";
|
||||
internal const string ActivitiesDesc = "ActivitiesDesc";
|
||||
internal const string MoveLeftDesc = "MoveLeftDesc";
|
||||
internal const string MoveRightDesc = "MoveRightDesc";
|
||||
internal const string DropExceptionsHere = "DropExceptionsHere";
|
||||
internal const string SpecifyTargetWorkflow = "SpecifyTargetWorkflow";
|
||||
internal const string ServiceHelpText = "ServiceHelpText";
|
||||
internal const string StartWorkFlow = "StartWorkFlow";
|
||||
internal const string Complete = "Complete";
|
||||
internal const string ServiceExceptions = "ServiceExceptions";
|
||||
internal const string ServiceEvents = "ServiceEvents";
|
||||
internal const string ServiceCompensation = "ServiceCompensation";
|
||||
internal const string ScopeDesc = "ScopeDesc";
|
||||
internal const string EventsDesc = "EventsDesc";
|
||||
internal const string InvokeWebServiceDisplayName = "InvokeWebServiceDisplayName";
|
||||
internal const string InvalidClassNameIdentifier = "InvalidClassNameIdentifier";
|
||||
internal const string InvalidBaseTypeOfCompanion = "InvalidBaseTypeOfCompanion";
|
||||
internal const string Error_InvalidActivity = "Error_InvalidActivity";
|
||||
internal const string Error_MultiviewSequentialActivityDesigner = "Error_MultiviewSequentialActivityDesigner";
|
||||
internal const string AddingBranch = "AddingBranch";
|
||||
internal const string WorkflowPrintDocumentNotFound = "WorkflowPrintDocumentNotFound";
|
||||
internal const string DefaultTheme = "DefaultTheme";
|
||||
internal const string DefaultThemeDescription = "DefaultThemeDescription";
|
||||
internal const string OSTheme = "OSTheme";
|
||||
internal const string SystemThemeDescription = "SystemThemeDescription";
|
||||
internal const string ActivitySetMessageBoxTitle = "ActivitySetMessageBoxTitle";
|
||||
internal const string ViewExceptions = "ViewExceptions";
|
||||
internal const string ViewEvents = "ViewEvents";
|
||||
internal const string ViewCompensation = "ViewCompensation";
|
||||
internal const string ViewCancelHandler = "ViewCancelHandler";
|
||||
internal const string ViewActivity = "ViewActivity";
|
||||
internal const string ThemeMessageBoxTitle = "ThemeMessageBoxTitle";
|
||||
internal const string InfoTipTitle = "InfoTipTitle";
|
||||
internal const string InfoTipId = "InfoTipId";
|
||||
internal const string InfoTipDescription = "InfoTipDescription";
|
||||
internal const string TypeBrowser_ProblemsLoadingAssembly = "TypeBrowser_ProblemsLoadingAssembly";
|
||||
internal const string TypeBrowser_UnableToLoadOneOrMoreTypes = "TypeBrowser_UnableToLoadOneOrMoreTypes";
|
||||
internal const string StartWorkflow = "StartWorkflow";
|
||||
internal const string EndWorkflow = "EndWorkflow";
|
||||
internal const string Error_FailedToDeserializeComponents = "Error_FailedToDeserializeComponents";
|
||||
internal const string Error_Reason = "Error_Reason";
|
||||
internal const string WorkflowDesignerTitle = "WorkflowDesignerTitle";
|
||||
internal const string RuleName = "RuleName";
|
||||
internal const string RuleExpression = "RuleExpression";
|
||||
internal const string DeclarativeRules = "DeclarativeRules";
|
||||
internal const string Error_ThemeAttributeMissing = "Error_ThemeAttributeMissing";
|
||||
internal const string Error_ThemeTypeMissing = "Error_ThemeTypeMissing";
|
||||
internal const string Error_ThemeTypesMismatch = "Error_ThemeTypesMismatch";
|
||||
internal const string ZOrderUndoDescription = "ZOrderUndoDescription";
|
||||
internal const string SendToBack = "SendToBack";
|
||||
internal const string BringToFront = "BringToFront";
|
||||
internal const string ResizeUndoDescription = "ResizeUndoDescription";
|
||||
internal const string FitToScreenDescription = "FitToScreenDescription";
|
||||
internal const string FitToWorkflowDescription = "FitToWorkflowDescription";
|
||||
internal const string BMPImageFormat = "BMPImageFormat";
|
||||
internal const string JPEGImageFormat = "JPEGImageFormat";
|
||||
internal const string PNGImageFormat = "PNGImageFormat";
|
||||
internal const string TIFFImageFormat = "TIFFImageFormat";
|
||||
internal const string WMFImageFormat = "WMFImageFormat";
|
||||
internal const string EXIFImageFormat = "EXIFImageFormat";
|
||||
internal const string EMFImageFormat = "EMFImageFormat";
|
||||
internal const string CustomEventType = "CustomEventType";
|
||||
internal const string CustomPropertyType = "CustomPropertyType";
|
||||
internal const string SaveWorkflowImageDialogTitle = "SaveWorkflowImageDialogTitle";
|
||||
internal const string ImageFileFilter = "ImageFileFilter";
|
||||
internal const string Rules = "Rules";
|
||||
internal const string More = "More";
|
||||
internal const string Empty = "Empty";
|
||||
internal const string InvalidDockingStyle = "InvalidDockingStyle";
|
||||
internal const string ButtonInformationMissing = "ButtonInformationMissing";
|
||||
internal const string InvalidDesignerSpecified = "InvalidDesignerSpecified";
|
||||
internal const string WorkflowViewNull = "WorkflowViewNull";
|
||||
internal const string Error_AddConnector1 = "Error_AddConnector1";
|
||||
internal const string Error_AddConnector2 = "Error_AddConnector2";
|
||||
internal const string Error_AddConnector3 = "Error_AddConnector3";
|
||||
internal const string Error_ConnectionPoint = "Error_ConnectionPoint";
|
||||
internal const string Error_Connector1 = "Error_Connector1";
|
||||
internal const string Error_Connector2 = "Error_Connector2";
|
||||
internal const string Error_WorkflowNotLoaded = "Error_WorkflowNotLoaded";
|
||||
internal const string Error_InvalidImageResource = "Error_InvalidImageResource";
|
||||
internal const string ThemePropertyReadOnly = "ThemePropertyReadOnly";
|
||||
internal const string Error_TabExistsWithSameId = "Error_TabExistsWithSameId";
|
||||
internal const string Error_WorkflowLayoutNull = "Error_WorkflowLayoutNull";
|
||||
internal const string BuildTargetWorkflow = "BuildTargetWorkflow";
|
||||
|
||||
//Bitmaps
|
||||
internal const string Activity = "Activity";
|
||||
internal const string MoveLeft = "MoveLeft";
|
||||
internal const string MoveLeftUp = "MoveLeftUp";
|
||||
internal const string MoveRight = "MoveRight";
|
||||
internal const string MoveRightUp = "MoveRightUp";
|
||||
internal const string PreviewModeIcon = "PreviewModeIcon";
|
||||
internal const string EditModeIcon = "EditModeIcon";
|
||||
internal const string PreviewIndicator = "PreviewIndicator";
|
||||
internal const string ReadOnly = "ReadOnly";
|
||||
internal const string ConfigError = "ConfigError";
|
||||
internal const string SmartTag = "SmartTag";
|
||||
internal const string ArrowLeft = "ArrowLeft";
|
||||
internal const string DropShapeShort = "DropShapeShort";
|
||||
internal const string FitToWorkflow = "FitToWorkflow";
|
||||
internal const string MoveAnchor = "MoveAnchor";
|
||||
internal const string Activities = "Activities";
|
||||
internal const string Compensation = "Compensation";
|
||||
internal const string SequenceArrow = "SequenceArrow";
|
||||
internal const string Exception = "Exception";
|
||||
internal const string Event = "Event";
|
||||
internal const string Start = "Start";
|
||||
internal const string End = "End";
|
||||
internal const string FitToScreen = "FitToScreen";
|
||||
internal const string Bind = "Bind";
|
||||
|
||||
internal static string GetString(string resID, params object[] args)
|
||||
{
|
||||
return GetString(CultureInfo.CurrentUICulture, resID, args);
|
||||
}
|
||||
|
||||
internal static string GetString(CultureInfo culture, string resID, params object[] args)
|
||||
{
|
||||
string str = DR.resourceManager.GetString(resID, culture);
|
||||
System.Diagnostics.Debug.Assert(str != null, string.Format(culture, "String resource {0} not found.", new object[] { resID }));
|
||||
if (args != null && args.Length > 0)
|
||||
str = string.Format(culture, str, args);
|
||||
return str;
|
||||
}
|
||||
|
||||
internal static Image GetImage(string resID)
|
||||
{
|
||||
Image image = DR.resourceManager.GetObject(resID) as Image;
|
||||
|
||||
//Please note that the default version of make transparent uses the color of pixel at left bottom of the image
|
||||
//as the transparent color to make the bitmap transparent. Hence we do not use it
|
||||
Bitmap bitmap = image as Bitmap;
|
||||
if (bitmap != null)
|
||||
bitmap.MakeTransparent(AmbientTheme.TransparentColor);
|
||||
|
||||
return image;
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
}
|
@@ -0,0 +1,158 @@
|
||||
#pragma warning disable 1634, 1691
|
||||
namespace System.Workflow.ComponentModel.Design
|
||||
{
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Drawing;
|
||||
using System.CodeDom;
|
||||
using System.Diagnostics;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Windows.Forms;
|
||||
using System.ComponentModel;
|
||||
using System.Globalization;
|
||||
using System.Drawing.Design;
|
||||
using System.Drawing.Imaging;
|
||||
using System.Drawing.Drawing2D;
|
||||
using System.Windows.Forms.Design;
|
||||
using System.ComponentModel.Design;
|
||||
using System.Collections.Specialized;
|
||||
using System.ComponentModel.Design.Serialization;
|
||||
using System.Workflow.ComponentModel.Compiler;
|
||||
using System.Workflow.ComponentModel.Serialization;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.Reflection;
|
||||
using System.Workflow.ComponentModel.Design;
|
||||
using System.Runtime.Serialization.Formatters.Binary;
|
||||
|
||||
//
|
||||
|
||||
#region Class DesignerView
|
||||
/// <summary>
|
||||
/// Holds information about the views supported by CompositeActivityDesigner
|
||||
/// </summary>
|
||||
[Obsolete("The System.Workflow.* types are deprecated. Instead, please use the new types from System.Activities.*")]
|
||||
public class DesignerView
|
||||
{
|
||||
private static int MaxViewName = 150;
|
||||
private int viewId;
|
||||
private string text;
|
||||
private Image image;
|
||||
private IDictionary userData;
|
||||
private ActivityDesigner designer;
|
||||
|
||||
/// <summary>
|
||||
/// Constructor for DesignerView
|
||||
/// </summary>
|
||||
/// <param name="id">Identifier which unqiuely identified the view</param>
|
||||
/// <param name="name">Name of the view</param>
|
||||
/// <param name="image">Image associated with the view</param>
|
||||
public DesignerView(int viewId, string text, Image image)
|
||||
{
|
||||
if (text == null)
|
||||
throw new ArgumentNullException("text");
|
||||
if (image == null)
|
||||
throw new ArgumentNullException("image");
|
||||
|
||||
this.viewId = viewId;
|
||||
this.text = ((text.Length > MaxViewName)) ? text.Substring(0, MaxViewName) + "..." : text;
|
||||
this.image = image;
|
||||
}
|
||||
|
||||
public DesignerView(int viewId, string text, Image image, ActivityDesigner associatedDesigner)
|
||||
: this(viewId, text, image)
|
||||
{
|
||||
if (associatedDesigner == null)
|
||||
throw new ArgumentNullException("associatedDesigner");
|
||||
|
||||
this.designer = associatedDesigner;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the identifier associated with view
|
||||
/// </summary>
|
||||
public int ViewId
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.viewId;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the name associated with the view
|
||||
/// </summary>
|
||||
public string Text
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.text;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the image associated with the view
|
||||
/// </summary>
|
||||
public Image Image
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.image;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the userdata to be associated with the view
|
||||
/// </summary>
|
||||
public IDictionary UserData
|
||||
{
|
||||
get
|
||||
{
|
||||
if (this.userData == null)
|
||||
this.userData = new HybridDictionary();
|
||||
return this.userData;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the ActivityDesigner associated with the view
|
||||
/// </summary>
|
||||
public virtual ActivityDesigner AssociatedDesigner
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.designer;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Called when activating the view
|
||||
/// </summary>
|
||||
public virtual void OnActivate()
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Called when deactivating the view
|
||||
/// </summary>
|
||||
public virtual void OnDeactivate()
|
||||
{
|
||||
}
|
||||
|
||||
public override bool Equals(object obj)
|
||||
{
|
||||
DesignerView view = obj as DesignerView;
|
||||
if (view == null)
|
||||
return false;
|
||||
|
||||
return (this.viewId == view.viewId);
|
||||
}
|
||||
|
||||
public override int GetHashCode()
|
||||
{
|
||||
return this.viewId;
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
}
|
@@ -0,0 +1 @@
|
||||
fa029f38319e69f0701038963dcd78cbc1531381
|
@@ -0,0 +1,200 @@
|
||||
|
||||
namespace System.Workflow.ComponentModel.Design
|
||||
{
|
||||
partial class ActivityBindForm
|
||||
{
|
||||
/// <summary>
|
||||
/// Required designer variable.
|
||||
/// </summary>
|
||||
private System.ComponentModel.IContainer components = null;
|
||||
|
||||
/// <summary>
|
||||
/// Clean up any resources being used.
|
||||
/// </summary>
|
||||
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
if (disposing && (components != null))
|
||||
{
|
||||
components.Dispose();
|
||||
}
|
||||
base.Dispose(disposing);
|
||||
}
|
||||
|
||||
#region Windows Form Designer generated code
|
||||
|
||||
/// <summary>
|
||||
/// Required method for Designer support - do not modify
|
||||
/// the contents of this method with the code editor.
|
||||
/// </summary>
|
||||
private void InitializeComponent()
|
||||
{
|
||||
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(ActivityBindForm));
|
||||
this.dummyPanel = new System.Windows.Forms.Panel();
|
||||
this.cancelButton = new System.Windows.Forms.Button();
|
||||
this.OKButton = new System.Windows.Forms.Button();
|
||||
this.buttonTableLayoutPanel = new System.Windows.Forms.TableLayoutPanel();
|
||||
this.helpTextBox = new System.Windows.Forms.TextBox();
|
||||
this.createField = new System.Windows.Forms.RadioButton();
|
||||
this.createProperty = new System.Windows.Forms.RadioButton();
|
||||
this.groupBox1 = new System.Windows.Forms.GroupBox();
|
||||
this.bindTabControl = new System.Windows.Forms.TabControl();
|
||||
this.existingMemberPage = new System.Windows.Forms.TabPage();
|
||||
this.newMemberPage = new System.Windows.Forms.TabPage();
|
||||
this.newMemberHelpTextBox = new System.Windows.Forms.TextBox();
|
||||
this.memberNameLabel = new System.Windows.Forms.Label();
|
||||
this.memberNameTextBox = new System.Windows.Forms.TextBox();
|
||||
this.buttonTableLayoutPanel.SuspendLayout();
|
||||
this.groupBox1.SuspendLayout();
|
||||
this.bindTabControl.SuspendLayout();
|
||||
this.existingMemberPage.SuspendLayout();
|
||||
this.newMemberPage.SuspendLayout();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// dummyPanel
|
||||
//
|
||||
resources.ApplyResources(this.dummyPanel, "dummyPanel");
|
||||
this.dummyPanel.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
|
||||
this.dummyPanel.Name = "dummyPanel";
|
||||
//
|
||||
// cancelButton
|
||||
//
|
||||
this.cancelButton.DialogResult = System.Windows.Forms.DialogResult.Cancel;
|
||||
resources.ApplyResources(this.cancelButton, "cancelButton");
|
||||
this.cancelButton.Name = "cancelButton";
|
||||
this.cancelButton.UseVisualStyleBackColor = true;
|
||||
this.cancelButton.Click += new System.EventHandler(this.cancelButton_Click);
|
||||
//
|
||||
// OKButton
|
||||
//
|
||||
resources.ApplyResources(this.OKButton, "OKButton");
|
||||
this.OKButton.Name = "OKButton";
|
||||
this.OKButton.UseVisualStyleBackColor = true;
|
||||
this.OKButton.Click += new System.EventHandler(this.OKButton_Click);
|
||||
//
|
||||
// buttonTableLayoutPanel
|
||||
//
|
||||
resources.ApplyResources(this.buttonTableLayoutPanel, "buttonTableLayoutPanel");
|
||||
this.buttonTableLayoutPanel.Controls.Add(this.OKButton, 0, 0);
|
||||
this.buttonTableLayoutPanel.Controls.Add(this.cancelButton, 1, 0);
|
||||
this.buttonTableLayoutPanel.Name = "buttonTableLayoutPanel";
|
||||
//
|
||||
// helpTextBox
|
||||
//
|
||||
resources.ApplyResources(this.helpTextBox, "helpTextBox");
|
||||
this.helpTextBox.Name = "helpTextBox";
|
||||
this.helpTextBox.ReadOnly = true;
|
||||
//
|
||||
// createField
|
||||
//
|
||||
resources.ApplyResources(this.createField, "createField");
|
||||
this.createField.Checked = true;
|
||||
this.createField.Name = "createField";
|
||||
this.createField.TabStop = true;
|
||||
this.createField.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// createProperty
|
||||
//
|
||||
resources.ApplyResources(this.createProperty, "createProperty");
|
||||
this.createProperty.Name = "createProperty";
|
||||
this.createProperty.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// groupBox1
|
||||
//
|
||||
resources.ApplyResources(this.groupBox1, "groupBox1");
|
||||
this.groupBox1.Controls.Add(this.createField);
|
||||
this.groupBox1.Controls.Add(this.createProperty);
|
||||
this.groupBox1.Name = "groupBox1";
|
||||
this.groupBox1.TabStop = false;
|
||||
//
|
||||
// bindTabControl
|
||||
//
|
||||
resources.ApplyResources(this.bindTabControl, "bindTabControl");
|
||||
this.bindTabControl.Controls.Add(this.existingMemberPage);
|
||||
this.bindTabControl.Controls.Add(this.newMemberPage);
|
||||
this.bindTabControl.Name = "bindTabControl";
|
||||
this.bindTabControl.SelectedIndex = 0;
|
||||
//
|
||||
// existingMemberPage
|
||||
//
|
||||
this.existingMemberPage.Controls.Add(this.dummyPanel);
|
||||
this.existingMemberPage.Controls.Add(this.helpTextBox);
|
||||
resources.ApplyResources(this.existingMemberPage, "existingMemberPage");
|
||||
this.existingMemberPage.Name = "existingMemberPage";
|
||||
this.existingMemberPage.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// newMemberPage
|
||||
//
|
||||
this.newMemberPage.Controls.Add(this.memberNameLabel);
|
||||
this.newMemberPage.Controls.Add(this.memberNameTextBox);
|
||||
this.newMemberPage.Controls.Add(this.groupBox1);
|
||||
this.newMemberPage.Controls.Add(this.newMemberHelpTextBox);
|
||||
resources.ApplyResources(this.newMemberPage, "newMemberPage");
|
||||
this.newMemberPage.Name = "newMemberPage";
|
||||
this.newMemberPage.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// newMemberHelpTextBox
|
||||
//
|
||||
resources.ApplyResources(this.newMemberHelpTextBox, "newMemberHelpTextBox");
|
||||
this.newMemberHelpTextBox.Name = "newMemberHelpTextBox";
|
||||
this.newMemberHelpTextBox.ReadOnly = true;
|
||||
//
|
||||
// memberNameLabel
|
||||
//
|
||||
resources.ApplyResources(this.memberNameLabel, "memberNameLabel");
|
||||
this.memberNameLabel.Name = "memberNameLabel";
|
||||
//
|
||||
// memberNameTextBox
|
||||
//
|
||||
resources.ApplyResources(this.memberNameTextBox, "memberNameTextBox");
|
||||
this.memberNameTextBox.Name = "memberNameTextBox";
|
||||
//
|
||||
// ActivityBindForm
|
||||
//
|
||||
this.AcceptButton = this.OKButton;
|
||||
resources.ApplyResources(this, "$this");
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.CancelButton = this.cancelButton;
|
||||
this.Controls.Add(this.bindTabControl);
|
||||
this.Controls.Add(this.buttonTableLayoutPanel);
|
||||
this.HelpButton = true;
|
||||
this.MaximizeBox = false;
|
||||
this.MinimizeBox = false;
|
||||
this.Name = "ActivityBindForm";
|
||||
this.ShowIcon = false;
|
||||
this.ShowInTaskbar = false;
|
||||
this.SizeGripStyle = System.Windows.Forms.SizeGripStyle.Show;
|
||||
this.HelpButtonClicked += new System.ComponentModel.CancelEventHandler(this.ActivityBindForm_HelpButtonClicked);
|
||||
this.Load += new System.EventHandler(this.ActivityBindForm_Load);
|
||||
this.buttonTableLayoutPanel.ResumeLayout(false);
|
||||
this.groupBox1.ResumeLayout(false);
|
||||
this.groupBox1.PerformLayout();
|
||||
this.bindTabControl.ResumeLayout(false);
|
||||
this.existingMemberPage.ResumeLayout(false);
|
||||
this.existingMemberPage.PerformLayout();
|
||||
this.newMemberPage.ResumeLayout(false);
|
||||
this.newMemberPage.PerformLayout();
|
||||
this.ResumeLayout(false);
|
||||
this.PerformLayout();
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private System.Windows.Forms.Panel dummyPanel;
|
||||
private System.Windows.Forms.Button cancelButton;
|
||||
private System.Windows.Forms.Button OKButton;
|
||||
private System.Windows.Forms.TableLayoutPanel buttonTableLayoutPanel;
|
||||
private System.Windows.Forms.TextBox helpTextBox;
|
||||
private System.Windows.Forms.RadioButton createProperty;
|
||||
private System.Windows.Forms.RadioButton createField;
|
||||
private System.Windows.Forms.GroupBox groupBox1;
|
||||
private System.Windows.Forms.TabControl bindTabControl;
|
||||
private System.Windows.Forms.TabPage existingMemberPage;
|
||||
private System.Windows.Forms.TabPage newMemberPage;
|
||||
private System.Windows.Forms.TextBox newMemberHelpTextBox;
|
||||
private System.Windows.Forms.Label memberNameLabel;
|
||||
private System.Windows.Forms.TextBox memberNameTextBox;
|
||||
}
|
||||
}
|
||||
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user