コード例 #1
0
 public void When(RegistrationCreated e)
 {
     _entity.Add(e.Id, new RegistrationView
     {
         Status       = "Processing registration",
         Registration = e.Id,
     });
 }
コード例 #2
0
        public void add_new_value()
        {
            Test1 t = new Test1 {
                Value = 555
            };
            var newValue = _guidKeyClassWriter.Add(Guid.NewGuid(), t);

            Assert.AreEqual(t, newValue);
            Assert.AreEqual(555, newValue.Value);
        }
コード例 #3
0
ファイル: LoginView.cs プロジェクト: mojamcpds/lokad-cqrs-1
 public void When(SecurityPasswordAdded e)
 {
     _writer.Add(e.UserId, new LoginView
     {
         Security               = e.Id,
         Display                = e.DisplayName,
         Token                  = e.Token,
         PasswordHash           = e.PasswordHash,
         PasswordSalt           = e.PasswordSalt,
         Type                   = LoginViewType.Password,
         LoginTrackingThreshold = DefaultThreshold
     });
 }
コード例 #4
0
        /* ----------------------------------------------------------------- */
        ///
        /// AddDocument
        ///
        /// <summary>
        /// PDF ファイルを追加します。
        /// </summary>
        ///
        /* ----------------------------------------------------------------- */
        private void AddDocument(PdfFile src, IDocumentWriter dest)
        {
            var query = new Query <string>(e => e.Cancel = true);

            using (var reader = new Cube.Pdf.Itext.DocumentReader(src.FullName, query, true, true, IO))
            {
                dest.Add(reader.Pages);
            }
        }
コード例 #5
0
        /* ----------------------------------------------------------------- */
        ///
        /// AddImage
        ///
        /// <summary>
        /// 画像ファイルを追加します。
        /// </summary>
        ///
        /* ----------------------------------------------------------------- */
        private void AddImage(ImageFile src, IDocumentWriter dest)
        {
            var pages = IO.GetImagePages(src.FullName);

            if (pages != null)
            {
                dest.Add(pages);
            }
        }
 public void When(GoalSet e)
 {
     _writer.Add(e.Id,
                 new GoalHierarchalView {
         Description = e.Description,
         GoalId      = e.Id,
         User        = e.User
     });
 }
コード例 #7
0
 public void When(GoalSet e)
 {
     _writer.Add(e.Id,
                 new GoalCalendarView {
         GoalId          = e.Id,
         DateStarted     = e.StartDate,
         GoalDescription = e.Description,
         User            = e.User
     });
 }
コード例 #8
0
 public void When(CustomerCreated e)
 {
     _store.Add(e.Id, new CustomerTransactions());
 }
コード例 #9
0
 /* ----------------------------------------------------------------- */
 ///
 /// Attach
 ///
 /// <summary>
 /// Adds a new attached file.
 /// </summary>
 ///
 /// <param name="src">IDocumentWriter object.</param>
 /// <param name="file">Attached file.</param>
 ///
 /* ----------------------------------------------------------------- */
 public static void Attach(this IDocumentWriter src, Attachment file) =>
 src.Add(new[] { file });
コード例 #10
0
 /* ----------------------------------------------------------------- */
 ///
 /// Add
 ///
 /// <summary>
 /// Adds all pages of the specified document.
 /// </summary>
 ///
 /// <param name="src">IDocumentWriter object.</param>
 /// <param name="reader">IDocumentReader object.</param>
 ///
 /* ----------------------------------------------------------------- */
 public static void Add(this IDocumentWriter src, IDocumentReader reader) =>
 src.Add(reader.Pages, reader);
コード例 #11
0
 /* ----------------------------------------------------------------- */
 ///
 /// Add
 ///
 /// <summary>
 /// Adds a new page.
 /// </summary>
 ///
 /// <param name="src">IDocumentWriter object.</param>
 /// <param name="page">Page information.</param>
 /// <param name="hint">
 /// Document reader object to get more detailed information about
 /// the specified pages.
 /// </param>
 ///
 /* ----------------------------------------------------------------- */
 public static void Add(this IDocumentWriter src, Page page, IDocumentReader hint) =>
 src.Add(new[] { page }, hint);
コード例 #12
0
 /* ----------------------------------------------------------------- */
 ///
 /// Add
 ///
 /// <summary>
 /// Adds a new page.
 /// </summary>
 ///
 /// <param name="src">IDocumentWriter object.</param>
 /// <param name="page">Page information.</param>
 ///
 /* ----------------------------------------------------------------- */
 public static void Add(this IDocumentWriter src, Page page) =>
 src.Add(new[] { page });