public override void ShowDialog(PropertyValue propertyValue, IInputElement commandSource)
        {
            ModelPropertyEntryToOwnerActivityConverter propertyEntryConverter =
                new ModelPropertyEntryToOwnerActivityConverter();

            ModelItem activityModelItem =
                (ModelItem)propertyEntryConverter.Convert(propertyValue.ParentProperty, typeof(ModelItem), false, null);

            ModelItem parentModelItem =
                (ModelItem)propertyEntryConverter.Convert(propertyValue.ParentProperty, typeof(ModelItem), true, null);

            EditingContext context = ((IModelTreeItem)activityModelItem).ModelTreeManager.Context;

            var inputData = parentModelItem.Properties[propertyValue.ParentProperty.PropertyName].Collection;

            DynamicArgumentDesignerOptions options = new DynamicArgumentDesignerOptions
            {
                Title = propertyValue.ParentProperty.DisplayName,
            };

            using (EditingScope scope = context.Services.GetRequiredService <ModelTreeManager>().CreateEditingScope(StringResourceDictionary.Instance.GetString("InvokeMethodParameterEditing"), true))
            {
                if (DynamicArgumentDialog.ShowDialog(activityModelItem, inputData, context, activityModelItem.View, options))
                {
                    scope.Complete();
                }
            }
        }
        public override void ShowDialog(PropertyValue propertyValue, IInputElement commandSource)
        {
            ModelPropertyEntryToOwnerActivityConverter propertyEntryConverter =
                new ModelPropertyEntryToOwnerActivityConverter();

            ModelItem activityModelItem =
                (ModelItem)propertyEntryConverter.Convert(propertyValue.ParentProperty, typeof(ModelItem), false, null);

            ModelItem parentModelItem =
                (ModelItem)propertyEntryConverter.Convert(propertyValue.ParentProperty, typeof(ModelItem), true, null);

            EditingContext context = ((IModelTreeItem)activityModelItem).ModelTreeManager.Context;

            var inputData = parentModelItem.Properties[propertyValue.ParentProperty.PropertyName].Collection;            

            DynamicArgumentDesignerOptions options = new DynamicArgumentDesignerOptions
            { 
                Title = propertyValue.ParentProperty.DisplayName, 
            };

            using (EditingScope scope = context.Services.GetRequiredService<ModelTreeManager>().CreateEditingScope(StringResourceDictionary.Instance.GetString("InvokeMethodParameterEditing"), true))
            {
                if (DynamicArgumentDialog.ShowDialog(activityModelItem, inputData, context, activityModelItem.View, options))
                {
                    scope.Complete();
                }
            }
        }
        public override void ShowDialog(PropertyValue propertyValue, IInputElement commandSource)
        {
            ModelPropertyEntryToOwnerActivityConverter ownerActivityConverter = new ModelPropertyEntryToOwnerActivityConverter();
            ModelItem activityItem =
                ownerActivityConverter.Convert(propertyValue.ParentProperty, typeof(ModelItem), false, null) as ModelItem;
            EditingContext context = activityItem.GetEditingContext();

            ModelItem parentModelItem =
                ownerActivityConverter.Convert(propertyValue.ParentProperty, typeof(ModelItem), true, null) as ModelItem;
            ModelItemDictionary arguments = parentModelItem.Properties[propertyValue.ParentProperty.PropertyName].Dictionary;

            DynamicArgumentDesignerOptions options = new DynamicArgumentDesignerOptions
            {
                Title = propertyValue.ParentProperty.DisplayName
            };

            using (ModelEditingScope change = arguments.BeginEdit("PowerShellParameterEditing"))
            {
                if (DynamicArgumentDialog.ShowDialog(activityItem, arguments, context, activityItem.View, options))
                {
                    change.Complete();
                }
                else
                {
                    change.Revert();
                }
            }
        }
        public override void ShowDialog(PropertyValue propertyValue, Windows.IInputElement commandSource)
        {
            ModelPropertyEntryToOwnerActivityConverter propertyEntryConverter = new ModelPropertyEntryToOwnerActivityConverter();
            ModelItem parentModelItem = (ModelItem)propertyEntryConverter.Convert(propertyValue.ParentProperty, typeof(ModelItem), true, null);
            EditingContext context = ((IModelTreeItem)parentModelItem).ModelTreeManager.Context;
            ModelItemDictionary inputData = parentModelItem.Properties[propertyValue.ParentProperty.PropertyName].Dictionary;
            DynamicArgumentDesignerOptions options = new DynamicArgumentDesignerOptions();
            options.Title = propertyValue.ParentProperty.DisplayName;

            DynamicArgumentDialog.ShowDialog(parentModelItem, inputData, context, parentModelItem.View, options);
        }
 DynamicArgumentDialog(ModelItem activity, ModelItem data, EditingContext context, DependencyObject owner, DynamicArgumentDesignerOptions options)
 {
     this.MinHeight = 200;
     this.MinWidth = 700;
     this.WindowSizeToContent = SizeToContent.Manual;
     this.ModelItem = activity;
     this.Context = context;
     this.HelpKeyword = HelpKeywords.DynamicArgumentDialog;
     this.Owner = owner;
     this.Title = options.Title;
     this.data = data;
     this.Content = new DynamicArgumentDesigner()
     {
         DynamicArguments = DynamicArgumentDesigner.ModelItemToWrapperCollection(data, out isDictionary, out underlyingArgumentType),
         IsDictionary = isDictionary,
         UnderlyingArgumentType = underlyingArgumentType,
         Context = context,
         OwnerActivity = activity,
         HideDirection = options.HideDirection,
         ArgumentPrefix = options.ArgumentPrefix,
         HintText = options.HintText,
         ParentDialog = this,
     };
 }
 public static bool ShowDialog(ModelItem activity, ModelItem data, EditingContext context, DependencyObject owner, DynamicArgumentDesignerOptions options)
 {
     return new DynamicArgumentDialog(activity, data, context, owner, options).ShowOkCancel();
 }
Exemple #7
0
 public static bool ShowDialog(ModelItem activity, ModelItem data, EditingContext context, DependencyObject owner, DynamicArgumentDesignerOptions options)
 {
     return(new DynamicArgumentDialog(activity, data, context, owner, options).ShowOkCancel());
 }
Exemple #8
0
 DynamicArgumentDialog(ModelItem activity, ModelItem data, EditingContext context, DependencyObject owner, DynamicArgumentDesignerOptions options)
 {
     this.MinHeight           = 200;
     this.MinWidth            = 700;
     this.WindowSizeToContent = SizeToContent.Manual;
     this.ModelItem           = activity;
     this.Context             = context;
     this.HelpKeyword         = HelpKeywords.DynamicArgumentDialog;
     this.Owner   = owner;
     this.Title   = options.Title;
     this.data    = data;
     this.Content = new DynamicArgumentDesigner()
     {
         DynamicArguments       = DynamicArgumentDesigner.ModelItemToWrapperCollection(data, out isDictionary, out underlyingArgumentType),
         IsDictionary           = isDictionary,
         UnderlyingArgumentType = underlyingArgumentType,
         Context        = context,
         OwnerActivity  = activity,
         HideDirection  = options.HideDirection,
         ArgumentPrefix = options.ArgumentPrefix,
         HintText       = options.HintText,
         ParentDialog   = this,
     };
 }