public ProductsDatabase()
        {
            Common.IFileAccessorFactory fileAccessorFactory = Mvx.Resolve <Common.IFileAccessorFactory>();
            _fileAccessor = fileAccessorFactory.GetLocalFileAccessor();

            ReadDatabase();
        }
        internal DataAccessorV1(Uri fileUri)
        {
            Common.IFileAccessorFactory fileAccessorFactory = Mvx.Resolve <Common.IFileAccessorFactory>();
            _fileAccessor = fileAccessorFactory.GetLocalFileAccessor();

            _dictionaryService = Mvx.Resolve <IDictionaryService>();

            _fileUri = fileUri;
        }
Exemple #3
0
        private void SetType()
        {
            Common.IFileAccessorFactory fileAccessorFactory = Mvx.Resolve <Common.IFileAccessorFactory>();

            switch (_model.Type)
            {
            case "dict":
                Type                = PBaseTypes.Dictionary;
                _fileAccessor       = fileAccessorFactory.GetLocalFileAccessor();
                _baseFileNameFormat = "{0}.sdc";
                break;

            case "sound":
                Type                = PBaseTypes.Sound;
                _fileAccessor       = fileAccessorFactory.GetLocalFileAccessor();
                _baseFileNameFormat = "{0}.sdc";
                break;

            case "morphology":
                Type                = PBaseTypes.Morphology;
                _fileAccessor       = fileAccessorFactory.GetResourceFileAccessor();
                _baseFileNameFormat = "Bases\\{0}.sdc";
                break;

            case "demo_dict":
                Type                = PBaseTypes.Demo;
                _fileAccessor       = fileAccessorFactory.GetResourceFileAccessor();
                _baseFileNameFormat = "Bases\\{0}.sdc";
                break;

            default:
                Debug.WriteLine(string.Format("Unknown base type: {0}", _model.Type));
                Type                = PBaseTypes.Unknown;
                _fileAccessor       = fileAccessorFactory.GetResourceFileAccessor();
                _baseFileNameFormat = "Bases\\{0}.sdc";
                break;
            }

            _baseFileName = string.Format(_baseFileNameFormat, _model.Id);
        }