Esempio n. 1
0
 public SqlServerDatabaseDesignerViewModel(ModelItem modelItem, IDbServiceModel model, IAsyncWorker worker)
     : base(modelItem)
 {
     Model   = model;
     _worker = worker;
     SetupCommonProperties();
 }
Esempio n. 2
0
        public DatabaseSourceRegion(IDbServiceModel model, ModelItem modelItem, enSourceType type)
        {
            LabelWidth        = 46;
            ToolRegionName    = "DatabaseSourceRegion";
            Dependants        = new List <IToolRegion>();
            NewSourceCommand  = new Microsoft.Practices.Prism.Commands.DelegateCommand(() => model.CreateNewSource(type));
            EditSourceCommand = new Microsoft.Practices.Prism.Commands.DelegateCommand(() => model.EditSource(SelectedSource, type), CanEditSource);
            var sources = model.RetrieveSources().OrderBy(source => source.Name);

            Sources            = sources.Where(source => source != null && source.Type == type).ToObservableCollection();
            IsEnabled          = true;
            _modelItem         = modelItem;
            SourceId           = modelItem.GetProperty <Guid>("SourceId");
            SourcesHelpText    = Warewolf.Studio.Resources.Languages.HelpText.DatabaseServiceSourceTypesHelp;
            EditSourceHelpText = Warewolf.Studio.Resources.Languages.HelpText.DatabaseServiceEditSourceHelp;
            NewSourceHelpText  = Warewolf.Studio.Resources.Languages.HelpText.DatabaseServiceNewSourceHelp;

            SourcesTooltip    = Warewolf.Studio.Resources.Languages.Tooltips.ManageDbServiceSourcesTooltip;
            EditSourceTooltip = Warewolf.Studio.Resources.Languages.Tooltips.ManageDbServiceEditSourceTooltip;
            NewSourceTooltip  = Warewolf.Studio.Resources.Languages.Tooltips.ManageDbServiceNewSourceTooltip;

            if (SourceId != Guid.Empty)
            {
                SelectedSource = Sources.FirstOrDefault(source => source.Id == SourceId);
            }
        }
        public DbActionRegion(IDbServiceModel model, ModelItem modelItem, ISourceToolRegion <IDbSource> source, IAsyncWorker worker)
        {
            try
            {
                Errors = new List <string>();

                LabelWidth                = 46;
                ToolRegionName            = "DbActionRegion";
                _modelItem                = modelItem;
                _model                    = model;
                _source                   = source;
                _worker                   = worker;
                _source.SomethingChanged += SourceOnSomethingChanged;
                Dependants                = new List <IToolRegion>();
                if (_source.SelectedSource != null)
                {
                    LoadActions(model);
                }

                RefreshActionsCommand = new DelegateCommand(o =>
                {
                    if (_source.SelectedSource != null)
                    {
                        _source.SelectedSource.ReloadActions = true;
                        LoadActions(model);
                    }
                }, o => CanRefresh());

                _modelItem = modelItem;
            }
            catch (Exception e)
            {
                Errors.Add(e.Message);
            }
        }
Esempio n. 4
0
 public MySqlDatabaseDesignerViewModel(ModelItem modelItem, IDbServiceModel model, IAsyncWorker worker, IViewPropertyBuilder propertyBuilder)
     : base(modelItem)
 {
     Model            = model;
     _worker          = worker;
     _propertyBuilder = propertyBuilder;
     SetupCommonProperties();
 }
 public ManageDatabaseServiceInputViewModel(IDatabaseServiceViewModel model, IDbServiceModel serviceModel)
 {
     IsTesting           = false;
     CloseCommand        = new DelegateCommand(ExecuteClose);
     OkCommand           = new DelegateCommand(ExecuteOk);
     TestCommand         = new DelegateCommand(TryExecuteTest);
     _generateOutputArea = new GenerateOutputsRegion();
     _generateInputArea  = new GenerateInputsRegion();
     Errors       = new List <string>();
     _viewmodel   = model;
     _serverModel = serviceModel;
 }
Esempio n. 6
0
        public DbActionRegionOdbc(IDbServiceModel model, ModelItem modelItem, ISourceToolRegion <IDbSource> source)
        {
            Errors = new List <string>();

            LabelWidth                = 46;
            ToolRegionName            = "DbActionRegionODBC";
            _modelItem                = modelItem;
            _model                    = model;
            _source                   = source;
            _source.SomethingChanged += SourceOnSomethingChanged;
            Dependants                = new List <IToolRegion>();

            IsEnabled       = true;
            _modelItem      = modelItem;
            CommandText     = _modelItem.GetProperty <string>("CommandText") ?? "";
            IsActionEnabled = _source?.SelectedSource != null;
        }
 private void LoadActions(IDbServiceModel model)
 {
     IsRefreshing    = true;
     SelectedAction  = null;
     IsActionEnabled = false;
     IsEnabled       = false;
     _worker.Start(() => model.GetActions(_source.SelectedSource), delegate(ICollection <IDbAction> actions)
     {
         Actions         = actions;
         IsRefreshing    = false;
         IsActionEnabled = true;
         IsEnabled       = true;
         if (!string.IsNullOrEmpty(ProcedureName))
         {
             SelectedAction = Actions.FirstOrDefault(action => action.Name == ProcedureName);
         }
     });
 }
Esempio n. 8
0
 public InputViewForTest(IDatabaseServiceViewModel model, IDbServiceModel serviceModel)
     : base(model, serviceModel)
 {
 }
Esempio n. 9
0
 public ODBCDatabaseDesignerViewModel(ModelItem modelItem, IDbServiceModel model)
     : base(modelItem)
 {
     Model = model;
     SetupCommonProperties();
 }