public DotNetMethodRegion(IPluginServiceModel model, ModelItem modelItem, ISourceToolRegion <IPluginSource> source, INamespaceToolRegion <INamespaceItem> namespaceItem) : this(CustomContainer.Get <IShellViewModel>(), new ActionInputDatatalistMapper()) { try { Errors = new List <string>(); LabelWidth = 70; ToolRegionName = "DotNetMethodRegion"; _modelItem = modelItem; _model = model; _source = source; _namespace = namespaceItem; _namespace.SomethingChanged += SourceOnSomethingChanged; Dependants = new List <IToolRegion>(); IsRefreshing = false; if (_source.SelectedSource != null) { MethodsToRun = model.GetActionsWithReturns(_source.SelectedSource, _namespace.SelectedNamespace); } if (Method != null && MethodsToRun != null) { SelectedMethod = Method; } RefreshMethodsCommand = new Microsoft.Practices.Prism.Commands.DelegateCommand(() => { IsRefreshing = true; if (_source.SelectedSource != null) { MethodsToRun = model.GetActionsWithReturns(_source.SelectedSource, _namespace.SelectedNamespace); } IsRefreshing = false; }, CanRefresh); IsMethodExpanded = false; IsEnabled = true; _modelItem = modelItem; } catch (Exception e) { Errors.Add(e.Message); } }
public DotNetConstructorRegion(IPluginServiceModel model, ModelItem modelItem, ISourceToolRegion <IPluginSource> source, INamespaceToolRegion <INamespaceItem> namespaceItem) { try { Errors = new List <string>(); LabelWidth = 70; ToolRegionName = "DotNetConstructorRegion"; _modelItem = modelItem; _model = model; _source = source; _namespace = namespaceItem; _namespace.SomethingChanged += SourceOnSomethingChanged; Dependants = new List <IToolRegion>(); IsRefreshing = false; if (_source.SelectedSource != null) { Constructors = model.GetConstructors(_source.SelectedSource, _namespace.SelectedNamespace); } if (Method != null && Constructors != null) { SelectedConstructor = Constructors.FirstOrDefault(constructor => constructor.ConstructorName == Method.ConstructorName); } RefreshConstructorsCommand = new Microsoft.Practices.Prism.Commands.DelegateCommand(() => { IsRefreshing = true; if (_source.SelectedSource != null) { Constructors = model.GetConstructors(_source.SelectedSource, _namespace.SelectedNamespace); } IsRefreshing = false; }, CanRefresh); IsConstructorExpanded = false; IsEnabled = true; _modelItem = modelItem; } catch (Exception e) { Errors.Add(e.Message); } }
public ComActionRegion(IComPluginServiceModel model, ModelItem modelItem, ISourceToolRegion <IComPluginSource> source, INamespaceToolRegion <INamespaceItem> namespaceItem) { try { Errors = new List <string>(); LabelWidth = 70; ToolRegionName = "ComActionRegion"; _modelItem = modelItem; _model = model; _source = source; _namespace = namespaceItem; _namespace.SomethingChanged += SourceOnSomethingChanged; Dependants = new List <IToolRegion>(); IsRefreshing = false; if (_source.SelectedSource != null) { Actions = model.GetActions(_source.SelectedSource, _namespace.SelectedNamespace); } if (Method != null && Actions != null) { IsActionEnabled = true; SelectedAction = Actions.FirstOrDefault(action => action.Method == Method.Method); } RefreshActionsCommand = new Microsoft.Practices.Prism.Commands.DelegateCommand(() => { IsRefreshing = true; if (_source.SelectedSource != null) { Actions = model.GetActions(_source.SelectedSource, _namespace.SelectedNamespace); } IsRefreshing = false; }, CanRefresh); IsEnabled = true; _modelItem = modelItem; } catch (Exception e) { Errors.Add(e.Message); } }