¡@

Home 

c# Programming Glossary: argument

Distinct() with lambda?

http://stackoverflow.com/questions/1300088/distinct-with-lambda

someEqualityComparer The equality comparer argument must be an instance of IEqualityComparer T . I can do this of..

What's the difference between an argument and a parameter?

http://stackoverflow.com/questions/156767/whats-the-difference-between-an-argument-and-a-parameter

the difference between an argument and a parameter When verbally talking about methods I'm never.. about methods I'm never sure whether to use the word argument or parameter or something else. Either way the other people.. the precise terminology then you can also use formal argument parameter and actual argument parameter to disambiguate. c#..

How slow are .NET exceptions?

http://stackoverflow.com/questions/161942/how-slow-are-net-exceptions

I wish to resolve a simple issue. 99 of the time the argument for not throwing exceptions revolves around them being slow.. blow the cache so I don't see that as a particularly good argument. Just to make it clear I don't support using exceptions where..

Communicate between two windows forms in C#

http://stackoverflow.com/questions/1665533/communicate-between-two-windows-forms-in-c-sharp

has overloaded constructor which takes calling form as argument and provides its reference to Form2 members. This solves the..

Understanding Garbage Collection in .net

http://stackoverflow.com/questions/17130382/understanding-garbage-collection-in-net

body are used. That table has an entry for each method argument and local variable with two addresses. The address where the..

Should C# have multiple inheritance? [closed]

http://stackoverflow.com/questions/191691/should-c-sharp-have-multiple-inheritance

multiple inheritance closed I have come across numerous arguments against the inclusion of multiple inheritance in C# some of.. inheritance in C# some of which include philosophical arguments aside Multiple inheritance is too complicated and often ambiguous.. often default to the multiple inheritance is unnecessary argument simply because they do not have any experience with the paradigm...

Whats the main difference between int.Parse() and Convert.ToInt32

http://stackoverflow.com/questions/199470/whats-the-main-difference-between-int-parse-and-convert-toint32

in invalid input. Convert.ToInt32 takes an object as its argument and I believe it invokes Int32.TryParse when it finds that the.. Int32.TryParse when it finds that the object taken as the argument is a string. Convert.ToInt32 also does not throw ArgumentNullException.. also does not throw ArgumentNullException when it's argument is null the way Int32.Parse does. That also means that Convert.ToInt32..

Does using “new” on a strict allocate it on the heap or stack?

http://stackoverflow.com/questions/203695/does-using-new-on-a-strict-allocate-it-on-the-heap-or-stack

if the value is used as an intermediate value e.g. an argument to a method call things are slightly different again. To show.. values e.g. for assignment to a field or use as a method argument. call instance Uses an already allocated storage location whether..

How to use reflection to call generic Method?

http://stackoverflow.com/questions/232535/how-to-use-reflection-to-call-generic-method

method to start with then construct it by supplying type arguments with MakeGenericMethod MethodInfo method typeof Sample .GetMethod.. this null EDIT For a static method pass null as the first argument to Invoke . That's nothing to do with generic methods it's just..

Why XML-Serializable class need a parameterless constructor

http://stackoverflow.com/questions/267724/why-xml-serializable-class-need-a-parameterless-constructor

writer obj return writer.ToString If the argument is a instance of class without parameterless constructor it..

Can't operator == be applied to generic types in C#?

http://stackoverflow.com/questions/390900/cant-operator-be-applied-to-generic-types-in-c

use the best method it can find for the restricted type argument but will look no further. For example the code below will always..

How to associate a file extension to the current executable in C#

http://stackoverflow.com/questions/69761/how-to-associate-a-file-extension-to-the-current-executable-in-c-sharp

it'll run my executable with the given file as the first argument. Ideally it'd also set the icon for the given file extensions..

How do I pass command-line arguments to a WinForms application?

http://stackoverflow.com/questions/1179532/how-do-i-pass-command-line-arguments-to-a-winforms-application

arguments will then be stored in the args string array. Argument example below myfile.exe showall v test args 0 showall args..

Why can't a list of an interface type accept intances of an inheriting interface?

http://stackoverflow.com/questions/14621564/why-cant-a-list-of-an-interface-type-accept-intances-of-an-inheriting-interface

ISecondary This results in the following compilation error Argument type 'System.Collections.Generic.List ISecondary ' is not assignable..

How to pass structure as pointer in C dll from C#

http://stackoverflow.com/questions/15197195/how-to-pass-structure-as-pointer-in-c-dll-from-c-sharp

I have to pass two argument both integer pointer type. One Argument is getting passed correctly but I am not able to pass second..

C# Object Pooling Pattern implementation

http://stackoverflow.com/questions/2510975/c-sharp-object-pooling-pattern-implementation

loadingMode AccessMode accessMode if size 0 throw new ArgumentOutOfRangeException size size Argument 'size' must be greater.. if size 0 throw new ArgumentOutOfRangeException size size Argument 'size' must be greater than zero. if factory null throw new.. must be greater than zero. if factory null throw new ArgumentNullException factory this.size size this.factory factory sync..

