VS 2008 Making Property In A Class Expose An ENUM?
Jul 12, 2009
I've got this in a public module
Module PublicModule
Public caseBAL_C As caseBAL
Public clientBAL_C As clientBal
Public Enum CSFlags
[Code]...
It doesn't like the Public Property StateFlag() As CSFlags -it's saying that CSFlags
'StateFlag' cannot expose type 'PublicModule.CSFlags' outside the project through class 'caseBAL'.
View 2 Replies
ADVERTISEMENT
Sep 2, 2010
I have an Enum file, as shown in first code block. Though it's first time I use an enum file, so maybe it's not correct to use it like this.. My purpose is just to be able to reference a global parameter from anywhere, so I can just type DataInterval.M1, and it will be treated as an integer... or.. will it not ? urther I have a property in my DataSeries class, of type DataInterval. And in this class I also have a bunch of methods Get/Set etc. to do different work on the dataseries (Inherits List(Of BarData)). roblem: The interval property keeps changing unexpectedly every time the GetNextCloseTime function is called.
''' <summary>
''' "Time Frame" of data series
''' </summary>
[code].....
View 5 Replies
Dec 17, 2009
Interface makes sure a class does have a Method / Property, However is there a way to create an unInterface, making sure that the class does not have a method / property or is there a way to implement something that will unimplement every other implements except for itself?
what i want to do: i've got a class that serves as a storage for information only, so i decided to give it a blank interface IBank, the other classes that share this feature will implement this interface. they should not implement any other interface the use is that when i seek out the interface of a class and realise that its IBank i know that its just a class for info storage.
View 1 Replies
Jul 28, 2011
In a global module, I define a new type that can take 4 values:
enum tAction as integer
None
Update
Insert
Delete
end enum
A use this type in many places in my code to check the value stored in a variable (if MyAction = tAction.Delete then ...)
In a separate file, I define a class. One of the properties should return a value of this type:
public class XXX
private _Action as tAction
public property ClassAction() as tAction
[Code].....
This way I could check a class property in the same manner (if MyClass.ClassAction = tAction.Insert then ...)
However I get a syntax error in the property definition: 'ClassAction' cannot expose type 'Globals.tAction' outside the project through class 'XXX'
My entire program consists in a few modules, in a single project. How can I use my tAction definition in my classes?
View 4 Replies
Dec 7, 2010
Application: Arrays are to be used for this. When button Add Student is clicked it should add all the information for a student and when Show Student button is clicked it should prompt the user for student's last name and student's information in a message box. Class ranking list box has an enum function to it and has to be stored be show along side other answers.NOTE: FindItemIndex if from the last application I did, i am suppose to use it in this one,so you can modify it the way you want.
[code]...
View 3 Replies
Aug 26, 2009
I want to create a class that inherit from a polygon this is not possible because the polygon is not inheritable. I want to create a class that handle a polygon anyway and it behave like a polygon. Wile with the property i can pass the value from the class to the polygon but if I want to do something like
[Code]...
View 4 Replies
Jan 17, 2010
I have two classes clsRoute and clsStop. Each route has a collection of stops. So I created a Stops collection in the route class and a method to add stops and remove stopsThis seems to work for me. owever, the clsStop properties that I declared are not showing in intellisense.i.e. oRoute.Stops.item(i).StopName and oRoute.Stops(i).StopName
Public Class clsStops
Private _stopNumber As Integer = 0
Private _stopName As String = String.Empty
[code].....
View 4 Replies
Jan 29, 2011
I'm trying to pass data from the main form to a business class form for calculation.I have 3 types of cars and I can't get the code right to pass that to the business form. It seems correct to me, but obviously, it's not.This is the code for the calculate button, I can't figure out why its telling me that CarSize is not a member of the business form when I have it in the Enum statement at the top. I'm going by what the book says and this appears right according to it.
Dim CarTypeInteger As Integer
'determine the car size from radio buttons
If LuxuryRadioButton.Checked Then
[code]....
In the book it says to specify the class name when declaring the enum on the business form. So to me it looks like it should be -RentalRate.CarSize.Luxury The error I have is 'CarSize' is not a member of the 'ChristiansCarRentals.RentalRate'.
View 6 Replies
Jul 6, 2009
During a code review I looked at set of repository classes (in vb.net). I am used to seeing these repository classes full of functions that return collections (among other things) of your domain objects. However, this repository had 1 public property and 1 private variable that looked something like this:
Private _item as Collection (of Customer)
Public Item as Collection (of Customer)
Get...
Set...
In the "Get", there is code that gets a the Customers from the DAL and loads it in the private _item. What would the benefits be in using a property (customerRepository.Item) instead of plain old function (customerRepository.GetAllCustomers)? The "Property" way looks odd to me but odd doesn't always mean wrong.
View 3 Replies
Dec 30, 2009
I have a URL lets say . some time i need to send HTTP and some time i need to send it to HTTPS for that i created a enum:
Private _protocol As Protocol
Enum Protocol
HTTP
HTTPS
[CODE]...
Now when i get value back from protocoltype it returns me integer value as enum do so tell me how to get string from enum or other substitute.
Dim targetUri As String = setting.protocolType & "://www.mysite.com"
View 1 Replies
Apr 23, 2012
I have a Public Class called "ClientConnection". Inside that class, I have a Public ReadOnly Property called "FileTransfers(ByVal TransferID)". The property returns an object of the class "FileTransfer". All methods in FileTransfer are set to public.
VS is able to discover the methods inside the parent class "ClientConnection". How would I expose the methods inside the sub-class "FileTransfer" that is returned by the property "FileTransfers(ByVal TransferID)"?
Public Class ClientConnection
'irreverent code removed
Public ReadOnly Property FileTransfers(ByVal TransferID As Integer)
[Code].....
View 1 Replies
Jul 23, 2009
Does this mean that the type is not set up correctly?If you're not living on the edge, you're taking up too much room
View 5 Replies
May 20, 2009
I wand to Expose a function inside a module in my Class Liberary( DLL)
module Module1
Public Function Add(val1 , val2) as double
return val1 + val2
End Function
End Module
View 7 Replies
Nov 12, 2010
I am trying to implement transactions across multiple TableAdapters in VB.NET (using Visual Studio 2010) by extending the partial class as described in the following examples:
http://blah.winsmarts.com/2006/06/18/the-definitive-tableadapters--transactions-blog-post.aspx
madprops.org/blog/typed-datasets-and-sqltransaction/
stackoverflow.com/questions/2342289/net-tableadapter-to-dataadapter
However, when I attempt to expose any of the private fields created by the designer they are underlined in the editor with the following error:
'_adapter' is not declared. It may be inaccessible due to its protection
level.
Searching this site as well as google has not revealed anything useful, but perhpas I'm searching the wrong keywords.
Here is the code in MyDataset.vb
Partial Public Class MyTableAdapter
Public Property MyTransaction() As SqlTransaction
Get
[code]....
View 1 Replies
Mar 8, 2012
'Attributes
For Each attRefID As ObjectId In myBRef.AttributeCollection
Dim myAttRef As AttributeReference = attRefID.GetObject(OpenMode.ForRead)
[Code].....
How do I tell if my Enumerator property hasn't been given a value?
How do I tell if it is blank?
View 4 Replies
Nov 10, 2011
I think it's substituable for just Dim, Public or others. What is merit by using structure, property ??
View 1 Replies
Aug 28, 2008
I am creating a custom graphic control and I'm stuck. I have three classes -
Protected Class ControlBase' Handles common properties and onpaintPublic Class ImageControl Inherits ControlBase' handles Image propertiesPublic Class TextControl Inherits ControlBase' handles Graphic Text properties
I also have a private enum ControlType and Public property for that enum. My goal is to have either a TextControl or a ImageControl created based on the ControlType. Since this property is outside of those two classes and the base - where do I put this property and how do I call up the correct class?
View 1 Replies
Aug 1, 2011
I'm going to do my best to describe what I'm trying to do. I have a class that has an enum in it.[code]...
View 2 Replies
Aug 19, 2009
Is there any way to fill dropdown list from Enumeration that is Enum class For e.g I have the Report Types as Enum Class
Public Enum ReportType
PDF=1
Crystal=2
Excel=3
End Enum
This Enum Class is there any way to bind in Dropdownlist
View 8 Replies
Jul 21, 2011
How to connect a combo box and an enum which is kept in another class? I have searched google a lot but the only solutions I can seem to find involve declaring an enum with the combo box. I however want to keep my enum elsewhere, not in the main gui element handling form. The closet thing I could guess was:
Combox99.DataSource = System.Enum.GetValues(GetType(MyBookList.OptionsList)
With MyBookList as a previously defined instance of the BookList class.
View 11 Replies
Aug 7, 2009
How do I set a property from within the class it is defined in?
View 2 Replies
Nov 16, 2011
Here is what I have in my file
Option Strict On
Imports MyNameSpace.MyEnum
Public Class AwesomeClass
[Code].....
But since MyEnum isn't defined in the subclass it won't work. I am not very familiar with what these types of things are called, but I think that I am import a type definition of sorts. Since I am Importing, and not defining, it is only available in the first file. Basically, I want to include MyEnum as part of the class but I don't how to do it. I don't want to copy/paste it over, and I don't really want to write Imports ... at the top of all of my subclasses.
View 3 Replies
Mar 13, 2011
I wanted to make a collection of definitions public, for which the Enum class was a perfect candidate, but I also had the need to check variables against all the possibile enum members to see which one they were.
In this scenario my solution was to write a public enum class in which all the members were made available, and replicate the same listing in an array in order to iterate through.
In fact the only way I know to iterate through all memebers is a cycle (either "for each" or "while somecondition" and a moving index). But I guess there must be a simpler way to make use of an enum class.
View 10 Replies
Sep 11, 2009
How can i make one item in my class not serialize?
I have tried adding:
<System.ComponentModel.DesignerSerializationVisibility(System.ComponentModel.DesignerSerializationVisibility.Hidden)> with no avail
View 2 Replies
Dec 9, 2011
I have a class with many properties to which I need to assign values.I have another class with a sorted list of data from which the assignments are to be made. Is there a way to get the names properties from a class and refer to those properties?I looked through System.Reflection.Assembly but could not find a way to do it.
Class DataMngr
Sub ManageData()
Dim sl As SortedList(Of String, Double)
sl = GetData()
[code]....
View 4 Replies
Feb 18, 2010
For a test scenario I have a dll project. In the project I have 1 generic class 'GlobalData' and 1 form 'form1' in the generic class I would like to make a public shared newForm1 as new form1 the line of code I'm trying is: Public shared newForm1 as new form1 I get the error newForm1 cannot expose type 'form1' outside the project through class 'GlobalData'. I really need to be able to make a public shared reference to form1. Any way to get around this? Background as to why I need to do this: I have several projects that need to use Form1 as a mdi child. I would like to just update the dll and not have to go back and update the same form in 50 projects.
View 4 Replies
Apr 16, 2010
I followed up on Cor's comment about turning fields into properties in Visual Basic 2008 Express and have hit another road block.In the following Class declarations, ASet.Integrity is meant to be dependent on the set of AFolder.Integrity values.As an example, when Getting ASet.Integrity, it is true only if every AFolder.Integrity is true.At the two points marked by xxxxx, I am trying to code this relationship, and expected to be able to make use of "AFolder.Integrity" but the IDE will not recognise this input. I have tried all sorts of flavours of declarations of Afolder within ASet and within the FolderList declaration, as well as instantiations of AFolder and FolderList
Public Class ASet
Private m_Hash As String
Private m_Type As Byte
[code]....
View 7 Replies
May 6, 2010
I have a collection class, say ITEMS, that inherits a Dictionary (of String, SINGLEITEM). From the SINGLEITEM class, I would like to reference a property in the parent ITEMS class, what is the best way to do this? For example, say the ITEMS class has an IsDirty property and I would like to set that if ANY of the contained SINGLEITEM objects is modified, what's the best way to go about doing this?
I know I could add a reference to the collection class in each SINGLEITEM class (since I override the ADD method, I could make this assignment), but this seems like overkill.
View 1 Replies
Jul 6, 2010
I'm making a custom class that mocks the System.Drawing.Rectangle class because the Rectangle class doesn't have a name property. I need a name property because I am adding all of my rectangles to a collection and I need a little more info stored than just their locale and size. So I changed the _onPaint event but nothing is working out when I run the program?
Public Class Rectanglar : Inherits UserControl
Public BackgroundColor As Color = Color.Blue
Public Sub New(ByVal name As String, ByVal XY As Point, ByVal Widthy As Integer, ByVal Heighty As Integer)
[code].....
View 5 Replies
Jul 21, 2011
I'm working on a helper class that will make things easier for me when connecting to and viewing a crystal report.Now I need to create a Property called DataSource. Crystal has a SetDataSource method that has 4 overloads/constructors(not sure what the right term is)1 accepts a System.Collections.Ienumerable, the 2nd accepts a Dataset, the 3rd a DataTable, and the 4th a DataReader.Now I want my property to be able to accept all those. So what Type must my property be.If I can just have DataSet and DataTable for now it would be fine, as I work with those mostly Public Property DataSource as?
View 3 Replies