예제 #1
0
        public FrontViewModel(IDataExchangeViewModel dataExchangeViewModel, IConfig config)
        {
            _dataExchangeViewModel = dataExchangeViewModel;
            _config = config;

            if (_dataExchangeViewModel.ContainsKey(EnumExchangeViewmodel.Front))
            {
                var frontParameter = (FrontParameter)_dataExchangeViewModel.Item(EnumExchangeViewmodel.Front);
                _tempFrontParameter = TempFrontParameterFromFrontParametter(frontParameter);
            }
            else
            {
                _tempFrontParameter = new TempFrontParameter
                {
                    BetweenCabinet      = _config.SlotsBetweenCabinet().ToString(),
                    BetweenHorizontally = _config.SlotsBetweenHorizontally().ToString(),
                    BetweenVertically   = _config.SlotsBetweenVertically().ToString(),
                    Bottom = _config.SlotsBottom().ToString(),
                    Top    = _config.SlotsTop().ToString(),
                    Left   = _config.SlotsLeft().ToString(),
                    Right  = _config.SlotsRight().ToString(),
                    Number = 2.ToString()
                };
            }

            RaisePropertyChanged(frontParameterPropertyName);
        }
예제 #2
0
        //constructor
        public OcrViewModel(IDataService dataService, ICoreOcr coreOcr, IDataExchangeViewModel dataExchangeViewModel)
        {
            _coreOcr               = coreOcr;
            _dataService           = dataService;
            _dataExchangeViewModel = dataExchangeViewModel;
            _settingsModel         = _dataService.LoadSettings();
            _pageCounter           = 0;
            _languages             = new List <LangModel> {
                _settingsModel.Language.First(c => c.Name == "Polski")
            };

            _selectionAdvtext = new SelectionAdv();


            if (IsInDesignMode)
            {
                _bitmapImages = new ObservableCollection <BitmapImage>
                {
                    new BitmapImage(new Uri(@"D:/1.jpg")),
                    new BitmapImage(new Uri(@"D:/3.jpg")),
                    new BitmapImage(new Uri(@"D:/1.jpg")),
                    new BitmapImage(new Uri(@"D:/3.jpg")),
                    new BitmapImage(new Uri(@"D:/1.jpg")),
                    new BitmapImage(new Uri(@"D:/3.jpg"))
                };

                _bitmapImage = _bitmapImages[_pageCounter];
            }
            else
            {
                _bitmapImages = new ObservableCollection <BitmapImage>();
            }

            _documentsAdv = new ObservableCollection <DocumentAdv>();
        }
        public HorizontalBarrierViewModel(IDataExchangeViewModel dataExchangeViewModel)
        {
            _dataExchangeViewModel = dataExchangeViewModel;

            LoadDataToComboBox();

            if (IsInDesignMode)
            {
                _barrierNumber = 2.ToString();
                _backShelf     = 0.ToString();
                _shelf         = true;

                _verticalBarrier.Add("1");
                _verticalBarrier.Add("2");
                _verticalBarrier.Add("3");
                _verticalBarrier.Add("1 2");
                _verticalBarrier.Add("1 3");
                _verticalBarrier.Add("2 3");
            }
            else
            {
                _barrierNumber = 0.ToString();
                _backShelf     = 0.ToString();
                _shelf         = false;
            }
        }
예제 #4
0
        public VerticalBarrierViewModel(IDataExchangeViewModel dataExchangeViewModel)
        {
            _dataExchangeViewModel = dataExchangeViewModel;

            if (_dataExchangeViewModel.ContainsKey(EnumExchangeViewmodel.HorizontalBarrier))
            {
                _horizontalBarrierCount = (int)_dataExchangeViewModel.Item(EnumExchangeViewmodel.HorizontalBarrier);
            }
            _barrierNumber = 0.ToString();
            _backShelf     = 0.ToString();
            _shelf         = false;
        }
예제 #5
0
        public PreviewViewModel(IDataExchangeViewModel dataExchangeViewModel)
        {
            if (dataExchangeViewModel.ContainsKey(EnumExchangeViewmodel.Preview))
            {
            }


            using (var t = File.OpenRead(Path.GetTempPath() + @"\temp.html"))
            {
                _documentAdv = HTMLImporting.ConvertToDocumentAdv(t);
            }

            RaisePropertyChanged(DocumentAdvPropertyName);
        }
예제 #6
0
        public OcrSettingsViewModel(IDataExchangeViewModel dataExchangeViewModel, IDataService dataService)
        {
            settings = dataService.LoadSettings();

            _languages = new ObservableCollection <LangModel>();

            foreach (var langModel in settings.Language)
            {
                _languages.Add(langModel);
            }


            _dataExchangeViewModel = dataExchangeViewModel;
        }
