How do you pass a class type into a function in C#?
As I am getting into db4o and C# I wrote the following function after reading the tutorials:
public static void PrintAllPilots("CLASS HERE", string pathToDb)
{
IObjectContainer db = Db4oFactory.OpenFile(pathToDb);
IObjectSet result = db.QueryByExample(typeof("C...
I might need to visualize a B-Spline ( http://en.wikipedia.org/wiki/B-spline ) in .NET. I do not where to start. Is there any easy way or library to do it? I would prefer to do it in Silverlight but WPF and Win Forms is also fine. I imagine the software as a coordinate system with some control points that you can add, delete or move arou...
I build a winforms app in C# which embeds Google Earth as a viewer. Like this.
My app receives data regularly, transforms that to KML, and displays the result in Google Earth. Whenever I receive the new update, I want to delete the old KML, but I could not find how in GE API. All I found is making the old stuff invisible:
this.g...
If I have access only keys from a Dictionary<TKey, TValue> what is better to use:
Dictionary<TKey, TValue>.ForEach(pair => action(pair.Key))
or
Dictionary<TKey, TValue>.Keys.ForEach(key => action(key))
Which method is more 'best-practice' ? Speed in both cases I think seems to be very similar.
...
I have a WPF treeview that is databound to an XmlDataProvider - the XML source is used by many PCs. When the XmlDataProvider is refreshed all the TreeViewNodes collapse. I would like each PC to remember the status of the IsExpanded attribute.
I understand that I could add an IsExpanded property to the XML, however then this would be u...
I apologize if this question is listed elsewhere and I just didn't find it in my search. I am trying to find a way to set the DefaultFont property of a form so that users can select the font they want and it will be auto set every time the form opens. I already have the code to save to the user settings, I'm just looking for a way to set...
OK, i have confirmed i only this issue when i attempt to query on the primary key if that primary key in the entity is set to 'Auto Generated Value' -- but w/o this, how can i insert? Sorry if this is a noob linq2sql but i just started working with it.
How does one go about using Linq to Sql with this option turned off but also have th...
When getting the username and/or SID of the current user, what is the preferred method?
Is it using:
WindowsIdentity.GetCurrent().Owner
Or:
WindowsIdentity.GetCurrent().User
What is the difference between the two? This would be a great question for SuperUser.com, but alas, it's not live yet. Thanks!
...
i filled my gridView . Also give property sorting. but i need up down image sorting in progress. Click descending cssclass="sortdescheader". But i can not do that. How can i makie it? İ really used below codes. Please help me with below codes?
protected void gvProducts_RowDataBound(object sender, GridViewRowEventArgs e)
{
G...
I'm trying to figure out the best way to handle loading objects with different graphs (related entities) depending on the context their being used.
For example Here's a sample of my domain objects:
public class Puzzle
{
public Id{ get; private set; }
public string TopicUrl { get; set; }
public string EndTopic { get; set; }
...
Hi all:
how do i kill a process after say 2 or three minutes look at the following code:
class Program
{
static void Main(string[] args)
{
try
{
//declare new process and name it p1
Process p1 = Process.Start("iexplore", "http://www.google.com");
//get starting time of proce...
I have a compiled class library containing a user control and I'd like to add it to a webpage. I'm adding an object tag to the html page that looks like:
<OBJECT id="Main" classid="http://localhost/HelloWorld/Hello.World.dll#Hello.World.UserControl"></OBJECT>
However, the control isn't being displayed. The DLL makes it to my...
A friend was showing me a API made with a COM Object and a SOAP interface. He showed me it worked in php in windows but I have serious doubts if it is achievable in linux or any other non-windows OS. Thanks!
...
Hello everyone,
I am surprised to see that no WCF max response message size setting in wshttpbinding? My question is whether there is max response message size setting in wshttpbinding? I am using .Net 3.0 + C# + VSTS 2008.
BTW: I have found max request message size setting and tested it works.
thanks in advance,
George
...
Can anyone tell me how to download the Framework for Crystal Reports so that it will run on my development server? I have it running locally but when I depoly it, I get the error saying that the framework is not installed. I tried copying the dll's locally to the bin folder but that did not work. Everytime I access the SAP site, it asks ...
How can I find the screen position of the caret for a standard Winforms TextBox?
...
Hi,
I need to dynamically set values on a bunch or properties on an object , call it a transmission object. There will be a fair number of these transmission objects that will be created and have its properties set in a short space of time.I want to avoid the use of reflection, are there alternativ? If so are there sample implementation...
I created a Web Service in .Net and so the address of the service file has a nifty auto generated explanation about how it works. When I run the page from the machine it's hosted on it even has a form that I can use to submit test values to the service. However on remote machines it hides the form and gives the message as seen above.
Is...
I'm looking for solution to add snapping/sticky windows functionallity (winamp-like) to existing WPF application. Same thing as it was asked here, just I need it for WPF.
It doesn't have to have docking function, just to snap to border of other windows inside same application and edge of screen (including taskbar) if possible. Preferabl...
What are the best use cases for anonymous types?
It would seem to me that they are only useful within a limited context, for example one class or one function. They can hardly be used outside of this context, because without reflection no one will know what properties are available on these types.
...