|
Thanks for the response and help...
But I am still thinking that atleast operating system will get a notification that the said process is going to kill now or it is getting killed. So in that way, any API can provide those handling of killing. As you said saving data periodically will is one way we can achieve max data and if the EndProcess is having such a limitation, my requirement is still pariall.
So if you get further more info plese keep me posted....
Thanks again Simon.
Do learnig to & from others....
Bins Davis
|
|
|
|
|
Guys, this is very annoying. I'm almost at completion of this project and i'm still stuck. I declare a form object and add it to the MDI form,
ChildForm childFormObj = new ChildForm();<br />
childFormObj.MdiParent = this;<br />
childFormObj.Show() ;
Then i maximise it, childFormObj.WindowState = WindowState.Maximised;
Even in the child form its window state is already maximised. but it just won't comply.
What do i do, Please
He who goes for revenge must first dig two graves.
|
|
|
|
|
This works for me - note the changes on the last line!
ChildForm childFormObj = new ChildForm();
childFormObj.MdiParent = this;
childFormObj.Show();
childFormObj.WindowState = FormWindowState.Maximized;
Dave
|
|
|
|
|
I draw some edges on my control which relate to nodes. When i remove a node, i call RemoveEdge(List<edgeobj> edgeList) and pass it node.EdgeList which is a list of edges which belong to that node.
public void RemoveEdge(List<edgeobj> edgeList)
{
for (int i = 0; i < edgeList.Count; i++)
{
Trace.WriteLine("i == " + i);
RemoveEdge(edgeList[i]);
}
}</edgeobj>
public void RemoveEdge(EdgeObj edge)
{
Trace.WriteLine("edge == " + edge.Label.Text);
if (!_edgeItems.Contains(edge))
{
Trace.WriteLine("not in list");
return;
}
_edgeItems.Remove(edge);
edge.ParentNode.RemoveEdge(edge);
edge.ChildNode.RemoveEdge(edge);
edge.Dispose();
edge = null;
}
The problem is 'i' never gets past 1, so i am left with edges that dont connect to nodes being drawn. Can anyone see whats going wrong?
Regards,
Gareth.
(FKA gareth111)
|
|
|
|
|
Have you tried working backwards? When removing items your list gets adjusted as the items are removed.
for (int i = edgeList.Count; i > 0; i--)
{ Trace.WriteLine("i == " + i);
RemoveEdge(edgeList[i]);
}
Hope this helps
Bob
Ashfield Consultants Ltd
|
|
|
|
|
Ashfield,
That gave me an out of range exception, so i did the below and it works fine now.
for (int i = edgeList.Count - 1; i > -1; i--)
{}
Regards,
Gareth.
(FKA gareth111)
|
|
|
|
|
Ah well, the old memory isn't what it used to be. Pleased it helped though.
Bob
Ashfield Consultants Ltd
|
|
|
|
|
Looks like you've got some recursion problems to me.
you're calling RemoveEdge on the parent node, which will recur, as you are passing the same edge into the method.
I suspect you're either getting a null object or a stack overflow exception, which is then causing it to break out of the for loop.
Hit Debug->Exceptions and tick the "Common language runtime exceptions" box to make the debugger break when an exception occurs.
(If you don't understand the exception, post it here with the stack trace and message)
Simon
|
|
|
|
|
parentNode.RemoveEdge calls its own method, not the one i have posted.
Regards,
Gareth.
(FKA gareth111)
|
|
|
|
|
Ahh..It's confusing when you have so many methods with the same name
Sounds like you've got it solved anyway. Cool.
Simon
|
|
|
|
|
hi to everyone out there...a small problem...I have a listview with xmldocuments. I want to be able to put the selected xmldocument from the listview in a string and work with that. Any clue how I can get that? Thx agead
|
|
|
|
|
Store the data in the Tag property of a TreeNode. Then use some TreeView even to detect which one was selected (SelectedNode).
[update] Sorry, I for reason has TreeView on my brain, but a ListView should work the same [update]
modified on Friday, June 13, 2008 5:38 AM
|
|
|
|
|
They are stored in the Tags of the ListViewItems, aren't they? In this case you'll unbox the Tag to XmlDocument.
(XmlDocument)item.Tag; // where item is the selected ListViewItem
Eslam Afifi
|
|
|
|
|
hi...
can any one help me to monitor/limit the bandwith usage of PC with c# 2.
i have searched through web and didn't get any positive result..
|
|
|
|
|
I wrote one for .NET 1.1, but never checked if it works on .NET 2.0. Look in my list of articles.
|
|
|
|
|
thank you leppie
but i couldn't find out your post..could you please repost it or post the link for that
|
|
|
|
|
Hi,
I need to display the outlook items such as inbox,contacts, notes, calender for the current logged in user in my web application.
Can anyone give an idea how to acheive it.
Thanks in advance.
Cheers
Mani.
First have the WILL then u WILL
|
|
|
|
|
Hey guys,
im busy workin on a control, all it realy does is draw a time line and it has 6 masked text boxes aswell. the user must input 6 times and when the control's masked text boxes are filled in correctly i need it to fire an event so that a 2nd control can be given the values of this timeline control.
now i got the event working from within the control, my question is how do i give the form access to the event? maby im just missing something small, but to be honest delegates & events frighten me
public partial class TimeLine : UserControl
{
public delegate void myDelegate(object sender, EventArgs args);
public static event myDelegate dataCorrect;
public TimeLine()
{
InitializeComponent();
dataCorrect += new myDelegate(TimeLine_dataCorrect);
}
void TimeLine_dataCorrect(object sender, EventArgs args)
{
MessageBox.Show("YaY - Event Raised From Within Control");
}
further down in a common event handler (Text Changed) used by all 6 masked text boxes i do this
try
{
TimeSpan startTime = TimeSpan.Parse(mtxtStart.Text);
TimeSpan endTime = TimeSpan.Parse(mtxtEnd.Text);
dataCorrect(this, new EventArgs());
}
catch (FormatException)
{
}
thanx
Harvey Saayman - South Africa
Junior Developer
.Net, C#, SQL
think BIG and kick ASS
you.suck = (you.passion != Programming)
|
|
|
|
|
HarveySaayman wrote: my question is how do i give the form access to the event?
As it is static (and I think that might be a mistake):
TimeLine.dataCorrect += new EventHandler(yourmethod);
|
|
|
|
|
thanx leppie, you were right
as soon as i removed the static it showed up in my intelisence
thanx again
Harvey Saayman - South Africa
Junior Developer
.Net, C#, SQL
think BIG and kick ASS
you.suck = (you.passion != Programming)
|
|
|
|
|
Hello everyone,
For a customized class, like I showed in my sample, what will Comparer<>.Default be returned? In my sample, there is System.ArgumentException.
class Program
{
class Foo
{
}
static void Main(string[] args)
{
IComparer<Foo> FooComparer = Comparer<Foo>.Default;
Foo f1 = new Foo();
Foo f2 = new Foo();
FooComparer.Compare(f1, f2);
return;
}
}
thanks in advance,
George
|
|
|
|
|
If you read the message on the exception, you'll probably find that it says that your object must implement IComparable.
Simon
|
|
|
|
|
Thanks Simon!
For built-in type like string and int, I think they implements IComparable already, but for a customized class like Foo in my sample, there is no default implementation for IComparable? Correct?
regards,
George
|
|
|
|
|
Yes, that is correct. You need to implement IComparable or create your own IComparer.
|
|
|
|
|
Thanks leppie,
I have did more study.
1.
I think Default.Compare method will convert current instance to IComparable and call IComparable.Compare?
2.
A customized class is not implementing IComparable as default?
regards,
George
|
|
|
|