set_touchevent() public method

public set_touchevent ( avatar_touch_down_handler touch_handler ) : void
touch_handler avatar_touch_down_handler
return void
コード例 #1
0
 public void display_all_activities(object arg, RunWorkerCompletedEventArgs e)
 {
     this._list.Items.Dispatcher.BeginInvoke(DispatcherPriority.Normal,
        new System.Action(() =>
        {
            this._list.Items.Clear();
            List<Activity> activities = (List<Activity>)e.Result;
            foreach (Activity a in activities)
            {
                item_generic i = new item_generic();
                i.username.Text = a.name;
                i.user_desc.Content = configurations.GetDate_Formatted(a.creation_date);
                //i.user_desc.Visibility = System.Windows.Visibility.Collapsed;
                i.desc.Content = "Description:";
                i.content.Text = a.description;
                if (parent != null) { i.Width = parent.ActualWidth - 75; }
                i.username.FontWeight = FontWeights.Bold;
                i.username.Width = i.username.Width + 30;
                i.BorderBrush = Brushes.Gray; i.BorderThickness = new Thickness(0, 0, 0, 2);
                i.avatar.Visibility = System.Windows.Visibility.Collapsed;
                //i.avatar.Source = new BitmapImage(new Uri(configurations.GetAbsoluteAvatarPath() + c.User.avatar));
                i.Tag = a.id;
                if (configurations.use_avatar_drag) i.set_touchevent(this.avatar_drag);
                i.Margin = items_margins;
                this._list.Items.Add(i);
            }
            this._list.Items.Refresh();
            this._list.UpdateLayout();
        }));
 }
コード例 #2
0
 public void display_all_users(object us, RunWorkerCompletedEventArgs e)
 {
     this._list.Items.Dispatcher.BeginInvoke(DispatcherPriority.Normal,
         new System.Action(() =>
         {
             this._list.Items.Clear();
             List<user_item> users = (List<user_item>)e.Result;
             foreach (user_item u in users)
             {
                 item_generic i = new item_generic();
                 i.username.Text = u.user.name;
                 //i.user_desc.Content = u.email;
                 i.user_desc.Visibility = System.Windows.Visibility.Collapsed;
                 i.desc.Visibility = System.Windows.Visibility.Collapsed;
                 i.content.Visibility = System.Windows.Visibility.Collapsed;
                 i.avatar.Source = u.img;
                 if (parent != null) i.Width = parent.Width - 10;
                 i.Tag = u.user.id;
                 if (configurations.use_avatar_drag) i.set_touchevent(this.avatar_drag);
                 i.Margin = items_margins;
                 this._list.Items.Add(i);
             }
             this._list.Items.Refresh();
             this._list.UpdateLayout();
         }));
 }
コード例 #3
0
        public void display_all_comments(object c_obj, RunWorkerCompletedEventArgs e)
        {
            this._list.Items.Dispatcher.BeginInvoke(DispatcherPriority.Normal,
               new System.Action(() =>
               {
                   this._list.Items.Clear();
                   if (initial_comment != null)
                       this._list.Items.Add(initial_comment);

                   List<Feedback> comments = (List<Feedback>)e.Result;
                   foreach (Feedback c in comments)
                   {
                       item_generic i = new item_generic();
                       i.username.Text = c.User.name;
                       i.user_desc.Content = configurations.GetDate_Formatted(c.date);
                       //i.user_desc.Visibility = System.Windows.Visibility.Collapsed;
                       i.desc.Content = "Commented:";
                       i.content.Text = c.note;
                       if (parent != null) i.Width = parent.Width - 10;
                       i.avatar.Source = new BitmapImage(new Uri(configurations.GetAbsoluteAvatarPath() + c.User.avatar));
                       i.Tag = c.id;
                       if (configurations.use_avatar_drag) i.set_touchevent(this.avatar_drag);
                       i.Margin = items_margins;
                       this._list.Items.Add(i);
                   }
                   this._list.Items.Refresh();
                   this._list.Padding = new Thickness(0);
                   this._list.UpdateLayout();
               }));
        }
