|
WPF relies heavily on INotifyPropertyChanged. You can use this to your advantage so that, when your data changes, you simply raise a PropertyChanged event.
This space for rent
|
|
|
|
|
1) Add messages received to a concurrent queue
2) When adding, start a "queue worker" if not already started
3) Queue worker dequeues messages and updates WPF window in progress reporting event
4) Queue worker runs until queue is empty,
or
1) Use a dispatcher timer to poll for new messages while updating WPF UI on same thread
"(I) am amazed to see myself here rather than there ... now rather than then".
― Blaise Pascal
|
|
|
|
|
Hello All,
Using toggleClass and hasClass in javascript to toggle between 'SelectAll' and 'DeselectAll', to control the checkboxes. 'SelectAll' would check all the checkboxes, and 'DeselectAll' would deselect them all at once. This works fine in my development environment, but in staging server, the button does not invoke any action. It does nothing.
How does one go about debugging another environment, which does not have VS installed?
I have pasted a snippet - thank you!
script type="text/javascript">
$(function () {
$("#SelectAll").click(function () {
var $this = $(this);
$this.toggleClass('SelectAll');
if ($this.hasClass('SelectAll')) {
$this.text('DeselectAll');
$this.val('DeselectAll');
var ischecked = true;
} else {
$this.text('SelectAll');
$this.val('SelectAll');
var ischecked = false;
}
});
});
</script>
|
|
|
|
|
There is a subtle clue in that code as to why this is the wrong forum. It's hidden in two places; the first being that this forum is for C# and the second is in you code when it says javascript. You might have more luck if you don't just randomly pick a forum.
This space for rent
|
|
|
|
|
This is an MVC solution, but i shall post this in the javascript forum.
Thank you.
|
|
|
|
|
Lots of "magic words" ... Is this typical of javascript? Makes it harder to debug / cross-reference.
"(I) am amazed to see myself here rather than there ... now rather than then".
― Blaise Pascal
|
|
|
|
|
Gerry Schmitz wrote: Is this typical of javascript? JQuery. Modern JavaScript is bundled with 10Mb worth of libraries and dependencies
That's to make things easier, I been told
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
"If you just follow the bacon Eddy, wherever it leads you, then you won't have to think about politics." -- Some Bell.
|
|
|
|
|
using Newtonsoft.Json;
using System;
using System.Windows.Forms;
using System.Xml;
namespace WindowsFormsApp1
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e)
{
XmlDocument doc = new XmlDocument();
doc.LoadXml(" <student>\r\n <student_name>Preethi\r\n <ssn>45679\r\n <course>Electronics and communication\r\n <address>\r\n <line_1>#1, 6th cross\r\n <line_2>Victoria Layout\r\n <city>Bangalore\r\n <country>India\r\n </address>\r\n \r\n");
string jsonText = JsonConvert.SerializeXmlNode(doc);
MessageBox.Show(jsonText);
}
}
}
|
|
|
|
|
XmlDocument.Load Method[^]
XmlDocument doc = new XmlDocument();
doc.Load(@"C:\Path\To\The\Xml\file.xml");
NB: You shouldn't try to put the whole question in the "subject" box. Instead, put a brief summary of the question as the subject, and type the detail of the question in the "message" box.
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
That XML is malformed. It seems you're missing closing tags all over the place.
<student>
<student_name>Preethi</student_name>
<ssn>45679</ssn>
<course>Electronics and communication</course>
<address>
<line_1>#1, 6th cross</line_1>
<line_2>Victoria Layout</line_2>
<city>Bangalore</city>
<country>India</country>
</address>
</student>
|
|
|
|
|
hello
right now i have a program class
have this list
List<order> lsor = new List<order>();
i want to access list lsor from another class
|
|
|
|
|
You don't. That would mean your other class would have to know about your Program class. That's a big encapsulation and separation of concerns no-no.
Your list should not be in the Program class. It should be in another class that maintains the list and exposes methods to manipulate it.
Then, you access the list in that class from the Program class, not the other way around.
|
|
|
|
|
Add a method to the "other class" that accepts a List<order> object as a parameter.
".45 ACP - because shooting twice is just silly" - JSOP, 2010 ----- You can never have too much ammo - unless you're swimming, or on fire. - JSOP, 2010 ----- When you pry the gun from my cold dead hands, be careful - the barrel will be very hot. - JSOP, 2013
|
|
|
|
|
Hello
So recently i've been making a program that uses DllExport of "user32.dll". The program itself is running pretty ok but this warning always pops up.
Because it is a P/Invoke method, 'Form1.mouse_event(uint)' should be defined in a class named NativeMethods, SafeNativeMethods, or UnsafeNativeMethods
I tried already many times and watched a lot of examples but it didnt help me.
Here is the part of the code
namespace XXX
{
public partial class Form1 : Form
{
[DllImport ("user32.dll")]
static extern void mouse_event(uint dwFlags);
public Form1()
{
InitializeComponent();
}
private void keyPressAction(object sender, KeyEventArgs e)
{
e.SuppressKeyPress = true;
System.Threading.Thread.Sleep(300);
Cursor.Position = new System.Drawing.Point(1000, 0);
mouse_event(0x002 | 0x004);
DC
|
|
|
|
|
It's just a warning that there is a convention for moving all P/Invoke calls into a class called one of the three listed there. While it's recommended practice, it's not actually going to cause a bug in your code that it's not in one of those classes. Pragmatically speaking, you can safely ignore this warning. What I would be more concerned with, if I were you, is the fact that your keyPressAction is going to block the UI thread for 300 milliseconds. That's a major design flaw.
This space for rent
|
|
|
|
|
Maybe he really hates fast typists?
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
This space for rent
|
|
|
|
|
Thank you
|
|
|
|
|
and blocking UI thread.... is a part of my plan
|
|
|
|
|
Your plan is to piss off your users?
This space for rent
|
|
|
|
|
|
Then - not to put too fine a point on it - you are an idiot.
You will annoy people and make them work hard to ensure that you have no access to their machine(s) again. If you could install this, what else might you install?
If you are in a corporate environment, you could end up with a dressing down, disciplinary action, possibly being fired. If these are your mates, then they won't trust you as much again.
You can do it, but we won't help: technically it's malware and we do not condone, support, or assist in the production of malicious code in any way, form, or manner. This is a professional site for professional developers.
If you want to know how to create such things, you need to visit a hacking site: but be sure to disable all firewalls and antivirus products first or they won't trust you enough to tell you.
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
OriginalGriff wrote: Then - not to put too fine a point on it - you are an idiot.
I did the same, years ago. Some coworker wondered why his CD-tray kept opening and closing on its own[^] while he was working. It's hard not to burst from laughing if someone looks for an exorcist.
OriginalGriff wrote:
If you are in a corporate environment, you could end up with a dressing down, disciplinary action, possibly being fired. Any corporate environment says that you should lock your PC if you leave the station. If you don't, then don't blame me for using the keyboard for reminding you of company-policy.
OriginalGriff wrote: If you want to know how to create such things, you need to visit a hacking site: Gag-applications are a very long way from hacking, and his source doesn't look like something to hijack a computer. Remember this one[^]? I'll bet you recognize it when you hover the link
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
"If you just follow the bacon Eddy, wherever it leads you, then you won't have to think about politics." -- Some Bell.
|
|
|
|
|
omg, guys you never had an idea to make a prank on your college and send them harmless app to annoy them because its a part of joke or smth? im really sorry for you if you don't have this kind of relations on your working place , you know job is not only about being serious and doing the apps and writing codes for working purpose only.But thanks for reply and answer
|
|
|
|
|
The first ever computer virus started out as a prank: The 30-year-old prank that became the first computer virus • The Register[^]
ILOVEYOU[^] was "accidentally" released - and cost an estimated $15 billion dollars worldwide (and the authors only escaped prison because they lived in the Philippines which had no laws against harming computers - they do now).
When young idiots do things they don't fully understand, they don't always realise - or even consider - the impact their actions will have. Often they don't even intend it to do what it does. Doesn't matter - intent is not the criteria, effect is.
Think about it:
Would you like it if you are slaving away to finish a project before the submission deadline and your computer started making impossible to continue?
Would your tutor accept "my mate f*cked my computer up" as a reasonable excuse for not handing it in?
Would you be a happy bunny if your mate messed up your computer?
I'm guessing here, but the answers are probably "no", "no", and "NO!".
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
AntiTwitter: @DalekDave is now a follower!
|
|
|
|