Questions tagged [partial-classes]

With this keyword classes can be split into multiple definitions, but it compiles into one class.

With this keyword, classes can be split into multiple (mostly two) definitions, but the code compiles into one run-time class.

References

441 questions
0
votes
0 answers

Apply Interface to partial class which returns partial class that needs interface

I have a suite of web service functions from a 3rd party vendor which I am trying to connect to using a Service Reference. The functions all have a common data structure, but because of the naming convention, they are all brought in as separate…
Jonathan
  • 109
  • 1
  • 3
0
votes
1 answer

Error using Nested insert_html partials in rails

So I have two nested partials with calls to insert_html. Basically each team has multiple players and I have an add player button and an add team button which each call a partial with the following helpers module TeamsHelper def…
Jack
0
votes
1 answer

Error: "; expected", can't find where I'm missing it

I'm using a public partial class to extend some LINQ TO SQL Classes, and am getting the aforementioned error for my [first attempt] at adding a weird property, not sure if I'm doing it right. :S In any case, code follows: public partial class…
The1nk
  • 3
  • 1
  • 3
0
votes
1 answer

ASP.NET Partial Classes and Attach To Process

I am using Visual Studio 2010 Ultimate and I'm on Windows Server 2003 with IIS6.0. I can attach to my w3wp.exe process just fine and it even hits breakpoints on any DLL that is NOT in a partial class. The symbols won't load for a partial class…
Ben Ziegler
  • 895
  • 1
  • 7
  • 18
0
votes
2 answers

C#: Partial Classes

This is quick confirmation question: In order to make partial classes work, I initially thought that there would be a main Class public class ManageDates and then you would create partial classes like public partial class ManageDates to extend the…
dcolumbus
  • 9,596
  • 26
  • 100
  • 165
0
votes
0 answers

In normal C# programming without designer.cs (UI), shall we use partial class? How shall we use it in this case?

I know the way to write a partial class in C# but i do not know when to use it. e.g. If i am not developing using Windows Form or UI in C#, how shall i start design my class? Java: Class C#: Partial Class, Class As above in C#, how shall we choose…
junnyea
  • 471
  • 6
  • 8
0
votes
1 answer

ASP.Net (3.5) MVC partial class for rule validation

I have 2 projects. A data project, which contains my database and my Entity Framework model. I have table called 'User', and then have a generated EF class for user. I am trying to add a partial class: using System; using…
Craig
  • 18,074
  • 38
  • 147
  • 248
0
votes
1 answer

Annotate asp.net properties in MVC auto generated class

I have an auto generated partial class in my Model folder with lots of properties and I need to modify some of the setters in these properties(annotate property). To ensure that I don't repeat myself in the future(after a refresh) I have another…
H35am
  • 768
  • 2
  • 12
  • 32
0
votes
2 answers

Controller class with own configuration class

I have several controller classes which use their own configuration classes that set controller classes behavior. I have controller resolver that picks up desired controller by its name. Now I want another resolver to bind controller class with its…
Szybki
  • 1,083
  • 14
  • 29
0
votes
1 answer

Sequence of execution of Partial classes in C#

I have seen there are two partial classes of same class(FORM) in C# winforms. 1. Form1.cs 2. Form1.Designer.cs In which changes made in Designer effects the layout of form at same time (without compilation) but the changes made in form1.cs (code…
Javed Akram
  • 15,024
  • 26
  • 81
  • 118
0
votes
1 answer

Xamarin PCL how to add data attribute to existing partial classes (fields)

We have an autogenerated class with a field id and we want to add a data attribute [PrimaryKey] to it. The problem we got is that it doesn't recognize [MetadataType] even though we have the System.ComponentModel.DataAnnotations packages added. Code…
0
votes
2 answers

Multiple partial classes with a single namespace returning error

I've declared a partial class with name "BusinessLayer" in BL namespace, but now I want to add another class with same name, and with keyword "partial" in that namespace. But Whenever I try to add class with with name "BusinessLayer", I'm getting an…
Dusk
  • 2,191
  • 6
  • 38
  • 57
0
votes
1 answer

Partial Class Instance Initialization Null Reference Exception

I have a service with reference code below: [System.Xml.Serialization.SoapTypeAttribute(Namespace="urn:customer")] public partial class Receipt : object, System.ComponentModel.INotifyPropertyChanged { private int counternoField; private…
0
votes
1 answer

Partial Classes and Interfaces

Suppose I have the following set up: Public Interface IA Property Name() Property Id() ... End Interface //Custom File Partial Public Class A ... Mostly Blank - used for extending the generated file End Class //Generated via a tool Partial…
Prescott
  • 7,312
  • 5
  • 49
  • 70
0
votes
1 answer

Xamarin Forms - Allow Two Pages to share the same Code-Behind

Here is my usual structure for a Xamarin Forms Page: LoginPage.cs /// /// UI Code /// public partial class LoginPage : ContentPage { /// /// Created the view content /// private void…
cfly24
  • 1,882
  • 3
  • 22
  • 56