Пример #1
0
 public ActionResult Save(Bam.Net.Analytics.Tag[] values)
 {
     try
     {
         TagCollection saver = new TagCollection();
         saver.AddRange(values);
         saver.Save();
         return(Json(new { Success = true, Message = "", Dao = "" }));
     }
     catch (Exception ex)
     {
         return(GetErrorResult(ex));
     }
 }
Пример #2
0
        /// <summary>
        /// Loads main data when the VnInfo view shows up
        /// </summary>
        protected override void OnViewLoaded()
        {
            VndbLink = new Tuple <string, Visibility>(string.Empty, Visibility.Visible);
            WikiLink = new Tuple <string, Visibility>(string.Empty, Visibility.Collapsed);
            LoadMainData();
            LoadUserData();
            LoadRelations();
            LoadLinks();

            TagCollection.Clear();
            TagCollection.AddRange(VndbTagTraitHelper.GetTags(VndbContentViewModel.VnId));
            SummaryHeaderVisibility  = DescriptionInLine.Length < 1 ? Visibility.Collapsed : Visibility.Visible;
            TagHeaderVisibility      = TagCollection.Count < 1 ? Visibility.Collapsed : Visibility.Visible;
            RelationHeaderVisibility = VnRelations.Count < 1 ? Visibility.Collapsed : Visibility.Visible;
            RelationsDataVisibility  = VnRelations.Count < 1 ? Visibility.Collapsed : Visibility.Visible;
            IsStartButtonVisible     = Visibility.Visible;
        }
Пример #3
0
        public void AddRange_adds_values()
        {
            // arrange
            var target   = new TagCollection();
            var expected = new object[]
            {
                8,
                16,
                32
            };

            // act
            target.AddRange(expected);

            // assert
            Assert.Equal(expected.Length, target.Count);
            Assert.Equal(expected, target.Select(t => t.GetValue()).ToArray());
        }