public ComSourceRegion(IComPluginServiceModel model, ModelItem modelItem)
        {
            LabelWidth     = 70;
            ToolRegionName = "ComSourceRegion";
            SetInitialValues();
            Dependants        = new List <IToolRegion>();
            NewSourceCommand  = new DelegateCommand(model.CreateNewSource);
            EditSourceCommand = new DelegateCommand(() => model.EditSource(SelectedSource), CanEditSource);
            var sources = model.RetrieveSources().OrderBy(source => source.ResourceName);

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

            SourcesTooltip    = Warewolf.Studio.Resources.Languages.Tooltips.ComManagePluginServiceSourcesTooltip;
            EditSourceTooltip = Warewolf.Studio.Resources.Languages.Tooltips.ComManagePluginServiceEditSourceTooltip;
            NewSourceTooltip  = Warewolf.Studio.Resources.Languages.Tooltips.ComManagePluginServiceNewSourceTooltip;

            if (SourceId != Guid.Empty)
            {
                SelectedSource = Sources.FirstOrDefault(source => source.Id == SourceId);
            }
        }
示例#2
0
 public ManageComPluginServiceInputViewModel(IComViewModel model, IComPluginServiceModel 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;
 }
示例#3
0
        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);
            }
        }
示例#4
0
        public ComNamespaceRegion(IComPluginServiceModel model, ModelItem modelItem, ISourceToolRegion <IComPluginSource> source)
        {
            try
            {
                Errors = new List <string>();

                LabelWidth                = 70;
                ToolRegionName            = "ComNamespaceRegion";
                _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 = model.GetNameSpaces(_source.SelectedSource);
                    }
                    IsRefreshing = false;
                }, CanRefresh);

                IsEnabled  = true;
                _modelItem = modelItem;
            }
            catch (Exception e)
            {
                Errors.Add(e.Message);
            }
        }
示例#5
0
 public ComDllViewModel(ModelItem modelItem, IComPluginServiceModel model)
     : base(modelItem)
 {
     Model = model;
     SetupCommonProperties();
 }