Exemplo n.º 1
0
        /// <summary>
        /// Initializes a new instance of the PhotoAreaViewModel class.
        /// </summary>
        /// <param name="ocrData">
        /// A reference to the OcrData instance that stores the 
        /// photo stream and the text obtained after the OCR conversion.
        /// </param>
        /// <param name="ocrConversionStateManager">
        /// A reference to the OcrConversionStateManager instance that stores the 
        /// status of the last OCR conversion.
        /// </param>
        public PhotoAreaViewModel(OcrData ocrData, OcrConversionStateManager ocrConversionStateManager)
            : base(ocrData, ocrConversionStateManager)
        {
            this.OcrData.PropertyChanged += new PropertyChangedEventHandler(this.OcrData_PropertyChanged);

            // If the photo stream is available when this instance is created we'll call OnPhotoStreamChanged
            // to update all properties related to the photo.
            if (this.OcrData.PhotoStream != null)
            {
                this.OnPhotoStreamChanged();
            }
        }
Exemplo n.º 2
0
        /// <summary>
        /// Initializes a new instance of the MainPage class.
        /// </summary>
        public MainPage()
        {
            this.InitializeComponent();

            if (!this.CredentialsAreSet())
            {
                return;
            }

            this.ocrData = OcrData.Instance;
            this.ocrData.PropertyChanged += new System.ComponentModel.PropertyChangedEventHandler(this.OcrData_PropertyChanged);

            this.ocrConversionStateManager = OcrConversionStateManager.Instance;
            this.ocrConversionStateManager.PropertyChanged += new System.ComponentModel.PropertyChangedEventHandler(this.ConversionStateManager_PropertyChanged);
        }
Exemplo n.º 3
0
        /// <summary>
        /// Initializes a new instance of the OcrViewModelBase class.
        /// </summary>
        /// <param name="ocrData">
        /// A reference to the OcrData instance that stores the 
        /// photo stream and the text obtained after the OCR conversion.
        /// </param>
        /// <param name="ocrConversionStateManager">
        /// A reference to the OcrConversionStateManager instance that stores the 
        /// status of the last OCR conversion.
        /// </param>
        public OcrViewModelBase(OcrData ocrData, OcrConversionStateManager ocrConversionStateManager)
        {
            if (ocrData == null)
            {
                throw new ArgumentNullException("ocrData");
            }

            if (ocrConversionStateManager == null)
            {
                throw new ArgumentNullException("ocrConversionStateManager");
            }

            this.OcrData = ocrData;
            this.OcrConversionStateManager = ocrConversionStateManager;
        }
Exemplo n.º 4
0
        private TextViewMode textViewMode; // Wrapped by this.TextViewMode

        #endregion Fields

        #region Constructors

        /// <summary>
        /// Initializes a new instance of the TextAreaViewModel class.
        /// </summary>
        /// <param name="ocrData">
        /// A reference to the OcrData instance that stores the 
        /// photo stream and the text obtained after the OCR conversion.
        /// </param>
        /// <param name="ocrConversionStateManager">
        /// A reference to the OcrConversionStateManager instance that stores the 
        /// status of the last OCR conversion.
        /// </param>
        public TextAreaViewModel(OcrData ocrData, OcrConversionStateManager ocrConversionStateManager)
            : base(ocrData, ocrConversionStateManager)
        {
        }