예제 #1
0
        private void ViewSelectedValueChangedHandler(object sender, EventArgs e)
        {
            int      encodingCodepage = EncodingDisplayNameMap.GetCodepageForName(View.SelectedValue);
            Encoding selectedEncoding = Encoding.GetEncoding(encodingCodepage);

            subtitlesManager.CurrentSubtitles.OutputEncoding = selectedEncoding;
        }
예제 #2
0
        /// <summary>
        /// Konstruktor.
        /// </summary>
        /// <param name="viewManager">Obiekt menadżera widoków.</param>
        /// <param name="view">Obiekt zarządzanego przez prezentera widoku.</param>
        /// <param name="subtitlesManager">Menadżer napisów.</param>
        public EncodingComboBoxPresenter(IViewManager viewManager, IToolStripComboBoxView view, SubtitlesManager subtitlesManager)
            : base(viewManager, view)
        {
            this.subtitlesManager = subtitlesManager;

            this.View.SelectedValueChanged += new EventHandler(ViewSelectedValueChangedHandler);
            var encodingList = EncodingDisplayNameMap.GetAllNames();

            this.View.Values        = encodingList;
            this.View.SelectedValue = encodingList.First();
        }