Esempio n. 1
0
        public DotNetSourceRegion(IPluginServiceModel model, ModelItem modelItem)
        {
            LabelWidth     = 74;
            ToolRegionName = "DotNetSourceRegion";
            SetInitialValues();
            Dependants        = new List <IToolRegion>();
            NewSourceCommand  = new DelegateCommand(model.CreateNewSource);
            EditSourceCommand = new DelegateCommand(() => model.EditSource(SelectedSource), CanEditSource);
            var sources = model.RetrieveSources().OrderBy(source => source.Name);

            Sources            = sources.ToObservableCollection();
            IsEnabled          = true;
            _modelItem         = modelItem;
            SourceId           = modelItem.GetProperty <Guid>("SourceId");
            SourcesHelpText    = Warewolf.Studio.Resources.Languages.HelpText.PluginServiceSourcesHelp;
            EditSourceHelpText = Warewolf.Studio.Resources.Languages.HelpText.PluginServiceEditSourceHelp;
            NewSourceHelpText  = Warewolf.Studio.Resources.Languages.HelpText.PluginServiceNewSourceHelp;

            SourcesTooltip    = Warewolf.Studio.Resources.Languages.Tooltips.ManagePluginServiceSourcesTooltip;
            EditSourceTooltip = Warewolf.Studio.Resources.Languages.Tooltips.ManagePluginServiceEditSourceTooltip;
            NewSourceTooltip  = Warewolf.Studio.Resources.Languages.Tooltips.ManagePluginServiceNewSourceTooltip;

            if (SourceId != Guid.Empty)
            {
                SelectedSource = Sources.FirstOrDefault(source => source.Id == SourceId);
            }
        }
Esempio n. 2
0
 public ManagePluginServiceInputViewModel(IDotNetViewModel model, IPluginServiceModel serviceModel)
 {
     PasteResponseAvailable = false;
     PasteResponseVisible   = false;
     IsTesting           = false;
     CloseCommand        = new DelegateCommand(ExecuteClose);
     OkCommand           = new DelegateCommand(ExecuteOk);
     TestCommand         = new DelegateCommand(ExecuteTest);
     _generateOutputArea = new GenerateOutputsRegion();
     _generateInputArea  = new GenerateInputsRegion();
     Errors       = new List <string>();
     _viewmodel   = model;
     _serverModel = serviceModel;
 }
Esempio n. 3
0
        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);
            }
        }
Esempio n. 4
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);
            }
        }
Esempio n. 5
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);
            }
        }
 public DotNetDllEnhancedViewModel(ModelItem modelItem, IPluginServiceModel model)
     : base(modelItem)
 {
     Model = model;
     SetupCommonProperties();
 }