What Does "this" Refer To In A C# Method Signature
Apr 19, 2012
I've been watching the ASP.NET MVC Storefront video series again and saw something that I've never noticed or payed any attention to before. I noticed there were a lot of references to this in the signature lists of various methods. Here is an example of one:
public static Category WithCategoryName(this IList<Category> list, string categoryName) {
return (from s in list
where s.Name.Equals(categoryName, StringComparison.InvariantCultureIgnoreCase)
[code]....
First of all, I'm not totally sure why <System.Runtime.CompilerServices.Extension> _ was included, maybe it's just the converter, nevertheless, as you can see, this wasn't converted into anything that I can tell unless it has to do with the aforementioned <System.Runtime.CompilerServices.Extension> _.What does this actually refer to and/or do in the C# method signature?Is there a VB.NET equivalent?
So we've definitely clarified that this does in fact denote an extension method and that from the answers given, it seems there's no inline VB equivalent. I would like to add that since I mentioned the ASP.NET MVC Storefront video, the C# example above was pulled from his CategoryFilters class. I assume this is how you implement what was referenced as a pipes and filters or pipeline methodology.I assume VB.NET's way of handling extension methods is something like this for example:
Imports System.Runtime.CompilerServices
Public Module StringExtensions
<Extension()> _
[code]....
View 4 Replies
ADVERTISEMENT
Nov 2, 2011
Method 'Private Sub trigger_Triggered(sender As Object, e As OamsIDD.VoamsWorldIDD.OamsStateChangeEventArgs)' cannot handle event 'Public Event Triggered(sender As Object, e As OamsIDD.VoamsWorldIDD.OamsStateChangeEventArgs)' because
[code].....
View 1 Replies
Dec 27, 2011
I am using some interesting code to perform dynamic unmanaged dll calling:[code]I want to be able to change the parameter signature and type of the delegate to void or to a function returning integer, string, or boolean.Basically, I want my program (interpreter) to be able to call upon any method in any unmanaged dll that the programmer has access to since I cannot predict what method the programmer will want to have access to - I'd like to enable them to have access to any useful method.[code]This raises a complaint on the line with 'Dim theResult = ' on it. The error is "Object of type 'System.Int32' cannot be converted to type 'System.Object[]'."
View 1 Replies
May 15, 2011
I'm planning on using the Smart Device Framework 2.3 to use the signature control panel in a Windows Mobile 5 application using the compact framework 3.5.
The control has the option to save the signature as either a byte array of points, or as a bitmap. Now seeing as I want to store the signature in a sql compact database, I guess the byte array is going to be better. The trouble is, I'm not sure how to render that in a full WinForms application after I've transferred it back to the desktop.
I need to show the signature on a report, so it would need to be an image I could link/embed into the report.
View 1 Replies
Jun 1, 2010
Code:
Public Class SendPings
Shared Sub New()
AddHandler Post.Saved, AddressOf Post_Saved[code].....
I get a error" Method 'Private Shared Sub Ping(item As BlogEngine.Core.IPublishable, itemUrl As System.Uri)' does not have a signature compatible with delegate 'Delegate Sub WaitCallback(state As Object)'.
View 4 Replies
Apr 16, 2009
how can i capture a signature from an Electronic Signature Pad and store it in database. is there any particular api or it can be captured just like capturing an image from a WebCam. Is it manufacturer specific?
View 2 Replies
Jul 11, 2010
I was trying to use a GetAsyncKeyState code but each time I run the program an error occers where
[Code]....
'A call to PInvoke function 'WindowsApplication1!WindowsApplication1.Form1::GetAsyncKeyState' has unbalanced the stack. This is likely because the managed PInvoke signature does not match the unmanaged target signature. Check that the calling convention and parameters of the PInvoke signature match the target unmanaged signature.' The full code is in timer with (1) time interval
[Code]...
View 2 Replies
Dec 28, 2010
How can I refer to the control while I am inside a control's method in VB.NET?For example, I want in a textbox to show a message box with that textbox's text every time the text changes. The code would be something like:
Private Sub TextBox1_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox1.TextChanged
[code].....
View 2 Replies
Sep 3, 2010
We have an asp.net 3.5 web application calling a WCF service. Originally the app used a "Web Reference" to register the service however after having some trouble and burning an incident with Microsoft their solution was to replace the "Web Reference" with a "Service Reference" to the WCF service.
This is great except the problem is that when we create a Service Reference, the method signatures are different than they were when a Web Reference was used.
From what I've read this may be expected, however in our case this would mean some significant changes to the application and of course it was due yesterday...so...
...I'm wondering two things:
Is it normal/expected that method signatures will change based on the reference type? Is there a way to create the Service Reference that will generate method signatures identical to the original Web Reference?
View 1 Replies
Oct 19, 2010
Consider a MyForm class that contains a shadowed implementation of Show(). It also contains a CreateForm() method, which accepts an instance of the form and calls the shadowed sub:
[Code]....
View 3 Replies
Apr 8, 2011
I've tried everything here, but the Amazon Load Balancer API just will not accept my signature.
Whatever I try, I get a "403 SignatureDoesNotMatch" response. I'm probably missing something obvious, but having spent hours trying to figure out what that is, I'm at the end of my tether.
Here's my code:
Public Sub DeregisterInstanceFromLoadBalance(ByVal strServerID As String)
Dim strURL As String
strURL = "http://elasticloadbalancing.amazonaws.com/?"
[Code].....
View 1 Replies
Nov 26, 2010
I am trying to create a signature from a private key that i have been provided and a hashed value. I am using DSA and the following code but receive the following error:
Invalid type specified. source mscorlib
The error is thrown on this line: ImportCspBlob(pk)
Private Function key() As String
Dim privatekey As String = "-----BEGIN DSA PRIVATE KEY-----" _
& "Key Data"
[Code]....
View 1 Replies
Apr 5, 2009
for few solutions it work outs well but not for the following code. I find an error when executing the following code. I find an error :
ErrorMethod 'Public Sub test()' does not have the same signature as delegate 'Delegate Sub DataRowChangeEventHandler(sender As Object, e As System.Data.DataRowChangeEventArgs)'.C:UsersKashifDocumentsVisual Studio
[code].....
View 3 Replies
Jun 2, 2010
Is that an option in the Edit Profile section? If so, where? For some reason, these byzantine web forum interfaces always turn me in circles.
View 13 Replies
Apr 27, 2010
Imports System.Drawing
Imports System.Drawing.Drawing2D
Imports System.Windows.Forms
[code]....
I've done the code above. But after i draw a signature on the picturebox and when the mouse leave the picture box, this error "Unable to cast object of type 'System.EventArgs' to type 'System.Windows.Forms.MouseEventArgs'."
View 3 Replies
Jan 15, 2012
I am able to detect the infected hash value, can I delete or remove this infected hash value from this file?Delete A File Signature?
View 1 Replies
Jul 14, 2011
for the past >8 years i was doing VB / VB.Net work now I'm jumping into C# world, so far it's very easy only thing that I find difficult is the fact that the signature of every events on object are not automatically created for me.I'm used to select the object name in the left dropdown in the code view and then the event that I want in the right dropdown.is there something similar to that in C#? if yes where can i find it, I really wish I don't have to write them by hand...
View 3 Replies
Jun 16, 2011
I try to run my Authenticode signed app on a clean Vista PC (not internet connection available ever). I have a look in Internet Explorer if the root certificate (Trustcenter) is there, and it is not. I get the message that the reference could not be resolved, and when I click file properties and have a look at the certificate, it says "The certificate for the signature could not be confirmed". Is that a normal behaviour? I mean does the computer need to have the root certificate from Trustcenter installed?
View 1 Replies
Nov 15, 2011
I am making a tool in which I want a button to do the following job.e.g;A=(1,2,3) Signature Guide B=(1,2,4) File Signature In short I am making an antivirus, every thing is done, except "clean" button.I want that the clean button should do the following job.
read the file (B) signature and compare it with signature guide(A), if the file (B) signature is different from signature file (A) then repair the file changing its signature just like its present in signature guide..
View 19 Replies
Dec 12, 2009
if you are a constant answerer here on msdn, and do not have a unique signature, or no signature at all, please take a little time to create one... eason ..when quoting a post of a member, if no signature available, then it would have to be followed w/ "quoted from so and so's post", this so so said this, etc.
View 16 Replies
Sep 8, 2009
I am trying to define a function that I would like to specify a datatype as in input of the function. The only/best way I evision doing this is by making a enum with the range of datatypes the function will accept and us the enum as part of the function's signature.
example
Enum MyDataTypesString
Int32
DbNull
[Code]....
View 1 Replies
Mar 26, 2011
all this is my 1st post in this forums My query is that i em using itextsharp to attacted the Signature(Pfx) in the PDF but at the client side its shows me a question mark in the image itself,this is how it looks[URL]..The prb is tht i don't want to show this image (Hejmadi signatures) unless the user has trusted this certificate in order to remove tht queston mark
[Code]...
View 1 Replies
Apr 30, 2009
Ok, I have an Ambir Signature Pad, and i just want to get the signature as an image (lol just).Well, I was wondering if there is a way to 'connect' to the device via usb and treat it (the pencil) as a mouse and get the coord's when they drag.
View 1 Replies
May 26, 2009
I am working on a project where I have a signature displayed on the screen that is drawn via code based on data that has been transmitted from another device. This is from one of the samples from MS. The signature displays on screen just fine but I need to convert this to a bmp or jpg so I can save it to disk and/or print it on a report.
Code:
PrivateSub DrawSignature(ByVal g As Graphics)
' background
g.Clear(Color.Cornsilk)
' border
g.DrawRectangle(Pens.Gray, 0, 0, pictSignature.Width - 1, pictSignature.Height - 1)
' return if don't have a signature
[Code] .....
I have tried creating a new bitmap from the image property of pictSignature but it is empty even though it has an image displayed on screen. This is the first time I have tried to work with this type of coding and am totally at a loss as to what I need to do to get a bitmap from the data.
View 4 Replies
May 4, 2010
I need to create a windows app for tablet to get signature.VS2008 do not have any control for it.Does vs2010 have this kind of control so that user can use pen to create signature in tablet?
View 1 Replies
Jun 29, 2010
i having trouble in linking a database which contains name ,address, etc and most importantly the signature for each individual to vb.i know that microsoft access is used in linking those database to vb, but couldnt get the signature part to be done.
View 1 Replies
Oct 26, 2011
The compiler is telling me that these signatures are incompatiable, but they seem fine to me.[code].....
View 2 Replies
Jun 12, 2009
I am trying to make a anti virus program, I know that any antivirus should have a file contains a database of virus signatures. How to build a database in VB.Net? I'm not asking about the way to create the database. What I want to know is how to write the virus signatures in the database? What actually a virus signature is? Is it strings used in a virus or what?
View 1 Replies
Jul 19, 2010
Any sample code that could read the file signature and return the value of the signature so that it could be display to the user interface of the program in vb.net? Furthermore I would like to know that how is the coding to do the comparison of file signature and extension so that it could identified whether its a wrong extension or not.
View 1 Replies
Feb 25, 2011
I have a signature box that does not allow me to save in jpeg format.I am using code:
'SigBoxCustSign.Save("C:Test2.bmp", SigBoxLib.SigBoxFileFormat.BMP)
Dim img As New Bitmap("C:Test2.bmp")
'img.Save("C:Test2.jpg", ImageFormat.Jpeg)
[code]....
View 11 Replies