Ejemplo n.º 1
0
        private IList<FunctionalViewModel> CreateViewModels(Configuration configuration)
        {
            if (configuration.ModifyMode)
            {

                var list = new List<FunctionalViewModel>(3)
                {
                    new SelectRegionViewModel(configuration),
                    new ModifyRegionViewModel(configuration)
                };
                if (!configuration.UseConfigFile)
                {
                    list.Insert(0, new SelectFolderViewModel(configuration));
                }
                else
                {
                    list[0].Reconfigure(configuration);
                }
                return list;
            }
            else
            {
                return new List<FunctionalViewModel>(6)
                {
                    new ScreensaverViewModel(configuration),
                    new SelectRegionViewModel(configuration),
                    new PaintViewModel(configuration),
                    new ResultViewModel(configuration),
                    new SendEmailViewModel(configuration),
                    new SendCompleteViewModel(configuration)
                };
            }
        }
Ejemplo n.º 2
0
 protected FunctionalViewModel(Configuration configuration)
 {
     Configuration = configuration;
     BackCommand = new DelegateCommand(Back);
     NextCommand = new DelegateCommand(Next, CanExecuteNextCommand);
     HomeCommand = new DelegateCommand<bool?>(Home);
     ActionCommand = new DelegateCommand<EventInformation<RoutedEventArgs>>(Action);
     ActionHappened += OnActionHappened;
 }
Ejemplo n.º 3
0
 private bool IsConfigurationExpected(Configuration configuration, int brushesCount, int regionsCount)
 {
     var defaultConfiguration = Configuration.DefaultConfiguration;
     return configuration.Colors.Count == brushesCount &&
            configuration.Storage.Regions.Count == regionsCount &&
            configuration.HorizontalItemsCount == defaultConfiguration.HorizontalItemsCount &&
            configuration.VerticalItemsCount == defaultConfiguration.VerticalItemsCount &&
            configuration.WaitAnswerInterval == defaultConfiguration.WaitAnswerInterval &&
            configuration.WaitUserActionInterval == defaultConfiguration.WaitUserActionInterval &&
            configuration.WindowHeight == defaultConfiguration.WindowHeight &&
            configuration.WindowWidth == defaultConfiguration.WindowWidth;
 }
Ejemplo n.º 4
0
 public virtual void Reconfigure(Configuration newConfig)
 {
     Configuration = newConfig;
 }
Ejemplo n.º 5
0
 private void PrepareRegions(Configuration configuration)
 {
     foreach (var region in configuration.Storage.Regions)
     {
         region.ThumbnailImageName = region.SourceImageName;
     }
 }