Exception during iteration on collection and remove items from that collection [duplicate]

http://stackoverflow.com/questions/2545027/exception-during-iteration-on-collection-and-remove-items-from-that-collection

When I use List ArrayList the exception is Argument '1' cannot convert from 'System.Collections.ArrayList' to 'int'..

Get the Enum<T> value Description

http://stackoverflow.com/questions/297299/get-the-enumt-value-description

list But Enum.Description value is not even compiling Argument '1' cannot convert from 'T' to 'System.Enum' How can I do that.. GetDescription this Enum value if value null throw new ArgumentNullException value string description value.ToString FieldInfo.. static IList ToList this Type type if type null throw new ArgumentNullException type ArrayList list new ArrayList Array enumValues..

Custom Action in C# used via WiX fails with error 1154

http://stackoverflow.com/questions/3560370/custom-action-in-c-sharp-used-via-wix-fails-with-error-1154

Marked as static Return ActionResult Take Session as an Argument Make sure you are using the WiX C# Custom Action Project type..

Casting List<> of Derived class to List<> of base class

http://stackoverflow.com/questions/3720751/casting-list-of-derived-class-to-list-of-base-class

the above program i get the following error Error 2 Argument 1 cannot convert from 'System.Collections.Generic.List' to 'System.Collections.Generic.List'..

Why does this generic constraint compile when it seems to have a circular reference

http://stackoverflow.com/questions/3783321/why-does-this-generic-constraint-compile-when-it-seems-to-have-a-circular-refere

T ' has some invalid arguments Argument 1 cannot convert from ' null ' to 'T' I could imagine a more..

Lost Focus method for asp.net textbox?

http://stackoverflow.com/questions/3863927/lost-focus-method-for-asp-net-textbox

parameters Target the ID of the control causing the event Argument optional information you would like to pass to the server You.. var args Request.Params Page.postEventArgumentID HandleCustomPostbackEvent ctrlName args private void HandleCustomPostbackEvent..

How to write c# service that I can also run as a winforms program?

http://stackoverflow.com/questions/421516/how-to-write-c-sharp-service-that-i-can-also-run-as-a-winforms-program

gui arg_gui true break default Console.Error.WriteLine Argument not expected arg break if arg_uninstall Install true args..

C# vs Java Enum (for those new to C#)

http://stackoverflow.com/questions/469287/c-sharp-vs-java-enum-for-those-new-to-c

earthRadius pEarth.radius Just threw it in to show usage Argument passed in is earth Weight. Calculate weight on each planet double..

How i can convert BitArray to single int?

http://stackoverflow.com/questions/5283180/how-i-can-convert-bitarray-to-single-int

BitArray bitArray if bitArray.Length 32 throw new ArgumentException Argument length shall be at most 32 bits. int array.. bitArray if bitArray.Length 32 throw new ArgumentException Argument length shall be at most 32 bits. int array new int 1 bitArray.CopyTo..

C# - static types cannot be used as type arguments

http://stackoverflow.com/questions/5858591/c-sharp-static-types-cannot-be-used-as-type-arguments

me to do checks on argument values internal sealed class Argument T where T class private void TraceAndThrow Exception ex new.. argName if ReferenceEquals value null TraceAndThrow new ArgumentNullException argName internal void ThrowIf bool condition string.. condition string argName if condition TraceAndThrow new ArgumentException null argName internal void ThrowNotInEnum Type enumType..

Looking for a Command Line Argument Parser for .NET [closed]

http://stackoverflow.com/questions/631410/looking-for-a-command-line-argument-parser-for-net

for a Command Line Argument Parser for .NET closed I'm looking for a command line argument..

Can you link to a good example of using BackgroundWorker without placing it on a form as a component?

http://stackoverflow.com/questions/6365887/can-you-link-to-a-good-example-of-using-backgroundworker-without-placing-it-on-a

to DoWork ™s event handler via the event argument ™s Argument property. Here ™s an example class Program static BackgroundWorker.. e This is called on the worker thread Console.WriteLine e.Argument writes Message to worker Perform time consuming task... share..

Image.FromStream() method returns Invalid Argument exception

http://stackoverflow.com/questions/676072/image-fromstream-method-returns-invalid-argument-exception

method returns Invalid Argument exception I am capturing images from a smart camera imager.. is the server . The problem is that i get System.InvalidArgument exception at runtime. private Image byteArrayToImage byte byteArray..

Assign new owner to appointment. “There should be only one owner party for an activity”

http://stackoverflow.com/questions/7173482/assign-new-owner-to-appointment-there-should-be-only-one-owner-party-for-an-ac

But when I test this i get the following error Invalid Argument There should be only one owner party for an activity I guess..

How do I create a C# app that decides itself whether to show as a console or windowed app?

http://stackoverflow.com/questions/807998/how-do-i-create-a-c-sharp-app-that-decides-itself-whether-to-show-as-a-console-o

for int ix 0 ix args.Length ix Console.WriteLine Argument 0 1 ix 1 args ix Console.ReadLine System.Runtime.InteropServices.DllImport..