I get this message "Inconsiste nt accessibility: return type
'TimeTracker.Tr ackerObjects.Pr oject' is less accessible than method
'TimeTracker.Tr ackerObjects.Ge tProject(int)'"
Here's the code
namespace TimeTracker
{
public class TrackerObjects
{
private static Project aProject=null;
public static Project GetProject(int projID)
{
if(aProject==nu ll)
{
aProject = new Project("1", "NET CF Book",
DateTime.Today. AddDays(-100),
DateTime.Today. AddDays(100), 3, "Finish NET CF Book");
}
return aProject;
}
private class Project
{
public string sProjNo;
public string sProjName;
public DateTime dtProjStart;
public DateTime dtProjEnd;
public int iProjTasks;
private ArrayList taskList;
public string sProjComments;
public Project(string sProjNo, string sProjName, DateTime
dtProjStart,
DateTime dtProjEnd, int iProjTasks, string sProjComments)
{
this.sProjNo = sProjNo; this.sProjName = sProjName;
this.dtProjStar t = dtProjStart; this.dtProjEnd = dtProjEnd;
this.iProjTasks = iProjTasks; this.sProjComme nts =sProjComments;
this.taskList = new ArrayList(iProj Tasks);
}
public bool Add(Task aTask)
{
try
{
taskList.Add(aT ask);
return true;
}
catch
{
return false;
}
}
}
public struct Task
{
private string sTaskID;
private string sTaskName;
public DateTime dtTaskStart;
public DateTime dtTaskEnd;
public int iTaskEstimate; //in hrs
public int iTaskActual; //in hrs
public string sTaskComments;
public Task(string sTaskID, string sTaskName, DateTime dtTaskStart,
DateTime dtTaskEnd, int iTaskEstimate, int iTaskActual, string
sTaskComments)
{
this.sTaskID = sTaskID; this.sTaskName = sTaskName;
this.dtTaskStar t = dtTaskStart;
this.dtTaskEnd = dtTaskEnd; this.iTaskEstim ate = iTaskEstimate;
this.iTaskActua l=iTaskActual;
this.sTaskComme nts = sTaskComments;
}
}
}
}
thanks
Sunit 1 68017
"Sunit Joshi" <sj****@ingr.co m> wrote in message
news:8f******** *************** ***@posting.goo gle.com... I get this message "Inconsiste nt accessibility: return type 'TimeTracker.Tr ackerObjects.Pr oject' is less accessible than method 'TimeTracker.Tr ackerObjects.Ge tProject(int)'"
Here's the code namespace TimeTracker { public class TrackerObjects { private static Project aProject=null;
public static Project GetProject(int projID) { if(aProject==nu ll) { aProject = new Project("1", "NET CF Book", DateTime.Today. AddDays(-100), DateTime.Today. AddDays(100), 3, "Finish NET CF Book"); } return aProject; }
private class Project {
You can't return a private class from a public method. A public methods
return type has to be public so that the users that call it can use the
return type. This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: hodari |
last post by:
My program compiles correctly in VS 2003 but fails in VS2005 Express Edition
- I get a compile error
Inconsistent accessibility: return type 'VA.Customer' is less accessible
than method 'VA.CustomerDB.GetCustomer(string)'
Here is a snippet
public class CustomerDB
{
|
by: waltborders |
last post by:
Hi,
Because the blind are unable to use a mouse, keyboard navigation is
key. A major difficulty is that not all windows forms controls are
keyboard 'tab-able' or 'arrow-able' or have "tab order".
The application is built and the next step is to create the custom JAWS
(Freedom Scientific)screen reader script to read the application. The
application uses the accessibility properties for controls provided by
C#. JAWS reads properties...
|
by: Andy Fish |
last post by:
Consider the following code fragment
public class Wrapper {
protected enum E { IN, OUT };
public class C {
protected void foo(E e) { }
}
}
I want the class C to be accessible from outside the wrapper class, but not
|
by: AAV |
last post by:
what is wrong with the code i get
'Error 1 Inconsistent accessibility: parameter type
'ConsoleApplication1.Garage.CarDelegate' is less accessible than method
'ConsoleApplication1.Car.process(ConsoleApplication1.Garage.CarDelegate)
' E:\VS2005_Study\Delegates.cs 49 23 ConsoleApplication1
'
using System;
|
by: mariano774 |
last post by:
Hello,
I'm building a POC architecture framework, in which I have my business objects (BOs) made of internal classes and my transfer objects (TOs) made of public classes.
what I'd like to do is have a constructor for each TO and use the BO as a parameter, so to build the TO using the BO
what I coded is this
public class ClientTO {
public string name;
public ClientTO (ClientBO client) {
| |
by: WillyL |
last post by:
I keep getting the following error message:
Inconsistent accessibility: return type 'System.Collections.Generic.IEnumerable<Iteraties.Aandeel>' is less accessible than method 'Iteraties.AandeelPortefeuille.GetEnumerator()'
I have the following code:
using System;
using System.Collections;
using System.Collections.Generic;
|
by: bachyen |
last post by:
I have the following code, but it is error when I build it. Can you help me?
Can you tell me more about 'Inconsistent accessibility: return type', 'Inconsistent accessibility: parameter type'.
using System;
public class Tinh_khoang_cach_Ham_tu_dinh_nghia
{
struct DIEM
{
public Double x;
|
by: EvilProject |
last post by:
While working on a scripting engine I Encountered the following problem.
First I Created an abstract base class EPType that represent a variable type in the script.
internal abstract class EPType
{
private String m_Name;
public String Name
{
get { return m_Name; }
}
|
by: dylan.miller |
last post by:
I'm having trouble understanding the internal access modifier. There
are many classes in my assembly that should not be accessible outside
of the assembly. I've used the internal access modifier for these
classes. I have public classes that use the internal classes, but I
get a CS0051 error if I use an internal class as a parameter to a
protected function of a public class. For example:
internal class InternalClass
{
}
|
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look !
Part I. Meaning of...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
| |
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it.
Here is my compilation command:
g++-12 -std=c++20 -Wnarrowing bit_field.cpp
Here is the code in...
|
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...
| |