English 中文(简体)
A. 载有更新文件的清单
原标题:ListsView Binding with auto update

我有一份申请表,利用Jaber图书馆与一家jabber服务器连接并接受接触等。

我已经为聊天建立了所有标识系统和接口,但现在正在研究如何整理与<代码”联系的数据。 清单:

我有在网上联系时被称作的功能。

//AppController.cs
public void XmppConnection_OnRosterItem(Object Sender, RosterItem RosterItem)
{
    if (LoginWindow.ActiveForm.InvokeRequired)
    {
        LoginWindow.ActiveForm.BeginInvoke(
           new XmppClientConnection.RosterHandler(XmppConnection_OnRosterItem),
              new object[] { Sender, RosterItem}
        );
        return;
    }
    //UPDATE HERE
}

设想有一个类别,如<代码>ContactList。 因此,当上述职能被称之为接触分子时。 增加名册(名册);

我们需要知道的是,我如何创立一个习俗清单类别,然后把它与形式上的巫术联系起来。 清单: 要素

如果可能的话,为了对名单Veiw进行校对更新?

希望你们能够帮助我


Edit:

如果我可以有2个班级,供个人联系,并安排这样的收集:

Contact C = new Contact(Roster.Name,Roster.Jid,Roster.Group);
ContactList.Add(C);

这也是有益的。

最佳回答

您可以建立一个联系小组,公正编制一份联系清单。

List<Contact> ContactList=new List<Contact>();
ContactList.Add(Roster);

How to Bind ListView to List
http://www.vistax64.com/avalon/615-how-bind-listview-list-mystruct.html

但无法确定最新情况。 把它带给某个事件,并检查可能之间的时间? MouseMove (Performance Cost?)

没有人会有什么想法?

http://www.un.org。

class ContactList:List<Contact>
    {
        public ContactList()
        {

        }
    }

您不必为这一类增添任何内容。

class Contact
    {
        public string _Name;
        public string _Jid;
        public string _Group;
        public Contact()
        {
            _Name = "Test";
            _Jid = "One";
            _Group = "Two";
        }
        public Contact(string Name, string Jid, string Group)
        {
            _Name = Name;
            _Jid = Jid;
            _Group = Group;
        }
        public override string ToString()
        {
            return _Name+" "+_Jid+" "+_Group;
        }

    }

监督任务使你能够更容易地控制清单箱中显示的内容。

public Form1()
        {
            InitializeComponent();
            ContactList C = new ContactList();
            C.Add(new Contact("Name","Jid","Group"));
            C.Add(new Contact());
            C.Add(new Contact("Test","2","Something"));
            for (int i = 0; i < C.Count; i++)
            {
                listView1.Items.Add(C[i].ToString());
            }
        }

让我知道,这是否对你有用。

问题回答

暂无回答




相关问题
Anyone feel like passing it forward?

I m the only developer in my company, and am getting along well as an autodidact, but I know I m missing out on the education one gets from working with and having code reviewed by more senior devs. ...

NSArray s, Primitive types and Boxing Oh My!

I m pretty new to the Objective-C world and I have a long history with .net/C# so naturally I m inclined to use my C# wits. Now here s the question: I feel really inclined to create some type of ...

C# Marshal / Pinvoke CBitmap?

I cannot figure out how to marshal a C++ CBitmap to a C# Bitmap or Image class. My import looks like this: [DllImport(@"test.dll", CharSet = CharSet.Unicode)] public static extern IntPtr ...

How to Use Ghostscript DLL to convert PDF to PDF/A

How to user GhostScript DLL to convert PDF to PDF/A. I know I kind of have to call the exported function of gsdll32.dll whose name is gsapi_init_with_args, but how do i pass the right arguments? BTW, ...

Linqy no matchy

Maybe it s something I m doing wrong. I m just learning Linq because I m bored. And so far so good. I made a little program and it basically just outputs all matches (foreach) into a label control. ...

热门标签