473,405 Members | 2,287 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,405 software developers and data experts.

Problem regarding enum

Recently I have come across with a problem with enum. I have defined an enum as follows:

private void btnViewNumber_Click(object sender, EventArgs e)
{
if (machine.UpdateScreen(InventoryStockStateMachine.v iewNumber))
{
label1.Text = NupNumber.Value.ToString();
}
}

#region States

public enum InventoryStockStateMachine
{
viewNumber
};

#endregion

I have defined a public method UpdateScreen in statemachine class and make it accessible from the main class.

using System;
using System.Collections.Generic;
using System.Text;

namespace testingDeviceBattery.StateMachine
{
public class StateMachine
{
public bool UpdateScreen(InventoryStockStateMachine stateDef)
{
bool status = false;

if (stateDef == InventoryStockStateMachine.viewNumber)
{
status = true;
}

return status;
}

#region States

public enum InventoryStockStateMachine
{
viewNumber
};

#endregion

}
}

But the compiler complains with the following error messages:
Inconsistent accessibility: parameter type 'testingDeviceBattery.StateMachine.StateMachine.In ventoryStockStateMachine' is less accessible than method 'testingDeviceBattery.StateMachine.StateMachine.Up dateScreen(testingDeviceBattery.StateMachine.State Machine.InventoryStockStateMachine)'

Does anyone know how to fix it..
Thanks!!!!
Aug 26 '07 #1
0 859

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: BCC | last post by:
I have a simple container class with an enum: class MyObject { typedef enum { etype1, etype2 } EType; }; In another class I have a vector:
6
by: Fao | last post by:
Hi, I am in my first year of C++ in college and my professor wants me to Write a Program with multiple functions,to input two sets of user-defined data types: One type named 'Sign' declared by...
8
by: Klaus Schneider | last post by:
Hi all! I'm having trouble with a template function with variable arguments when I parse an enum type as variable argument. Example: template <class T> bool test(int num, ...) { va_list ap;...
4
by: sonu | last post by:
Hi, I have a problem regarding use of a ListviewSorter class which is used to sort the items in the listview. Basically I have a listview with three columns as "Name","Size" and...
7
by: Paolo | last post by:
Hi all! As I said in the title, I have a very strange problem compiling a program Here's the code that gives the problem: enum letters { a = 0, b, c };
2
by: Jigar.Patel | last post by:
Hi, I have following enum definition. public enum OperationTypes { All = 1, New = 2, View = 4,
8
by: tony | last post by:
Hello! I have below a for loop and a switch in the for loop. I have also a enum called colBlowStep with some values. I have also an array called m_columnBlowStep with some strings. All items in...
7
by: Kurt | last post by:
Hi. I have a c++ project that is basically a set of implementation hiding classes, so that we can convert a static lib with a lot of dependancies into a dynamic lib with less dependancies, so that...
13
by: Rohit | last post by:
Is there any way by which I can find number of elements in an enum list? Generally I use one last element at the end to find out total number of elements. e.g. typedef enum{ SUN, MON, TUE,...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.