コード例 #4
0
 public void display_all_design_ideas(object di, RunWorkerCompletedEventArgs e)
 {
     this._list.Items.Dispatcher.BeginInvoke(DispatcherPriority.Normal,
         new System.Action(() =>
         {
             this._list.Items.Clear();
             List<design_idea_item> ideas = (List<design_idea_item>)e.Result;
             foreach (design_idea_item idea in ideas)
             {
                 item_generic i = new item_generic();
                 i.username.Text = idea.design_idea.name;
                 //i.user_desc.Visibility = System.Windows.Visibility.Collapsed;
                 i.user_desc.Content = configurations.GetDate_Formatted(idea.design_idea.date);
                 i.desc.Content = "Contributed:";
                 i.content.Text = idea.design_idea.note;
                 if (configurations.use_avatar_drag) i.set_touchevent(this.avatar_drag);
                 if (parent != null) i.Width = parent.Width - 10;
                 i.avatar.Source = idea.img;
                 i.Tag = idea.design_idea.id;
                 i.Margin = items_margins;
                 this._list.Items.Add(i);
             }
             this._list.Items.Refresh();
             this._list.UpdateLayout();
         }));
 }
コード例 #5
0
        public void display_all_comments(object c_obj, RunWorkerCompletedEventArgs e)
        {
            this._list.Items.Dispatcher.BeginInvoke(DispatcherPriority.Normal,
               new System.Action(() =>
               {
                   this._list.Items.Clear();
                   if (initial_item != null)
                       this._list.Items.Add(initial_item);

                   List<comment_item_generic> comments = (List<comment_item_generic>)e.Result;
                   if (this.total_number != null)
                       this.total_number.Text = comments.Count.ToString();
                   foreach (comment_item_generic cig in comments)
                   {
                       item_generic i = new item_generic();
                       //i.username.Text = cig.comment.User.name + ":"; TextBlock.SetFontWeight(i.username, FontWeights.Bold);
                       i.username.Text = "";
                       i.username.Inlines.Add(new Bold(new Run(cig.comment.User.name + ": ")));
                       i.username.Inlines.Add(cig.comment.note);
                       i.user_desc.Visibility = Visibility.Collapsed; //i.user_desc.Content = configurations.GetDate_Formatted(cig.comment.date);
                       i.number.Text = configurations.GetDate_Formatted(cig.comment.date); //i.number.Visibility = System.Windows.Visibility.Collapsed;
                       i.number.FontSize = configurations.design_idea_item_user_info_font_size;
                       i.desc.Visibility = Visibility.Collapsed;// i.desc.Content = "Commented:";
                       i.topleft_panel.VerticalAlignment = VerticalAlignment.Top;
                       i.top_panel.Margin = new Thickness(5, 10, 5, 10);
                       //i.content.Text = cig.comment.note;
                       i.content.Visibility = Visibility.Collapsed;
                       if (item_width != 0) i.Width = item_width + 2;
                       i.avatar.Source = new BitmapImage(new Uri(configurations.GetAbsoluteAvatarPath() + cig.comment.User.avatar));
                       i.Tag = cig.comment.id;
                       if (configurations.use_avatar_drag) i.set_touchevent(this.avatar_drag);
                       i.Margin = new Thickness(0);
                       i.second_border.Margin = new Thickness(cig.level * 25, 0, 0, 0);
                       i.first_border.BorderBrush = Brushes.Gray; i.first_border.BorderThickness = new Thickness(0, 0, 0, 1);
                       i.second_border.BorderBrush = Brushes.DarkGray; i.second_border.BorderThickness = new Thickness(1, 0, 0, 0);
                       if (this.reply_clicked_handler != null && cig.level < (configurations.max_thread_reply - 1)) i.set_replybutton(this.reply_clicked_handler);
                       this._list.Items.Add(i);
                   }

                   if (this._list.Items.Count == 0)
                       this._list.Height = 0;
                   else
                       this._list.Height = Double.NaN;

                   this._list.Items.Refresh();
                   this._list.Padding = new Thickness(0);
                   this._list.UpdateLayout();
               }));
        }