nature_net.user_controls.custom_listbox.avatar_drag C# (CSharp) Метод

avatar_drag() приватный Метод

private avatar_drag ( System.Windows.Controls.ListBoxItem element, System.Windows.Input.TouchDevice touch_device ) : void
element System.Windows.Controls.ListBoxItem
touch_device System.Windows.Input.TouchDevice
Результат void
        private void avatar_drag(ListBoxItem element, TouchDevice touch_device)
        {
            if (element == null)
                return;

            item_generic i;
            try { i = (item_generic)element.DataContext;}
            catch(Exception) {return; }

            if (i.Tag == null)
                return;

            if (list_users)
            {
                string username_id = "user;" + ((int)i.Tag).ToString() + ";" + i.avatar.Source.ToString() + ";" + (string)i.username.Text;
                start_drag(element, username_id, touch_device, i.avatar.Source.Clone());
            }
            if (list_design_ideas)
            {
                string idea = "design idea;" + ((int)i.Tag).ToString() + ";" + i.avatar.Source.ToString() + ";" +
                    (string)i.username.Text + ";" + i.user_desc.Content + ";" + i.desc.Content + ";" +
                    i.content.Text;
                start_drag(element, idea, touch_device, i.avatar.Source.Clone());
            }
            if (list_comments)
            {
                string comment = "comment;" + ((int)i.Tag).ToString() + ";" + i.avatar.Source.ToString() + ";" +
                    (string)i.username.Text + ";" + i.user_desc.Content + ";" + i.desc.Content + ";" +
                    i.content.Text;
                start_drag(element, comment, touch_device, i.avatar.Source.Clone());
            }
            if (list_activities)
            {
                string avatar = "";
                if (i.avatar.Source != null)
                    avatar = i.avatar.Source.ToString();
                string activity = "activity;" + ((int)i.Tag).ToString() + ";" + avatar + ";" +
                    (string)i.username.Text + ";" + i.user_desc.Content + ";" + i.desc.Content + ";" +
                    i.content.Text;
                ImageSource img = null;
                if (i.avatar.Source != null)
                    img = i.avatar.Source.Clone();
                start_drag(element, activity, touch_device, img);
            }
        }

Same methods

custom_listbox::avatar_drag ( object sender, System.Windows.Input.TouchEventArgs e ) : void