|
Hello everyone,
I am new to c# previously I used to work on vb.net and I have joined a new organisation where I have been assigned this following task. Posted below is my task. I need someone who could explain me this task as a layman.
We will be creating a new GUI: This GUI will be a generic GUI capable of allowing for configuration of all some Actions, without specific knowledge of each one. This will allow us to expand the components and variables of our system without the need to completely redo the GUI every time we alter a feature.
There is a new project I created within the solution. If you get the latest version of the solution from source control you should see it. There are currently no classes in it.
We need to create the following items:
A new Class GUICreator
This class will accept be responsible for creating a new Panel, which can be displayed within a Windows UI.
It should have an empty constructor and which accepts a profile name for future settings use
It needs a new function "CreatePanel" which accepts a list of GUIObject and returns a Panel, which can then be displayed in another application
A new class GUIControl
This class will contain the information about what type of element we are creating on the GUI
It should have the following(at a minimum):
string: dataType
string: dataName
string: profileName
string: validationRegex
string: tooltip
Control: Windows Control
GetControl - This should return a the control to be used in the Panel based on the data type. For instance it could return a textbox or checkbox
ValidateData: this function will compare the data to the ValidationRegex of the GUIControl and return true or false
Save: This function will save the data based on the data name and profileName of this object
Load: this function will load the data based on the data name and profile name of this object
A new class Panel
This class will be a collection of GUIControl displayed on a panel in a readable layout
This should be a standard windows panel and have a tooltip object which will display the tooltip value for the GUIControl that is currently under the mouse
It will have a LoadFunction which calls the load function of all GUIControls
It will have a save function which calls the save of all GUIControls
The layout of the objects in the panel should default to a format that is both legible and able to be interacted with. This panel can then be displayed in various GUIs such as our user and admin tools to display all settings within the system in a generic way. It also provides flexibility for when we add a new variable or feature to the product we do not need to redesign the entire panel or GUI, we just need to add a new GUIControl object to the panel and everything will continue to work.
modified 14-Dec-17 3:31am.
|
|
|
|
|
Pretend it's a VB project, and read it again. You should be able to understand what is required of you, and it's the same job in C#.
But frankly - that looks like homework, not a work specification. It spells out everything down to the lowest level, and only just doesn't write the actual code for you...
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
I had never worked on classes even using vb.net and I have always used GUI object from Windows Form designer. Treat me as a fresher and please help me understand this task.
|
|
|
|
|
How the heck did you manage to get anything working in VB.NET without using classes? Everything is class based! The whole of .NET is a massive collection of classes!
I think that you need to go back to basics, and start from scratch with the basics of OOPs - you would not understand the code to solve that homework without that, and that makes the whole exercise futile for both of us. Me, because I waste my time on something you can't use unless you hand it in as your own work; yours because it means that the next piece of homework is even more difficult for you - and you fail your course because you can't catch up.
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
I agree that everything in .NET is class based. I meant to say I have never created a class of my own.Hence it is difficult for me to work on this task. I apologize that I have wasted your time. Just wanted some explanation from your end because I felt that you were very much clear about my task. I still feel that a bit explanation from your end will help me understand this task and despite your explanation I failed to understand this task I will stop posting message. Hoping for some positive reply from your end.
|
|
|
|
|
I can't teach you how to create classes in C# - that's trivial as far as code goes:
public class MyClass : ClassImDerivedFrom
{
private string myField;
public string MyProperty {get; set; }
}
But it's the logic, the background, and the reasoning that I can't explain - I only get a small text box to type into.
So go back to your course notes, go back to your textbook, and start reading. There is a lot to understand, and it's all absolutely basic and fundamental. Until you are up to speed with the whys and wherefores of classes, there is no point in your trying to do this exercise!
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
OriginalGriff wrote: I can't teach you how to create classes in C#
See the other top level post - it is a class assignment. They are supposed to be learning how to create classes.
|
|
|
|
|
nisss wrote: There is a new project I created within the solution. If you get the latest version of the solution from source control you should see it. There are currently no classes in it. That is obviously a note from your teacher so he/she is the person to ask for guidance.
|
|
|
|
|
Good catch. From only a brief look and the other responses I was thinking that a company just threw a very junior developer a project without a mentor.
|
|
|
|
|
Your impression could also be correct - which is even more scary.
|
|
|
|
|
|
|
What you're being asked to do is what the "Forms Designer" generates (in terms of code) in reponse to your "design" using design-time tools (toolbox; controls; etc).
Create a new C# Windows Forms project, and look at the "source code". The source code showns how a "program" builds a Windows UI using only code. Once you understand that (creating controls, adding to parent controls, updating layout), you'll be on your way.
(It's called "reverse_engineering", and is how the rest of the world beat the West).
"(I) am amazed to see myself here rather than there ... now rather than then".
― Blaise Pascal
|
|
|
|
|
Thank you so much for guiding me rather than discouraging me.
|
|
|
|
|
Any time!
"Class" assignment (pardon the pun) or not, you get extra points for being able to carry on an intelligent conversation.
And I was "on call" the first 2 weeks into my first job; so those that can, do (the "fast immersion" track).
"(I) am amazed to see myself here rather than there ... now rather than then".
― Blaise Pascal
modified 15-Dec-17 5:12am.
|
|
|
|
|
Hope someone can share some knowledge.
I made a HttpPost method, which sent a list of ids to a method in my service. The method then compared the ids to a anothers list, and return the object, which does´t contain the ids from the post request.
Now I want to make a HTTP Get method, which get the object after they are sorted
<pre> public List<ProductBO> GetAll()
{
using (var uow = facade.UnitOfWork)
{
return uow.ProductRepository.GetAll().Select(p => Pconv.Convert(p)).ToList();
}
}
public List<ProductBO> FilteretProduct(List<int> ids)
{
var AllProducts = GetAll();
List<ProductBO> FilteredProducts = new List<ProductBO>();
foreach (var prod in AllProducts)
{
foreach (var id in ids)
{
if (!prod.IngredientIds.Contains(id))
{
FilteredProducts.Add(prod);
}
}
}
return FilteredProducts;
}
<pre>
[HttpPost]
[Route("FilteredProducts")]
public List<ProductBO> FilteredList(List<int> ids)
{
List<ProductBO>filterProduct;
return filterProduct = facade.ProductService.FilteretProduct(ids);
}
[HttpGet]
[Route("GetFilteredProducts")]
public List<ProductBO> GetFilteredList()
{
return filterProduct;
}
|
|
|
|
|
That doesn't make any sense. Web applications are stateless - they don't remember state from one request to the next. So even if you moved your local variable out of the POST method to make it available from the GET method, by the time you made the GET request, the content of the variable would have been lost.
You would need to use some form of session storage to persist the data between the requests. The precise details of how you do that will depend on how you're hosting your application, and whether you're using the full framework or .NET Core.
It's not clear why you would need two requests, when the POST request already returns the data?
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
thanks for the replay!
Normally I make a post request to insert some values and af get request to get some values.
I didn´t know you could do that with a post request ?
|
|
|
|
|
i have two interface with diffrent name but method name will same and i am consumming in a class both interface how i know which method will cll i1 method or i2 method
|
|
|
|
|
What you are looking for is the difference between an implicit and explicit interface. There's a very good explanation here[^].
This space for rent
|
|
|
|
|
How to make Voting system in C# that should be object oriented programming?
|
|
|
|
|
Gather the requirements, identify the inputs and outputs, design the user interface, and write and test the code.
|
|
|
|
|
first each user should save ther self with fingerprint scanner and then can vote to the candidates.
candidates must have photo and name
|
|
|
|
|
|
Those aren't requirements; that's a vague wishlist. For instance, what types of photo id are you accepting? What happens if the fingerprint scanner breaks down? How are the candidate details stored? How do you vote for them?
This space for rent
|
|
|
|