Exemple #1
0
 void UpdateBasedOnSource()
 {
     if (_source?.SelectedSource != null)
     {
         if (_modelItem.ItemType == typeof(DsfEnhancedDotNetDllActivity))
         {
             Namespaces         = _model.GetNameSpacesWithJsonRetunrs(_source.SelectedSource);
             IsNamespaceEnabled = true;
             IsEnabled          = true;
         }
         else
         {
             Namespaces         = _model.GetNameSpaces(_source.SelectedSource);
             IsNamespaceEnabled = true;
             IsEnabled          = true;
         }
     }
 }
Exemple #2
0
        public DotNetNamespaceRegion(IPluginServiceModel model, ModelItem modelItem, ISourceToolRegion <IPluginSource> source)
        {
            try
            {
                Errors                    = new List <string>();
                LabelWidth                = 74;
                ToolRegionName            = "DotNetNamespaceRegion";
                _modelItem                = modelItem;
                _model                    = model;
                _source                   = source;
                _source.SomethingChanged += SourceOnSomethingChanged;
                Dependants                = new List <IToolRegion>();
                IsRefreshing              = false;
                UpdateBasedOnSource();
                if (Namespace != null)
                {
                    SelectedNamespace = Namespaces.FirstOrDefault(item => item.FullName == Namespace.FullName);
                }
                RefreshNamespaceCommand = new Microsoft.Practices.Prism.Commands.DelegateCommand(() =>
                {
                    IsRefreshing = true;
                    if (_source.SelectedSource != null)
                    {
                        Namespaces = _modelItem.ItemType == typeof(DsfEnhancedDotNetDllActivity) ? _model.GetNameSpacesWithJsonRetunrs(_source.SelectedSource) : _model.GetNameSpaces(_source.SelectedSource);
                    }

                    IsRefreshing = false;
                }, CanRefresh);

                IsEnabled  = true;
                _modelItem = modelItem;
            }
            catch (Exception e)
            {
                Errors.Add(e.Message);
            }
        }