what is use of out parameter in c#
Can you please tell me what is the exact use of out parameter? Related Question: What is the difference between ref and out? (C#) ...
Can you please tell me what is the exact use of out parameter? Related Question: What is the difference between ref and out? (C#) ...
I know that this won't directly invert a colour, it will just 'oppose' it. I was wondering if anyone knew a simple way (a few lines of code) to invert a colour from any given colour? At the moment I have this (which isn't exactly the definition of an invert): const int RGBMAX = 255; Color InvertMeAColour(Color ColourToInvert) { re...
Is there a way to force the usage of a specific dll version? from the app.config? (backstory) We are using SQL Compact 3.5, and cannot for business reasons (yea, I know) move to SQL Compact 3.5 SP1 for the moment. We have the System.Data.SqlServerCe and all the unmanaged dlls in our build directory, but if SP1 is installed, the app load...
Dear ladies and sirs. Is there a library of generic collection algorithms for .NET? I would like to be able to write something like this: IList<T> items = GetItemsFromSomeWhere(); Algorithms<T>.Sort(items); // // bla bla bla // T item = GetItemSomwHow(); int i = Algorithms<T>.IndexOf(items, item); Note, that items is not List<T>, oth...
A question I often ask myself, if you need to call one method on an object, is it best practice to use a variable? Thus far I've guessed the answer is Yes - what's your choice, and reasons for it? With variable: MyObject mo = new MyObject(); mo.MyMethod(); //mo not used again Without variable: new MyObject().MyMethod(); I'm partic...
Hello everyone, Suppose I have the following XML file, and I want to use PowerShell (version 1.0) to manipulate the XML file to get the value for Foo (in this sample, value I want to get is "Foo Value") and Goo (in this sample, value I want to get is "Goo Value"), any ideas how to implement? $FooConfig = [xml](get-content .\Foo.exe.con...
Hello, I'm trying to debug a .net windows service that is spending lot of his time in GC. Using windbg during collections I discovered that most of the time is spent in: 00000000`0279e8e0 00000642`7f5368a3 mscorwks!WKS::gc_heap::plan_phase+0x50c 00000000`0279ea90 00000642`7f94ef4e mscorwks!WKS::gc_heap::gc1+0x73 00000000`0279eae0 000...
I try to keep it very simple. All I have seen in .Net 3.5fx is language upgrades i.e C# 3.0, VB.Net 9, still core CLR is based 2.0fx. I really did not find any new features (LINQ is again language feature). Is .Net framewors 3.5 just like fixed version of .Net 3.0 framework ? I really failed to find some thing new in core framework :( ...
I'm designing a system based on .NET platform, which will interact with Java EE application. I have an .xsd file, which i got from Java guys and now we are trying to change it in a way that will be suitable for my .NET system to consume. I want to get a .NET-client in "unwrapped" style in the end, and everything goes fine except one poi...
In my view I'm returning some results from a webservice and storing them in a session variable. Here's the Session Storage Method: //AreaSummary[] is a reference to the webservice reference gubbins public AreaSummary[] Results { get { if (this.Results != null) { ...
I am a Nu BE. I currently have a master page with a menu on it. When I execute the page the menu is displayed The drop down with the Sub Menu Items it drops but the text is not displayed. ...
Lost in the talk of ADO, LinQ and System.Data.SQLite. What's the easiest way of accessing (for read & write) a SQL (.db3) database file using .NET. Are we really talking about writing SQL queries or is there something higher level that is provided by MS or similar. ...
This is in reference to a problem I had which I was able to find the solution to here on SO. This wasn't my question, but it was the same exact problem I had. How do I know that I need to import a specific DLL to use a specific namespace? I saw no reference to this on either the MSDN page or the Object Explorer, and even Resharper didn'...
ASP.NET, C# As the title suggests I was wondering if anyone knew how to programatically (c# code behind file) add a div to another a container div (in the aspx page). Thanks in advance ...
I'm currently adding a tooltip to a label like so: ToolTip LabelToolTip = new System.Windows.Forms.ToolTip(); LabelToolTip.SetToolTip(this.LocationLabel, text); When I need to change this tooltip as the label's text changes, I try doing the same to add a new tooltip. Unfortunately, the old tooltip remains under the new one, which is r...
Behold the C# code: IEnumerable<int> innerMethod(int parameter) { foreach(var i in Enumerable.Range(0, parameter)) { yield return i; } } IEnumerable<int> outerMethod(int parameter) { foreach(var i in Enumerable.Range(1, parameter)) { foreach(var j in innerMethod(i)) { ...
Hi there, is there any measurably performance difference between ((TypeA) obj).method1(); ((TypeA) obj).method2(); ((TypeA) obj).method3(); and var A = (TypeA) obj; A.method1(); A.method2(); A.method3(); when used alot of times? I often see something like if (((TextBox)sender).Text.Contains('.') || ((TextBox)sender).Text.Contain...
Given a System.IO.FileStream object, how can I get the original path to the file it's providing access to? For example, in the MyStreamHandler() function below, I want to get back the path of the file that created the FileStream: public static void Main() { string path = @"c:\temp\MyTest.txt"; FileStream fs = File.Create(path)...
Coming from an Classic ASP background I'm pretty cautious about placing objects into Session. Would it be a bad idea for me to store an object of type Dictionary into Session within .NET? ...
I have defined classes: public class Parent : IParent { public string ParentText { get { return "ParentText"; } } } public interface IParent { string ParentText { get;} } public class Child : Parent, IChild { public string ChildText { get { return "ChildText"; } } } public interface IChild ...