Ejemplo n.º 1
0
            private TextToken GetToken(ITokenMaker tokenMaker, string stringValue)
            {
                if ((state & State.StartOfDocument) == State.StartOfDocument)
                {
                    var next = ReadNoisyContent();

                    if (next == null)
                    {
                        state = State.ExpectedEndOfDocument;
                        return(tokenMaker.CreateValueToken(stringValue));
                    }
                    else
                    {
                        reader.PushBack(next.Value);
                        PushBack(TextToken.Name(stringValue));
                        state = State.ObjectBeforeColon;
                        containerStack.Push(ContainerType.Object);
                        return(TextToken.StartObject);
                    }
                }

                if ((state & (State.ObjectStart | State.ObjectAfterComma | State.ObjectAfterProperty)) != 0)
                {
                    state = State.ObjectBeforeColon;
                    return(tokenMaker.CreateNameToken(stringValue));
                }
                else
                {
                    ValidateAndModifyStateForValue("Invalid state to read a double quote: ");
                    return(tokenMaker.CreateValueToken(stringValue));
                }
            }
Ejemplo n.º 2
0
        public MainWindow()
        {
            if (!File.Exists("ffmpeg.exe"))
            {
                MessageBox.Show("This application needs FFmpeg.exe to work.\n\nPlease download the exe from https://ffmpeg.org and put it in the same folder as this application.", "FFmpeg not found!", MessageBoxButton.OK, MessageBoxImage.Error);
                Close();
            }

            _ffmpegService = new FFmpegService();
            _sourceFactory = new SourceFactory(_ffmpegService, GetDefaultSetting());

            _tokenMaker = new TokenMaker(new VideoExporter(_ffmpegService, GetDefaultSetting()));
            _tokenMaker.OnExportLayerCompleted += OnExportLayerCompleted;

            SetBorder(GetBorders()[0]);

            InitializeComponent();
        }
        public AuthService(
            IDbConnectionController connectionController,
            ITransaction transaction,
            IUsersRepo usersRepo,
            ITokenRepo tokenRepo,
            ITokenMaker tokenMaker,
            IPasswordHasher passwordHasher,
            IMapper mapper)
        {
            this.connectionController = connectionController;
            this.transaction          = transaction;
            this.usersRepo            = usersRepo;
            this.tokenRepo            = tokenRepo;
            this.passwordHasher       = passwordHasher;
            this.mapper = mapper;

            this.tokenMaker = tokenMaker;
        }
        public RegistrationService(
            IDbConnectionController connectionController,
            ITransaction transaction,
            IUsersRepo usersRepo,
            ITokenRepo tokenRepo,
            INotificationSender notificationSender,
            IPasswordHasher passwordHasher,
            ITokenMaker tokenMaker,
            IMapper mapper)
        {
            this.connectionController = connectionController;
            this.transaction          = transaction;
            this.usersRepo            = usersRepo;
            this.tokenRepo            = tokenRepo;
            this.passwordHasher       = passwordHasher;
            this.tokenMaker           = tokenMaker;
            this.mapper = mapper;

            this.notificationSender = notificationSender;
        }