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
1 answer

Using Partial Classes in WPF

I have done quite a bit of research in the last few months and haven't been able to really find a good answer for my question yet: A little background info: I am new to WPF and was asked to create a project using it. I learned most of the concepts…
Jordan Carroll
  • 696
  • 2
  • 11
  • 29
0
votes
1 answer

How to include a mapping as a base to a new mapping?

Is it possibly to use a mapping from a referenced assembly as a base for a new mapping? The reasoning behind this is there are general objects many applications use, thus they reference the CentralDataLayer.dll. The issue is some applications have…
roydukkey
  • 3,149
  • 2
  • 27
  • 43
0
votes
2 answers

What constraints govern while defining a Partial Class in c#

I searched over net but didn't find any useful information about Constraints/rules while defining a partial class, I mean can all class can be named Partial or some class cannot be? can static class can be partial and all these stuffs, Please…
1Mayur
  • 3,419
  • 5
  • 40
  • 64
0
votes
2 answers

In which condition partial class is implemented?

Possible Duplicate: What is the use of a partial class? In my code ,there is one partial class for creating new company. I can not understand in which condition partial to be implemented. public partial class NewCompanyWindow : Window { …
prjndhi
  • 1,915
  • 4
  • 17
  • 26
0
votes
1 answer

What is a better approach to communicate with tab items than partial class

I have a WPF project which is simply a collection of tens of small tools. I put each tool on a tabitem of a main tabcontrol and wrote a partial MainWinow class for each tabitem. However, since there is very little relationship between the tools, I…
Bob
  • 381
  • 4
  • 14
0
votes
1 answer

Serialization of partial class

I used xsd.exe to create a class from xml schema. It generated several partial classes say one of which is Apple. I have added few fields to Apple. Now I want to serialize the object back to XML, but only according to the original schema. I want to…
Sam
  • 933
  • 5
  • 14
  • 26
-1
votes
1 answer

Partial class problem in c# : not possible to invoke a method correctly

I'm new to c# and just started studying the partial classes topic. Made some practice but I dont understand why when I do run a programm the console stamps only the method from the 1st partial class and completely ignores the second partial class…
Yul P
  • 3
  • 3
-1
votes
2 answers

What is the importance of using the partial keyword when dealing with generated code files?

Microsoft's docs state some reasons why it's a good idea to use partial, one of which deals with generated code files. When working with automatically generated source, code can be added to the class without having to recreate the source file.…
user17138781
-1
votes
1 answer

C# partial class returns null

I'm trying to create populate an infopath template and upload it to sharepoint. I've been following these instructions https://www.codeproject.com/Articles/33228/Programmatically-create-a-browser-enabled-InfoPath Here is a sample of the generated…
Jummi
  • 123
  • 1
  • 13
-1
votes
2 answers

c# Calling method in partial call from another class

I'm making c# app where I need to access method in partial class from another class. To be more specific I want to add items to listview from class that is different from partial class but in same namespace. I tried like this: public partial…
John Doe
  • 89
  • 1
  • 11
-1
votes
2 answers

Partial Class in a separate assembly

I have a partial Class "ClassA" in an assembly MyAssembly. Can I extend this partial class in a separate assembly "MyExtendedAssembly" with the same name "ClassA" When partial classes are not possible in a separate assembly, is there any other way…
Satyajit
  • 1,971
  • 5
  • 28
  • 51
-1
votes
1 answer

.NET - VB - OOP - Partial Class - How to create Partial Constructors

I have a Partial Class in a file MainFile.vb with a constructor like this: Partial Class MyAwesomeClass ' The constructor - Name it MainConstructor Public Sub New(Dim x As Integer) ' Some awesome code here Line1_of_code() …
Ruchir Gupta
  • 990
  • 3
  • 10
  • 20
-1
votes
1 answer

Can I extend a EntityCollection : LINQ to SQL

Can I extend or use partial classes to add more functions to EntityCollection< Class> eg. this is the auto-generated classses from LINQ to SQL customer.Orders I want to be able to do customer.Orders.FindByOrderID(orderID) but Order is…
soldieraman
  • 2,630
  • 7
  • 39
  • 52
-2
votes
2 answers

Inheritance And Partial In Class

public class Car { ...... } is it require to use parent class each time in all partial classes or just first one (and why? good for performance or clean code?) public partial class TwoWheels : Car { ..... (1) } public partial class…
-2
votes
1 answer

How do i access XAML controls from a class other than the main partial class?

How do i access XAML control objects, such as a textbox's properties, from outside of the main partial window class? For example, how would i change some properties of a TextBox who's named x:Name="MyTextBox" from the ServerC class? In other words,…
shawn a
  • 799
  • 3
  • 13
  • 21
1 2 3
29
30