|
using System.ComponentModel;
using System.Threading;
namespace SchoolSample.WCFService.SchoolService
{
public partial class SchoolServiceClient : ISchoolServiceClient
{
#region "Singleton"
private static readonly ISchoolServiceClient instance = new SchoolServiceClient("BasicHttpBinding_ISchoolService");
public static ISchoolServiceClient Instance
{
get { return instance; }
}
#endregion "Singleton"
#region "Active Call Count"
private int _activeCallCount;
public int ActiveCallCount
{
get { return _activeCallCount; }
}
public void DecrementCallCount()
{
Interlocked.Decrement(ref _activeCallCount);
if (_activeCallCount == 0)
OnPropertyChanged("ActiveCallCount");
}
public void IncrementCallCount()
{
Interlocked.Increment(ref _activeCallCount);
if (_activeCallCount == 1)
OnPropertyChanged("ActiveCallCount");
}
#endregion "Active Call Count"
#region "INotifyPropertyChanged Interface implementation"
public event PropertyChangedEventHandler PropertyChanged;
protected virtual void OnPropertyChanged(string propertyName)
{
if (PropertyChanged != null)
{
PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
}
}
#endregion "INotifyPropertyChanged Interface implementation"
}
}
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
Weidong has been an information system professional since 1990. He has a Master's degree in Computer Science, and is currently a MCSD .NET