public class CategoryRepository: RepositoryBase<Category>, ICategoryRepository { public CategoryRepository(IDatabaseFactory databaseFactory) : base(databaseFactory)
[Code]...
Does anyone has an idea what i should change to let it work and let my UserRepository use the methods in RepositoryBase while implementing the IUserRepository?
I am working with a vb program, but there is something strange on one of my .vb code pagewhen i put the "dot" afther the object name its dont show the methods availables for this objectbut on other vb code pages i can see it. but in this one no.for exmaplethis is a piece of code: Dim sb As New StringBuilder()
I am not sure how clear my question is by the title, but I am trying to make Class methods instead of Instance methods in Visual Basic that way I don't have to waste memory and code creating temporary objects to execute methods that don't need instance variables.
I am not sure if you can do that in VB but I know you can in Objective-C by using either a "+" or "-" sign in front of the method declaration. And in C++ (at least I think, I can't remember) you put the static keyword or const keyword in front of the function.How would I do this in VB if it is possible? Or should I just make a separate set of functions that are not members of a class?
I'm kind of confuse on how to use get and set in vb how would i access the get/set method within the class and when i instantiate the class somewhere else? in java i would make a 2 methods call like get_item set_item and i can just use the the method name i made. to retrieve or set within the class/object or when i instantiate it somewhere else. but in vb there is a property method and 2 methods inside(set,get)?
I'm trying to use PGK.Extensions in a T4 template in VS2008 for VB.NET and I get:
RemoveAllSpecialCharacters is not a member of string..
My T4 headers:
<#@ template language="VB" hostspecific="false" debug="true" inherits="Microsoft.VisualStudio.TextTemplating.VSHost.ModelingTextTransformation" #> <#@ output extension="vb" #> <#@ assembly name="PGK.Extensions.dll" #> // the dll is found <#@ import namespace="StringExtensions" #> //Try with and without namespace
I have two methods on the page. One AddMessageToInboxOutbox(params[]) and other one SendNewMessageMail(params[]).
Once user sends an message to other other first message is added to DB and then sent to recipient's email. Sometimes SMTP is heavy loaded and it takes up to 5 seconds to get answer from it. I want to enclose SendNewMessageMail(params[]) with async call using other thread or something. I have never done that.
I've seen extended .NET method libraries such as this and this.In VB.NET, since you create your extended methods in a Module, How do I make them into a DLL?? (like in those links above) Its not possible to build and get the DLL from a Module.
I created a couple of extended methods in a VB.NET module. I put them inside a Class, built it and got the DLL. From another program I made a reference to that DLL and imported it using Imports as well.The extended methods appear in IntelliSense and it works but a warning appears in the Error console saying,Could not resolve this reference. Could not locate the assembly "nK0deExtendedMethods". Check to make sure the assembly exists on disk. why this error occurs even though I have referenced the DLL?
This is the Class where I've put my module with the extended method.
I would like to know how to use the graphic methods:
-DrawString -DrawLine -FillRectangle
I am meant to use these in a method called Drawgraph in order to draw a grid and bar chart. How can I go about this? What parameters do I need to send? What variables do I need to declare?
Take a look at the code below. Here I create a thread, set its name, and start it:
Private Sub fileCreated(sender As Object, e As FileSystemEventArgs) Dim processFileThread As Thread = New Thread(AddressOf fileCreatedHelper) processFileThread.Name = e.FullPath processFileThread.Start() End Sub
This is the sub that is the thread: Private Sub fileCreatedHelper()
In VB.NET when i define a subroutine (or function) , while declaring arguments , a list comes out. Having values ByVal,ByRef,Of,Optional, and ParamArray. Of these five lists , four are better understood except "Of". I searched and found that "Of" is used for Generics .Generic Class or Generic Method.
But i did'nt find any procedure that how to create and use Generic Method in VB.NET. I found same in VB.C# language.
I would like to know your opinion on extension methods. Sure, it is a nice feature and makes you feel powerful. It's great to see your own method pop up when typing in a object. But it doesn't really add something new... You can get the job done with normal methods as well. I think extension methods do not belong in object oriented programming. It makes your code easier to read but harder to understand for someone else.
I am having trouble doing something that is probably pretty simple!I have a stock listing that is done by 1) a simple form with parameters (Index) and 2) an ajax called partial view that displays the list of stock (based on the params).On this same simple form (Index) I have an action link to an "Add Stock" method which calls another form for adding stock.When the user has finished adding the stock I redirect them back to the stock list page (Index).
My issue is that I would like to "remember" the parameters that were initially entered in this form so the user isn't just directed back to a page with blank parameters forcing them to enter them again.I thought I could simply overload the Index method as such:
[Code]...
I get this error: The current request for action 'Index' on controller type 'StockController' is ambiguous between the following action methods:.Now I have read this post and it's answer but I cannot figure out how to implement the solution. Is this solution applicable in my situation? Is there a better way to acheive what I'm trying to do?
So I created this thread: Invoking Private / Protected Methods Via Reflection From The Same Object Instance (or Base) And we got the problem fixed save for private methods. As this may not be the same issue I thought it may be best to post a different question with the full source. It is still a work in progress but it is functional.
[Code]...
So this class is being inherited by a (so far) empty child class and ProcessStage is being called. Notice that ConfirmFormDataIsValid() sub is private. If you run this it will not find this method. If I change it to protected however it works fine.
my question is simple. How do i add methods to the standard DataGridView control of VB.NET
I want to add some methods of my own to the class, but i tried inheritance and i get errors. What are the techniques out there to extend native classes in vb net
I am trying to dynamically create COM object, call COM method and set COM properties. The COM class is a VB6 ActiveX DLL. The implementation is exactly equal to the VB6 code from this page
I have an MDI form which has got a dynamic menu based on various conditions. Clicking one of the menu items open up a child form, as well as changes the menu again specific to the child form. Now, when I close the child form, I should be able to change the menu back to the way it was before opening the child form.
I have the methods to add/remove the menu items under a menu head in the MDI form. What I tried to do is, in the child form_formclosing event call the methods to change back the menu items the way it was before opening the child form. Debugging through the code I can see the methods are getting called, the menu items are getting changed, however, after the form is closed, I see the same menu items which was there when the child form was open. I have no idea why!
Just to give you an idea about the project, its a very simple MDI form with a number of child forms, using Visual Studio 2010, VB.NET platform.
I'm trying to write 2 extension methods to handle Enum types.One to use the description attribute to give some better explanation to the enum options and a second method to list the enum options and their description to use in a selectlist or some kind of collection.You can read my code up to now here:
<Extension()> _ Public Function ToDescriptionString(ByVal en As System.Enum) As String Dim type As Type = en.GetType Dim entries() As String = en.ToString().Split(","c)
[code]....
So my problem is both extension methods don't work that well together. The methods that converts the enum options to an ienumerable can't use the extension method to get the description.
Possible Duplicate: Fastest serializer and deserializer with lowest memory footprint in C#?
I'm using BinaryFormatter class to serialize an structure or a class. (after serialization, I'm going to encrypt the serialized file before saving. (And of course decrypt it before deserialization))But I heard that some other serialization classes are present in .Net Framework. Like XmlSerializer, JavaScriptSerializer, DataContractSerializer and protobuf-net.I want to know, which one is best for me?Less RAM space needed for serialize/deserialize is the most important thing for me. Also speed is important.
I am trying to capture the content of the WebBrowser control. DrawToBitmap() would work perfectly, but it is not supported in documentation for the WebBrowser control. I have been trying to find another way to capture the contents of the WebBrowser control and save them to a local image file.
Does anyone have any workarounds or other methods to save the contents of the WebBrowser control to a local image file?
I have a tab control on first page of which there is a flexgrid. some functions are called which throughout make chages to this flexgrid. now during runtime I create more tabpages with exactly the same Flexgrid (as in I have named it the same as the first one so that I should be able to call the same functions and the same modifications should happen with this flexgrid as well. How should I call the function so that the flexgrid used is the one on my new tabpage. if I just call the function with the code Call functionname(), it modifies the same flexgrid control in the first tabpage and does nothing to the new ones on the newly created tabpages
In this project I am making a grade calculator; I am modifying an existing code I have to have the following characteristics: I need to modify the DetermineGrade method so that it accepts the maximum number of points that can be earned on both tests (currently, the max number of points is 200: 100 points per test). For an A grade, the student must earn at least 90% of the total number of points. For a B, the student must earn at least 80%. For a C, at least 70%. For a D, at least 60%. If they earn less than 60% of the total points, then grade is F. Here is the exisint code I have for the DetermineGrade method specifically:
Public Sub DetermineGrade() Dim intTotal As Integer intTotal = _intScore1 + _intScore2