Example #1
0
        public void TagNameNormalisationTest()
        {
            Model.Tag tag = new Model.Tag
            {
                Name = "My Tag Name"
            };

            Assert.AreEqual(tag.NormalisedName, "mytagname");
        }
Example #2
0
 private void etikete_PreviewKeyDown(object sender, System.Windows.Input.KeyEventArgs e)
 {
     if (e.Key == Key.Enter)
     {
         SelectedTag         = (Model.Tag)etikete.SelectedItem;
         Prikaz.SelectedItem = SelectedTag;
         Prikaz.ScrollIntoView(Prikaz.SelectedItem);
         oznakaTag.Text        = SelectedTag.label;
         opisTag.Text          = SelectedTag.description;
         bojaTag.SelectedColor = (Color)ColorConverter.ConvertFromString(SelectedTag.color);
     }
     else if (e.Key == Key.F1)
     {
         HelpProvider.ShowHelp("EtiketePretraga", this);
     }
 }
Example #3
0
        public async Task <StatusCodeResult> Tags()
        {
            var response = await _client.GetAsync(_requestBuilder.CreateUri("genre/movie/list"));

            var genresObject = await response.Content.ReadAsAsync <TMDB.GenresObject>();

            foreach (var genre in genresObject.Genres)
            {
                var tag = new Model.Tag()
                {
                    Id = genre.Id, Text = genre.Name
                };

                _context.Tags.Attach(tag);
                await _context.Tags.AddAsync(tag);
            }

            await _context.SaveChangesAsync();

            return(Ok());
        }
Example #4
0
 public void GivenIHaveCreatedANewTag()
 {
     _tag = new Model.Tag();
 }
Example #5
0
 public Tag(Model.Tag tag)
 {
     TagId      = tag.TagId;
     TagName    = tag.TagName;
     PhotoCount = (tag is TagStat) ? ((TagStat)tag).PhotoCount : -1;
 }
 public TagViewModel(Model.Tag viewData)
 {
     ViewData = viewData;
 }
Example #7
0
 public Tag(Model.Tag tag)
 {
     Name   = tag.TagName;
     Source = tag.TagGroup.Source;
     Count  = tag.TagGroup.TagToCodepoints[Name].Count;
 }
Example #8
0
        void AssignTag(int postID, string tag)
        {
            var hanaTag = Hana.Model.Tag.SingleOrDefault(x => x.Description == tag);
            if (hanaTag == null) {
                hanaTag = new Model.Tag();
                hanaTag.Description = tag;
                hanaTag.Slug = tag.CreateSlug();
                hanaTag.Add();
            }

            var rel = new Hana.Model.Tags_Post();
            rel.PostID = postID;
            rel.TagID = hanaTag.TagID;
            rel.Add();
        }