public void Destroy()
 {
     if (taskNetwork != null)
     {
         taskNetwork.Cancel();
         taskNetwork = null;
     }
 }
        public void NetworkAnalysis(ServerContent server, ProfileNetwork profile)
        {
            if (server == null)
            {
                throw new NetworkException("The remote service isn't ready for profile network");
            }

            if (profile == ProfileNetwork.LIGHT)
            {
                taskNetwork = new ProfileNetworkLight(server);
            }
            else if (profile == ProfileNetwork.DEFAULT)
            {
                taskNetwork = new ProfileNetworkDefault(server);
            }
            else if (profile == ProfileNetwork.FULL)
            {
                taskNetwork = new ProfileNetworkFull(server);
            }

            EventIntercept();

            taskNetwork.Execute();
        }