Пример #1
0
 /* ----------------------------------------------------------------- */
 ///
 /// PositionElement
 ///
 /// <summary>
 /// Initializes a new instance of the InsertPosition class
 /// with the specified arguments.
 /// </summary>
 ///
 /// <param name="src">Source data.</param>
 /// <param name="aggregator">Message aggregator.</param>
 /// <param name="context">Synchronization context.</param>
 ///
 /* ----------------------------------------------------------------- */
 public InsertPosViewModel(InsertBindable src,
                           Aggregator aggregator,
                           SynchronizationContext context
                           ) : base(aggregator, context)
 {
     _model = src;
 }
Пример #2
0
        /* ----------------------------------------------------------------- */
        ///
        /// PositionElement
        ///
        /// <summary>
        /// Initializes a new instance of the InsertPosition class
        /// with the specified arguments.
        /// </summary>
        ///
        /* ----------------------------------------------------------------- */
        public InsertPosition(InsertBindable data) :
            base(() => Properties.Resources.MenuInsertPosition)
        {
            Command = new RelayCommand <int>(e => data.Index.Value = e);

            Selected = new BindableElement <bool>(
                () => data.SelectedIndex >= 0,
                () => Properties.Resources.MenuPositionSelected
                );

            UserSpecified = new BindableElement <int>(
                () => data.UserSpecifiedIndex.Value + 1,
                e => { data.UserSpecifiedIndex.Value = e - 1; return(true); },
                () => Properties.Resources.MenuPositionSpecified
                );

            UserSpecifiedSuffix = new BindableElement(() => string.Format(
                                                          $"/ {Properties.Resources.MessagePage}", data.Count
                                                          ));
        }
Пример #3
0
 /* ----------------------------------------------------------------- */
 ///
 /// InsertFacade
 ///
 /// <summary>
 /// Initializes a new instance of the InsertFacade with the
 /// specified argumetns.
 /// </summary>
 ///
 /// <param name="i">Selected index.</param>
 /// <param name="n">Number of pages.</param>
 /// <param name="io">I/O handler</param>
 /// <param name="dispatcher">Dispatcher object.</param>
 ///
 /* ----------------------------------------------------------------- */
 public InsertFacade(int i, int n, IO io, IDispatcher dispatcher)
 {
     IO       = io;
     Bindable = new InsertBindable(i, n, dispatcher);
 }
Пример #4
0
 /* ----------------------------------------------------------------- */
 ///
 /// InsertFacade
 ///
 /// <summary>
 /// Initializes a new instance of the InsertFacade with the
 /// specified arguments.
 /// </summary>
 ///
 /// <param name="index">Selected index.</param>
 /// <param name="count">Number of pages.</param>
 /// <param name="io">I/O handler</param>
 /// <param name="invoker">Invoker object.</param>
 ///
 /* ----------------------------------------------------------------- */
 public InsertFacade(int index, int count, IO io, Invoker invoker)
 {
     _io   = io;
     Value = new InsertBindable(index, count, invoker);
 }
Пример #5
0
 /* ----------------------------------------------------------------- */
 ///
 /// InsertFacade
 ///
 /// <summary>
 /// Initializes a new instance of the InsertFacade with the
 /// specified argumetns.
 /// </summary>
 ///
 /// <param name="i">Selected index.</param>
 /// <param name="n">Number of pages.</param>
 /// <param name="io">I/O handler</param>
 /// <param name="context">Synchronization context.</param>
 ///
 /* ----------------------------------------------------------------- */
 public InsertFacade(int i, int n, IO io, SynchronizationContext context)
 {
     IO       = io;
     Bindable = new InsertBindable(i, n, context);
 }