calling list<pc> _pclist = new list<pc>(); ...add pc pclist.. writexml<list<pc>>(_pclist, "ss.xml"); function public static void writexml<t>(t o, string filename) { string filepath= environment.getfolderpath(environment.specialfolder.applicationdata) + "\\genweb2\\adsnopper\\" + filename; xmldocument xmldoc = new xmldocument(); xpathnavigator nav = xmldoc.createnavigator(); using (xmlwriter writer = nav.appendchild()) { xmlserializer ser = new xmlserializer(typeof(list<t>), new xmlrootattribute("therootelementname")); ser.serialize(writer, o); // error } file.writealltext(filepath,xmldoc.innerxml); } inner exception unable cast object of type 'system.collections.generic.list 1[pc]' type 'system.collections.generic.list 1[system.collections.generic.list`1[pc]]'. please help the problem line xmlserializer ser = new xmlserializ...
is there way without using multiple threads? i found https://stackoverflow.com/a/17329626/4014896 but don't how works. shouldn't cause 100% cpu usage in example? , how can embed it, example, qt? there this: https://github.com/svalaskevicius/qt-event-dispatcher-libuv there no documentation @ all. looks seems translates example qsocket uv_tcp_socket not i'm searching for. in short - you'll either need merge 2 event loops or use separate threads , sync event handlers manually.. the first link pasted shows how process libuv events have happened since last invocation. while stated there use ~100% cpu if there no events dispatched (as keep polling). the second link (qt-event-dispatcher-libuv) project i've created tackle same problem. does, however, work described - using libuv handle qt's event loop (and doing - merges 2 event loops one). to use you'd need register event dispatcher in application using http://qt-project.org/doc/qt-5/qcore...
Comments
Post a Comment