Esempio n. 1
0
        public TagSetting(long id)
        {
            InitializeComponent();
            Label title = FindName("poll_title") as Label;

            title.Content = id;
            poll_id       = id;
            tagService    = new TagService();
            pollService   = new PollService();
            Poll poll = pollService.getPoll(poll_id);

            this.poll_title.Content = poll.Name + " 列表池";
            tagList = new BindingList <Tag>(tagService.queryAllList(id));
            this.tagListView.ItemsSource = tagList;
        }
Esempio n. 2
0
        public Settings()
        {
            InitializeComponent();
            templateService = new TemplateService();
            pollService     = new PollService();
            List <Template> templateList = templateService.queryList();

            bindingList = new BindingList <Template>(templateList);
            this.cmbTemplates.ItemsSource = bindingList;
            foreach (Template item in bindingList)
            {
                if (item.IsSelected)
                {
                    this.cmbTemplates.SelectedItem = item;
                    item.IsLasted = true;
                }
            }
        }
Esempio n. 3
0
        private void loadWindow()
        {
            Template template = templateService.getDefaultTemplate();

            if (template == null)
            {
                template         = new Template();
                template.Id      = templateService.GenerateId();
                template.Name    = "default";
                template.Is_used = "1";
                templateService.insert(template);
            }

            pollService = new PollService();
            List <Poll> polls = pollService.queryList(template.Id);

            for (int i = 0; i < polls.Count; i++)
            {
                Label label = FindName("pollName" + (i + 1)) as Label;
                label.Content = polls[i].Name;
                Button  roll_button    = FindName("rollName" + (i + 1)) as Button;
                Button  setting_button = FindName("settingName" + (i + 1)) as Button;
                Button  reset_button   = FindName("resetName" + (i + 1)) as Button;
                TextBox textBox        = FindName("tagName" + (i + 1)) as TextBox;
                textBox.FontSize       = 20;
                this.mainTitle.Content = "整活挑战(" + template.Name + ")";
                textBox.Foreground     = new SolidColorBrush(Colors.DarkRed);
                roll_button.Tag        = polls[i].Id;
                setting_button.Tag     = polls[i].Id;
                reset_button.Tag       = polls[i].Id;
                textBox.Text           = "待Roll";
                if (!polls[i].IsVisibility)
                {
                    roll_button.IsEnabled = false;
                    roll_button.Content   = "停止使用";
                }
                else
                {
                    roll_button.IsEnabled = true;
                    roll_button.Content   = "待Roll";
                }
            }
        }
Esempio n. 4
0
 public TemplateService()
 {
     pollService = new PollService();
 }