|
> // Swallow the exception if anything goes wrong
Ack!
Please don't do this.
Matt Gerrans
|
|
|
|
|
Matt Gerrans wrote: Please don't do this.
I've seen that call fail and I'd rather just "ignore" the user click instead of displaying a message box telling the user that the browser could not be launched.
It's not that I do it often (to ignore exceptions).
-- LuisR
Luis Alonso Ramos
Intelectix - Chihuahua, Mexico
Not much here: My CP Blog!
The amount of sleep the average person needs is five more minutes. -- Vikram A Punathambekar, Aug. 11, 2005
|
|
|
|
|
Hello,
Is it possible for the C# class to know as soon as its object(s) goes out of the function scope?
Otherwise the burden is a kind of left to client to explicitly notify the class for cleanup.
Is it possible to simulate this feature supported by traditional C++ with less effort in C#(supports class as referenced type)?
Thanks & Best Regards,
|
|
|
|
|
The quick answer is: no.
The long answer is: as a workaround, probably you should take a look at the IDisposable pattern and the "using" statement for automatic object disposal. After you look at it, you'll think: that guy is insane, this is not what I'm looking for! Yes, I know, but it's the nearest that you can get to RAII in C#.
I don't see dead pixels anymore...
Yes, even I am blogging now!
|
|
|
|
|
I can't find any documentation on this anywhere ... is it possible?
I have a class:
public Player
{
... private fields
... public methods
}
And there are many times I need to simply say this Player equals that Player and have all the values from one copied into the next. I have created a pubic method inside player, called "Copy()"
which simply creates a new player from the current players data and returns it.
So I can do something like:
player1 = player2.Copy()
But this is VERY annoying.
Can I simply overload the assignment operator so that I can do:
player1 = player2 and it will copy all the data from player 2 into player 1, rather than setting player1 equal to the reference of player2?
|
|
|
|
|
|
I am looking for a way to sort an ArrayList on Multiple fields similar to the following.
eg. select * from table1 order by col1 desc, col2 asc, col3 desc.
I have implemented the IComparer for the different fields. I am not sure how to go forward from here. I am trying to achieve best performance.
|
|
|
|
|
alam_pune wrote: I am looking for a way to sort an ArrayList on Multiple fields similar to the following.
eg. select * from table1 order by col1 desc, col2 asc, col3 desc.
I have implemented the IComparer for the different fields. I am not sure how to go forward from here. I am trying to achieve best performance.
Hmm, I think what you need to do is implement IComparer for each select statement. You'll need to implement an IComparer that sorts not just on one field but on all of them, or at least the ones in your select statement.
So to use your example, your IComparer would first compare the values in the first column between two items. If they aren't equal, you can stop the comparison and return the result. If they are equal, you move on to the next column and make a comparison there. Again, if they aren't equal, you can stop the comparisons and return the result. Else, you move on to the third column, and so on. The value of the result of each comparison will depend on the ordering you want, descending or ascending. I think this is what you're looking for. Hope this helps.
|
|
|
|
|
Exactly.
Thanks. I am such a dumb. Anyway thanks for your help.
|
|
|
|
|
Can anyone help me figure out how to make PropertyGrid show a property as a hyperlink? I have a solution that uses a cusom PropertyEditor, but I'd like to make it so that the user can just click on the property value, and link to the site.
Thanks,
Mark
|
|
|
|
|
Hi,
Are there any Gantt chart components on the market,
free or commercial ?
Thanks
|
|
|
|
|
|
Hello,
ComponentOne has a charting component that would meet your needs, Chart for .NET. Our Chart component allows you to create Gantt charts, and many others, both data bound and unbound. For more information on Chart for .NET or our many other controls, please visit http:\\www.componentone.com[^].
Suelinda W
Customer Engagement, ComponentOne LLC
|
|
|
|
|
Hi:
I have developed a analysis program for my users which runs for about 10 min and takes up the CPU 100% solid. The GUI also goes dead when the user hits the execute button to run the analysis and doesnt respond again until the analysis is done. I would like to give the user an option (with a button for instance) so that he can toggle the program execution on and off so that if the program is running and he wants to to get a responsive PC for a few moments to say launch Excel he can pause this analysis program and then resume execution. Is there a way to do this? How would the button work considering the GUI goes dead while the analysis is running?
Thanks, Sam
|
|
|
|
|
You'll need to look into multithreading. You'll want to run your analysis on a seperate thread so that the GUI thread doesn't freeze up. Then it's a simple matter to add a stop or pause (or both) button to you GUI and use that to halt your analysis.
|
|
|
|
|
sir please tell me how to implement data sending through socket program and also what are protocol supported by C#
iftikar
|
|
|
|
|
Search for socket programming on this website or on Google, there are plenty of examples available.
Tech, life, family, faith: Give me a visit.
I'm currently blogging about: Morality Apart from God
Judah Himango
|
|
|
|
|
Question: I don't know if that's possible but How do I create a new property item that shows on the Properties Window ?
Any idea ?
I'm creating a control which must be customizable since that component connects on a database, the developer will have to specify the database name he wants to connect and I want something simple like he set the database name on the Properties Window then the component does everything.
profissional@gmail.com
|
|
|
|
|
If you are deriving from Windows.Forms.Control, all properties should be visible in the property window in the VS.NET designer by default. You can change what category each property shows up under, and the descriptions thereof, by using the Description and Category attributes. You can prevent a property from showing up by using the Browsable attribute:
<br />
[Browsable(true), Category("Data"), Description("This is the connection string to the database.")]<br />
public string ConnectionString<br />
{<br />
get { return m_connStr; }<br />
set { m_connStr = value; }<br />
}<br />
|
|
|
|
|
How can I use C# to get the icon of a specific folder path? I know about using the win32 api call SHGetFileInfo, but all I can seem to get from this is the generic folder icon always--either open or closed.
What I want to get is the same icon that windows explorer shows. So I want the little photo sitting in the folder if it's the "My Pictures" folder etc. Same idea for folders where the user has customized the icon.\
Could someone point me in the right direction here?
|
|
|
|
|
I want to do the following thing:
I have a tabsheet with properties where a user can set the program option, configure some various data, ect...
Some parts (a specific panel that is on a tab) must be showed in a separate dialog.
In the application, there is a 'Edit' button. clicking on it brings up a modal dialog with the panel and a save button.
This because the option screen has lots of tabpages.
Jumping to the specific panel to let the user configure the option would be to messy. how would the user finds his way back to the page with the edit button and continue?
OK, so far, so good. Bringing the panel in a dialog is no problem
in the constructor of a 'edit'dialog, add the panel to the controls array.
Troubles start when the edit dialog is closed.
This will also close the panel on the option screen.
(a dialog will automatically close his child controls)
how can I prevent this?
Perhaps a better solutions to do this?
greetings,
Niko
|
|
|
|
|
Niko
Do you need this panel in multiple places? If not why not create a options class that holds all your options and pass a reference to the class to your modal dialog. Set the options in the panel from the class and if the user clicks ok update your class.
Hope this helps.
Kurt
|
|
|
|
|
thanks Kurt,
but the panel contains lots of databound controls.
in the panel, the user can manage his customers, products, ...
reading all this data in an option class would be inefficient.
I also don't want to implement the same funtionality twice.
The application would be hard to maintain if I do so.
I guess I need to create a copy of the panel on the dialog.
(cloning the object doesn't work on controls)
greetings,
Niko
|
|
|
|
|
You could always make the panel a control. Do you have a screen shot by chance?
|
|
|
|
|
making a usercontrol of the panel would make sense,
I'll try this one.
There nothing much to see on the panel
to edit a product:
About 10 databound text boxes
and 2 editable datagrids
are on the panel
Kurt,
thanks for you advice.
|
|
|
|