internal static void RegisterExpressionActivityService(string name, Type expressionEditorType, CreateExpressionFromStringCallback convertFromString)
        {
            if (!typeof(ExpressionActivityEditor).IsAssignableFrom(expressionEditorType))
            {
                throw FxTrace.Exception.AsError(new ArgumentException(string.Format(CultureInfo.CurrentUICulture, SR.InvalidExpressionEditorType,
                                                                                    expressionEditorType.FullName, typeof(ExpressionActivityEditor).FullName)));
            }
            if (expressionEditorType.GetConstructor(System.Type.EmptyTypes) == null)
            {
                throw FxTrace.Exception.AsError(new ArgumentException(string.Format(CultureInfo.CurrentUICulture, SR.ExpressionActivityEditorRequiresDefaultConstructor,
                                                                                    expressionEditorType.FullName)));
            }
            if (!ExpressionEditorTypeTable.Keys.Contains(name))
            {
                ExpressionEditorTypeTable.Add(name, expressionEditorType);
            }
            else
            {
                ExpressionEditorTypeTable[name] = expressionEditorType;
            }

            if (convertFromString != null)
            {
                if (!ConvertFromStringDelegates.Keys.Contains(name))
                {
                    ConvertFromStringDelegates.Add(name, convertFromString);
                }
                else
                {
                    ConvertFromStringDelegates[name] = convertFromString;
                }
            }
        }
        internal static void RegisterExpressionActivityService(string name, Type expressionEditorType, CreateExpressionFromStringCallback convertFromString)
        {
            if (!typeof(ExpressionActivityEditor).IsAssignableFrom(expressionEditorType))
            {
                throw FxTrace.Exception.AsError(new ArgumentException(string.Format(CultureInfo.CurrentUICulture, SR.InvalidExpressionEditorType,
                    expressionEditorType.FullName, typeof(ExpressionActivityEditor).FullName)));
            }
            if (expressionEditorType.GetConstructor(System.Type.EmptyTypes) == null)
            {
                throw FxTrace.Exception.AsError(new ArgumentException(string.Format(CultureInfo.CurrentUICulture, SR.ExpressionActivityEditorRequiresDefaultConstructor,
                    expressionEditorType.FullName)));
            }
            if (!ExpressionEditorTypeTable.Keys.Contains(name))
            {
                ExpressionEditorTypeTable.Add(name, expressionEditorType);
            }
            else
            {
                ExpressionEditorTypeTable[name] = expressionEditorType;
            }

            if (convertFromString != null)
            {
                if (!ConvertFromStringDelegates.Keys.Contains(name))
                {
                    ConvertFromStringDelegates.Add(name, convertFromString);
                }
                else
                {
                    ConvertFromStringDelegates[name] = convertFromString;
                }
            }
        }
 public static void RegisterExpressionActivityEditor(string name, Type expressionActivityEditorType, CreateExpressionFromStringCallback convertFromString)
 {
     if (string.IsNullOrWhiteSpace(name))
     {
         throw FxTrace.Exception.AsError(new ArgumentException(string.Format(CultureInfo.CurrentUICulture, SR.InvalidExpressionEditorName,
             name)));
     }
     ExpressionTextBoxViewModel.RegisterExpressionActivityService(name, expressionActivityEditorType, convertFromString);
 }
 public static void RegisterExpressionActivityEditor(string name, Type expressionActivityEditorType, CreateExpressionFromStringCallback convertFromString)
 {
     if (string.IsNullOrWhiteSpace(name))
     {
         throw FxTrace.Exception.AsError(new ArgumentException(string.Format(CultureInfo.CurrentUICulture, SR.InvalidExpressionEditorName,
                                                                             name)));
     }
     ExpressionTextBoxViewModel.RegisterExpressionActivityService(name, expressionActivityEditorType, convertFromString);
 }