Ejemplo n.º 1
0
 void UpdateBasedOnNamespace()
 {
     if (_source?.SelectedSource != null)
     {
         MethodsToRun   = _model.GetActionsWithReturns(_source.SelectedSource, _namespace.SelectedNamespace);
         SelectedMethod = null;
         IsEnabled      = true;
     }
 }
Ejemplo n.º 2
0
        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);
            }
        }