public SforceService()
{
}
This syntax is for a constructor which is called when creating the class. The name must be the same as the class name.
If you want a method with no return type use void
public void SforceServiceSandbox()
{
}
It looks like you want one class to handle 2 scenerios. In which case you have two options,
Two classes
public class SforceService
{
public SforceService() {
this.Url = global::email2case_winForm.Properties.Settings.Default.email2case_sforce_SforceService;
if ((this.IsLocalFileSystemWebService(this.Url) == true)) {
this.UseDefaultCredentials = true;
this.useDefaultCredentialsSetExplicitly = false;
}
else {
this.useDefaultCredentialsSetExplicitly = true;
}
}
}
public class SforceServiceSandbox
{
public SforceServiceSandbox()
{
this.Url = global::email2case_winForm.Properties.Settings.Default.SForceService;
if ((this.IsLocalFileSystemWebService(this.Url) == true))
{
this.UseDefaultCredentials = true;
this.useDefaultCredentialsSetExplicitly = false;
}
else
{
this.useDefaultCredentialsSetExplicitly = true;
}
}
}
Or one class where you pass in a url
public class SforceService
{
private SforceService() { }
public SforceService(TypeOfUrl url)
{
this.Url = url;
if ((this.IsLocalFileSystemWebService(this.Url) == true))
{
this.UseDefaultCredentials = true;
this.useDefaultCredentialsSetExplicitly = false;
}
else
{
this.useDefaultCredentialsSetExplicitly = true;
}
}
}