1

Iam having a trouble when integrating this exteremly brilliant solution enter link description here in my winform application that will read/write data at the same time . I have compiling errors : First : Error CS0262 Partial declarations of 'Client' have conflicting accessibility modifiers
Second : Error CS0535 'Client' does not implement interface member 'IDisposable.Dispose()'
in this part of code which is red-highlited :

 public sealed partial class Client : IDisposable
Community
  • 1
  • 1
  • 1
    all your partial classes with same name (which together become single class) need to have same access modifiers. for example all have to be `public` or all have to be `internal` – M.kazem Akhgary May 16 '16 at 16:33
  • Restore the original. Right-click the identifier > Refactor > Rename. – Hans Passant May 16 '16 at 16:40
  • may i ask another question please : in the file Client.Sender.cs , internal void SendData ,"transition the data to the thread and send it" , how is it possible to transition the data to the thread (private void run()) ? – Ahmed Aek Ben Jemia May 17 '16 at 09:11

2 Answers2

2

The first error is because your Client class has Partial classes where the accessibility is different. e.g. you would get the same error if you had the following:

public partial class MyClassName
{
    //rest of code
}

and

protected partial class MyClassName
{
    //rest of code
}

where the classes are in the same namespace. They should either be both public or both protected.

Percy
  • 2,855
  • 2
  • 33
  • 56
1

1 . In Client.Receiver.cs and Client.Sender.cs change class to public

public sealed partial class Client
  1. remove : IDisposable
Shachaf.Gortler
  • 5,655
  • 14
  • 43
  • 71