|
Metal76 wrote: It was a stupid question, indeed!
Not at all, the solution is not very obvious. It might not be the entire solution, either.
You may want to overload that method with one that takes a single int , that way you can call it without having the compiler generate code that creates an array object every time (for the params array). Perhaps also add overloads that takes two and three parameters. The string.Concat method is overloaded in that way, for example.
Another overload that you may want to add is one that takes an IEnumerable<int> , that will work for an int[] , but also for other collections, like a List<int> .
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
i've made 3 methods and all the 3 methods are very heavy weight code as the download htmldata so applied threads on each method
using
ThreadStart starter = delegate
{
the method called here
};
new Thread(starter).Start();
and used
progressBar1.Maximum = 100;
backgroundWorker1.WorkerReportsProgress = true;
backgroundWorker1.ProgressChanged += new ProgressChangedEventHandler(backgroundWorker1_ProgressChanged);
backgroundWorker1.DoWork += new DoWorkEventHandler(backgroundWorker1_DoWork);
backgroundWorker1.RunWorkerCompleted += new RunWorkerCompletedEventHandler(backgroundWorker1_RunWorkerCompleted);
backgroundWorker1.RunWorkerAsync();
like this i've used 3 backgroundworker for all three methods separately
but still after the 3rd backgroundworker progressbar completes but the threads are still running so now i just want to know how can i make the UI thread responsive till all threads complete asynchronously.
your all advice are appreciated!!
cheers
Paritosh Tripathi
B.Tech. (C.S.)
|
|
|
|
|
Hi,
please publish actual code, not something that resembles your code but would by no means compile.
Why are you using a Thread AND a BackgroundWorker (3 each), just have the job done by the BGW,
it can both execute the job and report progress.
|
|
|
|
|
Technobizz,
Like Luc said, show some actual code. Also, how do you update the progress changed?, do you just pass it the current position in the iteration (i am guessing you're using a loop somewhere) or the actual percentage complete?, there is a difference.
Regards,
Gareth.
(FKA gareth111)
|
|
|
|
|
private void dataGridView1_CellContentClick(object sender, DataGridViewCellEventArgs e)
{
try
{
int row = 0;
int col = 0;
row = e.RowIndex;
col = e.ColumnIndex;
object val1 = dataGridView1[col, row].Value.ToString();
MessageBox.Show(val1.ToString());
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
}
error: object reference not set to an instance of an object
i'm getting this error. Please tell me how to correct this.
I've created a cellcontentclick event to get the row and column index where the checkbox is checked now i want to get the particular column value at this rowindex. As i want to get the address column data corresponding to the row in which checkbox is checked.
Thanks in Advance
Cheers
Paritosh Tripathi
B.Tech. (C.S.)
|
|
|
|
|
Hi All,
I have been trying to figure out how to
-
- Read streaming data from a html code, not from a file, (i.e. .....)
- Cleanup some of the ugly code in that streaming data
- Display the tidy code on a new browser windows
Do i need to use binaryReader/Writer? Please advice
Any idea or sample to check out. Thanks in advance
modified on Saturday, July 12, 2008 3:32 AM
|
|
|
|
|
Any one can provide me any info?
|
|
|
|
|
Hello,
I'm writing application with very complex configuration (System.Configuration). I need to pass ConfigurationSection or ConfigurationElement inherited class object as a method argument, but method executes in separate AppDomain, since neither ConfigurationSection nor ConfigurationElement doesn't inherit from MarshalByRefObject classs I constantly get a SerializationException exception.
If I add SerializableAttribute to my configuration section it works, but I can't modify any variable.
What can I do ?
Thanks in advance.
|
|
|
|
|
Hi guys! is there anyone who knows how to retrieve photos from sharepoint 2007 using C#? Urgent, Thanks!!!
|
|
|
|
|
|
Use the System.Diagnostics namespace. It includes the Process object that lets you run external programs.
using System.Diagnostics;
...
...
Process p = new Process("notepad.exe");
p.Start();
It also includes methods such as WaitForExit() that tells your program to wait till the process it terminated, and also the 'StartInfo' that lets you set customized settings for running a program. Browse the namespace for more details.
|
|
|
|
|
|
|
can u tell me in brief
howw to use this
|
|
|
|
|
heyy thankss
btt its opening in different windows even after giving same parent as first arguemment
|
|
|
|
|
Hello Friends,
I am developing a windows application in which i have used a RichTextBox. I want that some data in RichTextBox comes in bold and some text in Regular size.
Please tell me how can i do that...
Thanks
|
|
|
|
|
You can use SelectionStart, SelectionLength and SelectionFont properties of RichTextBox class for that.
Giorgi Dalakishvili
#region signature
my articles
#endregion
|
|
|
|
|
Hi D i x y.
Did you see this :
http://www.codeproject.com/KB/recipes/RtfConverter.aspx
The Freshman
|
|
|
|
|
Hi, I have a grid (4 rows x 5 columns). I need to sort grid by last column. But I want to trace what changes were made to row order. I need this info to:
1. Change row header's text 'cause it doesn't change automatically during sort.
2. Change the columns order, i.e. I have rows 1,2,3,4. After sorting I have 2,3,1,4. And I want my columns moved in that way: 2,3,1,4 (with DisplayedIndex property for example)
|
|
|
|
|
Hi,
Would anyone tell me how I can store HTML within XML ? Because, when I have < tag in XML, the XML gets screwed up. Also when attribute values have " character, XML gets error.
|
|
|
|
|
You just have to encode the text properly. Example:
<root>
<html>Some text with <abbr title="HyperText Markup Language">HTML</abbr> code in it.</html>
</root>
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
Thanks for the reply. I understood. but what about the situation when I had special characters like < in my html so when < is encoded to < and stored in xml, it will be mixed up with the < chars and when it is decoded, both encoded < and original < will be decoded to < character, right ? So, what is the effcient solution about this scenario ?
Thank you in advance.
|
|
|
|
|
When you encode html code with an entity like < in it, the & character is encoded as & , so the entity becomes &lt; .
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
Hi all.
I have a XML file. something like this :
<FoxMark ELEMENTS="442">
<BOOKMARK1 ID="1" />
<BOOKMARK2 ID="2" />
<NODE4 ID="4" NAME="FireFox" DESC="" />
<BOOKMARK5 ID="5" />
<BOOKMARK6 ID="6" />
<BOOKMARK7 ID="7" />
<BOOKMARK8 ID="8" />
<BOOKMARK9 ID="9" />
<BOOKMARK10 ID="10" />
<BOOKMARK11 ID="11" />
<BOOKMARK12 ID="12" />
<BOOKMARK13 ID="13" />
</NODE4>
</FoxMark>
I want to read this file, line by line and LINQ.
Can you help me?
Freshman
|
|
|
|
|
You can use the File.ReadAllLines method to get the file into a string array, but I suppose that's not really what you want to do.
When you say that you want to read the file line by line, what do you mean really, and how does LINQ come into the picture?
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|