예제 #7
0
        public MainViewModel(IDataExchangeViewModel dataExchangeViewModel, IConfig config)
        {
            _dataExchangeViewModel = dataExchangeViewModel;

            _config = config;

            _myCabinet = new TempCabinet();

            _filenameList = new ObservableCollection <string>();

            //Cabinet.AddBack();
            Logger.Trace("Main ViewModel");
            if (IsInDesignMode)
            {
                Logger.Trace("InDesignMode");
                NewCabinet();

                _myLight = CreateLight();
                RaisePropertyChanged(MyLightPropertyName);

                RaisePropertyChanged(CabinetViewPropertyName);

                ReadCabinetMakerDirectory();
            }
            else
            {
                Logger.Info("! InDesignMode");

                NewCabinet();

                _myLight = CreateLight();
                RaisePropertyChanged(MyLightPropertyName);

                RaisePropertyChanged(CabinetViewPropertyName);

                ReadCabinetMakerDirectory();
            }
        }
예제 #8
0
 public SpellerViewModel(IDataExchangeViewModel dataExchangeViewModel)
 {
     _dataExchangeViewModel = dataExchangeViewModel;
     if (IsInDesignMode)
     {
         _dictionaryElements = new ObservableCollection <SpellModel>
         {
             new SpellModel {
                 Word = "alibaba", ListSpell = " teraz potem jest"
             },
             new SpellModel {
                 Word = "alibaba", ListSpell = " teraz potem jest"
             },
             new SpellModel {
                 Word = "alibaba", ListSpell = " teraz potem jest"
             },
             new SpellModel {
                 Word = "alibaba", ListSpell = " teraz potem jest"
             }
         };
     }
     else
     {
         if (_dataExchangeViewModel.ContainsKey(EnumExchangeViewmodel.SpellDictionary))
         {
             _dictionaryElements =
                 (ObservableCollection <SpellModel>)_dataExchangeViewModel.Item(EnumExchangeViewmodel
                                                                                .SpellDictionary);
         }
         else
         {
             _dictionaryElements = new ObservableCollection <SpellModel>();
         }
     }
     RaisePropertyChanged(DictionaryElementsPropertyName);
 }
예제 #9
0
        public RecognizeViewModel(IDataExchangeViewModel dataExchangeViewModel)
        {
            _dataExchangeViewModel = dataExchangeViewModel;

            if (IsInDesignMode)
            {
                var _text =
                    "animalistyka ż III blm szt. «przedstawianie zwierząt lub motywów zwierzęcych w sztukach plastycznych, " +
                    "w fotografice»: Do mistrzostwa doprowadził sztukę fotograficzną, szczególniej w tak trudnym dziale jak animalistyka " +
                    "(zdjęcia zwierząt). Probl. 1954, s. 570. <łc. animal = zwierzę>";


                _textToRecognize = _textImporting.ConvertToDocumentAdv(_text);

                _dictionary = new Dictionary <string, string>
                {
                    { "aaa", "bbb" },
                    { "ccc", "ddd" }
                };

                _digDictionaries = new ObservableCollection <DictionaryPasswordElement>
                {
                    new DictionaryPasswordElement {
                        Word = "Zabawa", Description = "zabawa"
                    },
                    new DictionaryPasswordElement {
                        Word = "AAA1", Description = "aaa1"
                    },
                    new DictionaryPasswordElement {
                        Word = "BBB1", Description = "bbb1"
                    }
                };

                _recognizePasswordListObservableCollection = new ObservableCollection <DictionaryPasswordElement>
                {
                    new DictionaryPasswordElement {
                        Word = "AAd1", Description = "aa1"
                    },
                    new DictionaryPasswordElement {
                        Word = "AA2", Description = "aa2"
                    },
                    new DictionaryPasswordElement {
                        Word = "AA3", Description = "aa3"
                    }
                };
            }
            else
            {
                if (_dataExchangeViewModel.ContainsKey(EnumExchangeViewmodel.TextToRecognize))
                {
                    _textToRecognize = (DocumentAdv)_dataExchangeViewModel.Item(EnumExchangeViewmodel.TextToRecognize);
                    _enableAfterOpen = true;
                    RaisePropertyChanged(EnableAfterOpenPropertyName);
                    RaisePropertyChanged(TextToRecognizePropertyName);
                }
                else
                {
                    _textToRecognize = new DocumentAdv();
                }
                _recognizePasswordListObservableCollection = new ObservableCollection <DictionaryPasswordElement>();

                LoadDictionaryPassword();
            }
            _recognizePasswordText = new FactoryRecognizePassword();
        }