|
You're copying files? It's not that hard to implement in your own application.
Before you start copying, put the current time in a variable. (DateTime startCopy = DateTime.Now) Next, you're gonna copy a list of files. Once you have copied the first file, get the current time.
Get the timespan between those two timings. At this point you want to know how long it took to copy a single file. You also know how much files you're going to copy, right?
Next thing you do, is check out how many files still need to be copied. (How many items are remaining in the list?) Multiply by the time that it took to copy a single file - and there you have your "Remaining time:"
The displayed time will be a rough indication. It might be more accurate if you count the bytes copied
Hope this helps,
|
|
|
|
|
HI Guys,
I need to convert all *.cs files in one solution to html format. The exe will convert all code to html format.
Is there any third party tool which can do the same.
thx in advance.
Thanks,
Chintan(India)
|
|
|
|
|
if you mean documentation of your codes, you can use NDOC[^]
or other documentation tools (be friend with Google)
hope it helps
dhaim
ing ngarso sung tulodho, ing madyo mangun karso, tut wuri handayani. "Ki Hajar Dewantoro"
in the front line gave a lead, in the middle line build goodwill, in the behind give power support
|
|
|
|
|
hi,
I have develop an application in which i am copying content of a folder to another folder ,and in that i want to show my own progress dialog window like windows so can any one can help me in this ?
Thank You.
|
|
|
|
|
this link[^] may help
dhaim
ing ngarso sung tulodho, ing madyo mangun karso, tut wuri handayani. "Ki Hajar Dewantoro"
in the front line gave a lead, in the middle line build goodwill, in the behind give power support
|
|
|
|
|
Don't repost
Sorry, too early, and haven't met the coffee-quota yet.
|
|
|
|
|
Hi friends
I am just a beginner , How to run a windows form in hidden mode ?
with warm regards
dyno
|
|
|
|
|
in the main entry programs (usually Main() under static class Program in vs2005) just write Application.Run(); without main form specified
hope it helps
dhaim
ing ngarso sung tulodho, ing madyo mangun karso, tut wuri handayani. "Ki Hajar Dewantoro"
in the front line gave a lead, in the middle line build goodwill, in the behind give power support
|
|
|
|
|
On the Form_Load event type:
this.Hide();
This will hide the form as soon as it's opened by the user.
|
|
|
|
|
Is there an algorithm where i could get all the possible sequence?
Example: given is "abc"
where the possible sequence are:
"abc"
"acb"
"bac"
"bca"
"cba"
"cab"
|
|
|
|
|
Hi,
Silvyster wrote: Is there an algorithm where ...
Yes there is. In fact there are many. It is a nice occasion for
a recursive one: to find a valid combination permutation of N symbols, first choose
the leftmost symbol (a foreach loop could do that), then calculate the
remaining collection and solve the problem for that smaller collection
(with N-1 symbols) by recursion.
If you keep the symbols ordered in some way (say alphabetical) the nice
side-effect is all combinations permutations will come out in the same (alphabetical) order.
And recursion is appropriate since the number of combinations permutations grows exponen-
tially with the word length, i.e. your patience will run out long before
you get a stack overflow.
modified on Friday, October 31, 2008 8:31 AM
|
|
|
|
|
What you are looking for is an algorithm for permutations.
Go forth and search the web.
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
right.
|
|
|
|
|
Hello there,
Whenever i say , "ok, we can solve this by declaring one bool variable (flag) and checking true/false" , my architect says "no flags please!!". Any thoughts why flags not recommended? is it not recommended best practice?
Thanks
|
|
|
|
|
Member 2324483 wrote: "ok, we can solve this by declaring one bool variable (flag) and checking true/false" , my architect says "no flags please!!". Any thoughts why flags not recommended?
Huh? Your architect needs to get his head checked out. There's nothing wrong with using flags for the most part.
"The clue train passed his station without stopping." - John Simmons / outlaw programmer
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
"Not only do you continue to babble nonsense, you can't even correctly remember the nonsense you babbled just minutes ago." - Rob Graham
|
|
|
|
|
Hi,
if a variable can have only two values it is perfectly OK to use a bool which is either true or false.
As an alternative you can define your own enum with two (or more) more meaningful values.
You can see the difference this can make in this hypothetical method call:
TextWriter wr1=File.CreateText("myFile1.txt", true, true, false, true, false);
TextWriter wr2=File.CreateText("myFile2.txt", FileMode.Write, FileShare.None, FileCreate.NoOverwrite,
FileCompression.Off, FileArchive.No);
The first line is error-prone for the programmer and a mystery for all readers and can be understood only
by checking something else (the documentation, Intellisense, whatever); the second line is self-explaining
by not using boolean flags.
|
|
|
|
|
Luc Pattyn wrote: As an alternative you can define your own enum with two (or more) more meaningful values.
The boolean version 2.0 springs to mind...
WTF: What is truth?[^]
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
I think that your architect has had some traumatic experience involving flags. There is nothing inherently wrong with using flags. They can of course be used in the wrong place or overused, but that can be said about anything.
The framework has a lot of exampels of flags, most of them working just fine. The Visible flag, for example, which is used in every control.
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
Thanks guys for giving good explanations. However the explanation given by luc pattyn makes more sense. Thanks luc. May be thats the reason he (my architect) says "no flags" to make the code more expressive and less error prone.
|
|
|
|
|
Another point worth noting about using flags, especially as instance variables, is that it is important to record state changes. Subsequent changes to the code can often introduce new points of state change that impact the flag, but do not update the flag.
Panic, Chaos, Destruction.
My work here is done.
|
|
|
|
|
I am trying to fill a combobox that is in a datagrid with values. The code compiles fine, but when it generates the datagrid it gives a error. "System.ArgumentException: DataGridViewComboBoxCell value is not valid". Any ideas what I am doing wrong?
DataGridViewComboBoxCell colComboCell = new DataGridViewComboBoxCell();
colComboCell.Items.Add("0");
colComboCell.Items.Add("1");
colComboCell.Items.Add("2");
colComboCell.Items.Add("3");
dataGridTicketTypes.Rows.Add(EventTicketPrice_ID, colComboCell);
|
|
|
|
|
You can try the following code assuming that the comboBox column is named valueColumn:
DataGridViewColumn valueColumn = new DataGridViewColumn();
dataGridTicketTypes.Columns.Add( valueColumn );
DataGridViewRow row = new DataGridViewRow();
DataGridViewComboBoxCell cell = new DataGridViewComboBoxCell();
cell.Items.Add("0");
cell.Items.Add("1");
cell.Items.Add("2");
cell.Items.Add("3");
valueColumn.CellTemplate = cell;
int rowIndex = dataGridTicketTypes.Rows.Add( row );
row = dataGridTicketTypes.Rows[ rowIndex ];
Hope it helps.
If you have any question contact me.
|
|
|
|
|
The code you provided did add the items to a dropdown menu, however it added a new column in which it added this data which I want to specify it as I am adding values.
1. Create a new form
2. Add a datagridview1 to the form
3. add two columns to the data grid (IDColumn, valueColumn)
4. Add a button to the form which will insert a record
5. When you click on the button it should add one row to the DataGrid by using something like below (but that actually works).
DataGridViewComboBoxCell cell = new DataGridViewComboBoxCell();
cell.Items.Add("0");
cell.Items.Add("1");
cell.Items.Add("2");
cell.Items.Add("3");
dataGridView1.Rows.Add("test", cell);
|
|
|
|
|
You can skip the first two lines :
DataGridViewColumn valueColumn = new DataGridViewColumn();
dataGridTicketTypes.Columns.Add( valueColumn );
|
|
|
|
|
I already had those skipped. My code looks like this which still does not add information to the drop down menu.
private void button1_Click(object sender, EventArgs e)
{
DataGridViewComboBoxCell cell = new DataGridViewComboBoxCell();
cell.Items.Add("0");
cell.Items.Add("1");
cell.Items.Add("2");
cell.Items.Add("3");
dataGridView1.Rows.Add("test", cell);
}
|
|
|
|