Ejemplo n.º 1
0
 public IActionResult SystemUserRemove(string id)
 {
     try
     {
         if (!string.IsNullOrEmpty(id))
         {
             //Check Empty Guid
             Guid userid = new Guid(id);
             if (userid != Guid.Empty)
             {
                 //Delete
                 APIReturnModel delete = SystemUserService.DeleteSystemUsers(id);
                 return(Ok(new { data = delete.Value, status = StatusMessages.Get(delete.Status) }));
             }
             else
             {
                 //Passed User ID is empty guid
                 return(Ok(new { data = string.Empty, status = StatusMessages.Error_UserDeleteFailed_GUID }));
             }
         }
         else
         {
             //Passed User ID is empty guid
             return(Ok(new { data = string.Empty, status = StatusMessages.Error_UserDeleteFailed_GUID }));
         }
     }
     catch
     {
     }
     return(Ok(new { data = string.Empty, status = StatusMessages.Error_Failed }));
 }
        async public Task <StatusMessages> ExpensivePaymentGateway(PaymentCardDetails _PaymentCardDetails)
        {
            StatusMessages _StatusMessages = new StatusMessages();

            var _SampleCardDetails = await SampleCardDetails(_PaymentCardDetails);

            if (_SampleCardDetails != null)
            {
                _StatusMessages.Status  = "Success";
                _StatusMessages.Message = "Success";
            }
            else
            {
                var TryCheapPaymentGateway = await CheapPaymentGateway(_PaymentCardDetails);

                if (TryCheapPaymentGateway != null)
                {
                    _StatusMessages.Status  = "Success";
                    _StatusMessages.Message = "Success";
                }
                else
                {
                    _StatusMessages.Status  = "Failed";
                    _StatusMessages.Message = "Not Found";
                }
            }


            return(_StatusMessages);
        }
Ejemplo n.º 3
0
 public static void Add(this StatusMessages statusMessages, int statusCode)
 {
     statusMessages.Add(new StatusMessage()
     {
         StatusCode = statusCode
     });
 }
        async public Task <StatusMessages> PremiumPaymentService(PaymentCardDetails _PaymentCardDetails)
        {
            StatusMessages _StatusMessages = new StatusMessages();

            var _SampleCardDetails = await SampleCardDetails(_PaymentCardDetails);

            if (_SampleCardDetails != null)
            {
                _StatusMessages.Status  = "Success";
                _StatusMessages.Message = "Success";
            }
            else
            {
                for (var k = 0; k < 1; k++)
                {
                    _SampleCardDetails = await SampleCardDetails(_PaymentCardDetails);

                    if (_SampleCardDetails != null)
                    {
                        _StatusMessages.Status  = "Success";
                        _StatusMessages.Message = "Success";
                        break;
                    }
                    else
                    {
                        _StatusMessages.Status  = "Failed";
                        _StatusMessages.Message = "Not Found";
                    }
                }
            }


            return(_StatusMessages);
        }
Ejemplo n.º 5
0
        public IActionResult Post([FromBody] SystemUserModel model)
        {
            try
            {
                if (!string.IsNullOrEmpty(model.Id))
                {
                    //Check Empty Guid
                    Guid userid = new Guid(model.Id);
                    if (userid != Guid.Empty)
                    {
                        //Update
                        APIReturnModel update = SystemUserService.UpdateSystemUsers(model);
                        return(Ok(new { data = update.Value, status = StatusMessages.Get(update.Status) }));
                    }
                    else
                    {
                        //Passed User ID is empty guid
                        return(Ok(new { data = string.Empty, status = StatusMessages.Error_UserUpdateFailed_GUID }));
                    }
                }
                else
                {
                    //Insert
                    APIReturnModel create = SystemUserService.CreateSystemUsers(model);
                    return(Ok(new { data = create.Value, status = StatusMessages.Get(create.Status) }));
                }
            }
            catch
            {
            }

            return(Ok(new { data = string.Empty, status = StatusMessages.Error_Failed }));
        }
Ejemplo n.º 6
0
 /// <summary>
 /// Set status message in any color
 /// </summary>
 /// <param name="message"></param>
 /// <param name="color"></param>
 public void SetStatusMessage(string message, Brush color)
 {
     StatusColor = color;
     StatusMessages.Add(new StatusMessage {
         MessageText = message
     });
     StatusText = message;
 }
Ejemplo n.º 7
0
 /// <summary>
 /// Set status message with black color
 /// </summary>
 /// <param name="message"></param>
 public void SetStatusMessage(string message)
 {
     StatusColor = Black;
     StatusMessages.Add(new StatusMessage {
         MessageText = message
     });
     StatusText = message;
 }
        //Update status message
        private void StatusMessage(String MessageText)
        {
            StatusMessages.Text = DateTime.Now.ToString("HH:mm:ss") + ":" + MessageText + " \n" + StatusMessages.Text;
            StatusMessages.Invalidate();
            StatusMessages.Refresh();

            TaskScheduler.FromCurrentSynchronizationContext();
        }
Ejemplo n.º 9
0
 /// <summary>
 /// Set status message with red font color.
 /// </summary>
 /// <param name="message"></param>
 public void SetStatusMessageWarning(string message, Exception ex = null)
 {
     StatusColor = Red;
     StatusMessages.Add(new StatusMessage {
         MessageText = message, Data = ex
     });
     StatusText = message;
 }
        public void CheckChargeState(float soc)
        {
            float minStateOfCharge = 20;
            float maxStateOfCharge = 80;

            CheckBatteryLevel(soc, minStateOfCharge, maxStateOfCharge);
            BatteryCondition.BatteryLevel batteryChargeState = BatteryCondition.CheckBatteryCondition(soc, minStateOfCharge, maxStateOfCharge);
            StatusMessages.DisplayBatteryStatus("State of charge", batteryChargeState, report);
        }
Ejemplo n.º 11
0
        public static void CheckMinBreachLevel(float chargeLevel, float chargeValue, float minValue)
        {
            float chargeRate = chargeLevel + minValue;

            if (minValue <= chargeValue && chargeValue <= chargeRate)
            {
                StatusMessages.DisplayWarningMessage(BatteryCondition.Warnings.Discharge);
            }
        }
Ejemplo n.º 12
0
        public static void CheckMaxBreachLevel(float chargeLevel, float chargeValue, float maxValue)
        {
            float chargeRate = maxValue - chargeLevel;

            if (chargeValue <= maxValue && chargeRate <= maxValue)
            {
                StatusMessages.DisplayWarningMessage(BatteryCondition.Warnings.ChargePeak);
            }
        }
        public void CheckTemperature(float temperature)
        {
            float minTemperature = 0;
            float maxTemperature = 45;

            CheckBatteryLevel(temperature, minTemperature, maxTemperature);
            BatteryCondition.BatteryLevel batteryTemperature = BatteryCondition.CheckBatteryCondition(temperature, minTemperature, maxTemperature);
            StatusMessages.DisplayBatteryStatus("Temperature", batteryTemperature, report);
        }
        public void CheckChargeRate(float chargeRate)
        {
            float minChargeRate = 0.3f;
            float maxChargeRate = 0.8f;

            CheckBatteryLevel(chargeRate, minChargeRate, maxChargeRate);
            BatteryCondition.BatteryLevel batteryChargeRate = BatteryCondition.CheckBatteryCondition(chargeRate, minChargeRate, maxChargeRate);
            StatusMessages.DisplayBatteryStatus("Charge Rate", batteryChargeRate, report);
        }
Ejemplo n.º 15
0
        private void addToLog(String strMessege)
        {
            this.Invoke((MethodInvoker) delegate()
            {
                String ws = strMessege.Replace("\n", Environment.NewLine) + Environment.NewLine;
                StatusMessages.AppendText(ws);

                LogToExternalFile(ws);
            });
        }
        async public Task <StatusMessages> SavePaymentStatus(PaymentCardDetails _PaymentCardDetails)
        {
            StatusMessages _StatusMessages = new StatusMessages();

            await _PaymentAccessPortalContext.AddAsync(_PaymentCardDetails);

            _PaymentAccessPortalContext.SaveChanges();

            return(_StatusMessages);
        }
Ejemplo n.º 17
0
        /// <summary>
        /// Adds a status message
        /// </summary>
        /// <param name="statusMessageText">The text of the status message</param>
        /// <param name="phoneNumber">The phone number associated with the SMS that this status message describes</param>
        /// <remarks>
        /// For example, if the server receives a message from phone number 555-454-3455 updating contact C-0830 to 'seen
        /// and healthy' then we would assume the status message collection would eventually contain a message stating that,
        /// so that anyone reading those status messages could see that such an action had taken place.
        /// </remarks>
        private void AddStatusMessage(string statusMessageText, string phoneNumber)
        {
            SmsStatusMessage message = new SmsStatusMessage();

            message.StatusMessage = DateTime.Now.ToShortDateString() + " " + DateTime.Now.ToShortTimeString() + " " + phoneNumber + " : " + statusMessageText;
            lock (_statusMessagesLock)
            {
                StatusMessages.Add(message);
                Epi.Logger.Log(message.StatusMessage);
            }
        }
Ejemplo n.º 18
0
        /// <summary>
        /// Show status messages in status bar context menu
        /// </summary>
        private void ShowMessages()
        {
            if (StatusWindow == null)
            {
                StatusWindow         = new StatusMessages(this);
                StatusWindow.Closed += (a, b) => StatusWindow = null;
            }

            StatusWindow.Show();
            StatusWindow.Activate();
        }
Ejemplo n.º 19
0
        private void AddStatusMessage(string message, bool isError = false)
        {
            StatusMessage = message;

            var statusMessageViewModel = new StatusMessageViewModel()
            {
                Timestamp = DateTimeOffset.Now,
                Message   = message,
                IsError   = isError
            };

            StatusMessages.Add(statusMessageViewModel);
        }
Ejemplo n.º 20
0
 public LoggingStatus()
 {
     InitializeComponent();
     statusMessages = new StatusMessages();
     if (System.ComponentModel.DesignerProperties.GetIsInDesignMode(this))
     {
         PostMessage(Severity.Info, "Info Message");
         PostMessage(Severity.Warning, "Warning Message");
         PostMessage(Severity.Error, "Error Message");
         PostMessage(Severity.Critical, "Critical Message");
     }
     cbStatusList.DataContext = statusMessages;
 }
Ejemplo n.º 21
0
        private void Reset()
        {
            AlbumNameTextBox.Text = string.Empty;
            ArtistTextBox.Text    = string.Empty;

            SetAlbumNameCheckBox.IsChecked  = true;
            SetTitleCheckBox.IsChecked      = true;
            SetArtistNameCheckBox.IsChecked = true;

            AudiobookTitles.Clear();
            AudiobookFiles.Clear();
            StatusMessages.Clear();
        }
Ejemplo n.º 22
0
        private void DisconnectCommandExecute()
        {
            OutbreakName = "Not connected to a database";

            Project.Dispose();
            Project = null;

            SmsController.Dispose();
            SmsController = null;

            StatusMessages.Clear();
            DiagnosticCommandResults.Clear();

            IsConnectedToDatabase = false;
            IsConnectedToModem    = false;
        }
Ejemplo n.º 23
0
        public StatusMessages GetStatusMessages(bool isSuccess = false)
        {
            StatusMessages messages = new StatusMessages();

            if (isSuccess)
            {
                messages.StatusCode = "1";
                messages.Message    = "Success";
            }
            else
            {
                messages.StatusCode = "0";
                messages.Message    = "Error";
            }
            return(messages);
        }
Ejemplo n.º 24
0
 //
 // GET: /Admin/
 public ActionResult Admin(StatusMessages? statusMessage)
 {
     //Cargamos las categorías ya existentes.
     List<SelectListItem> categoriasExistentes = CargadorSelectItems.cargarCategoriasExistentes();
     AdminModel model = new AdminModel();
     CategoriaEliminar modeloEliminar = new CategoriaEliminar();
     modeloEliminar.categoriasExistentes = categoriasExistentes;
     if(statusMessage == StatusMessages.CategoriaExistente){
         ViewBag.StatusMessage = "La categoría ya existe";
         ViewBag.msgType = "message-error";
     }
     if (statusMessage == StatusMessages.CategoriaAgregada)
     {
         ViewBag.StatusMessage = "Categoría añadida correctamente!";
         ViewBag.msgType = "message-success";
     }
     model.modeloEliminar = modeloEliminar;
     return View(model);
 }
Ejemplo n.º 25
0
    void Start()
    {
        time                = 0;
        passengers          = 0;
        statusColor         = new Color(73, 238, 21, 1);
        noPassengers.text   = (passengers < 10 ? "0" : "") + passengers;
        multiplierText.text = "x1";
        rb           = GetComponent <Rigidbody>();
        drive        = GetComponent <RearWheelDrive>();
        statusMes    = GetComponent <StatusMessages>();
        audioManager = FindObjectOfType <AudioManager>();

        foreach (GameObject group in passengerGroups)
        {
            group.SetActive(false);
        }

        drive.Toggle();
        StartCoroutine(LevelStart());
    }
        public IActionResult passwordEdit(int userId, [FromBody] NewPasswordForEditDto newPasswordForEditDto)
        {
            try
            {
                var currentUserId = int.Parse(User.FindFirst(ClaimTypes.NameIdentifier).Value);
                if (currentUserId == userId)
                {
                    User user     = _userDal.GetUserById(userId);
                    var  authUser = _authRepositoryUser.Login(user.NameSurname, newPasswordForEditDto.currentPassword);
                    if (authUser == null)
                    {
                        StatusMessages statusMessages = new StatusMessages();
                        statusMessages.message = "Password is not correct!";
                        return(Ok(statusMessages));
                    }

                    using (var hmac = new System.Security.Cryptography.HMACSHA512())
                    {
                        user.PasswordHash = hmac.Key;
                        user.PasswordSalt = hmac.ComputeHash(System.Text.Encoding.UTF8.GetBytes(newPasswordForEditDto.newPassword)); ///////////////////*******************************
                    }
                    //byte[] passwordHash, passwordSalt;
                    //_authRepository.CreatePasswordHash(newPasswordForEditDto.newPassword, out passwordHash, out passwordSalt);
                    //user.PasswordHash = passwordHash;
                    //user.PasswordSalt = passwordSalt;

                    _userDal.Update(user);

                    return(Ok(201));
                }
                else
                {
                    return(NotFound(404));
                }
            }
            catch
            {
                return(NotFound(404));
            }
        }
Ejemplo n.º 27
0
        public static string GetStatusMessage(StatusMessages status)
        {
            string statusMessage = "";

            switch (status)
            {
            case StatusMessages.SuccessfullInsertNewUser:
                statusMessage = "Successfull insert new user";
                break;

            case StatusMessages.SuccessfullUpdateUser:
                statusMessage = "Successfull update user";
                break;

            case StatusMessages.SuccessfullDeleteUser:
                statusMessage = "Successfull delete user";
                break;

            case StatusMessages.SuccessfullInsertNewRole:
                statusMessage = "Successfull insert new role";
                break;

            case StatusMessages.SuccessfullUpdateRole:
                statusMessage = "Successfull update role";
                break;

            case StatusMessages.SuccessfullDeleteRole:
                statusMessage = "Successfull delete role";
                break;

            case StatusMessages.UserAlreadyExist:
                statusMessage = "This user already exist.";
                break;

            case StatusMessages.RoleAlreadyExist:
                statusMessage = "This role already exist in this application.";
                break;
            }
            return(statusMessage);
        }
        public async Task <IActionResult> OnPostAsync(string returnUrl = null)
        {
            returnUrl      = returnUrl ?? Url.Content("~/");
            ExternalLogins = (await _signInManager.GetExternalAuthenticationSchemesAsync()).ToList();
            if (ModelState.IsValid)
            {
                var phoneNumber = Helpers.SanitizePhone(Input.PhoneNumber);
                if (await userService.PhoneNumberInUseAsync(phoneNumber))
                {
                    StatusMessages.Add(GlobalConstants.PhoneAlreadyUsedError(phoneNumber));
                    return(Page());
                }

                var user = new UserGE {
                    UserName = Input.UserName, PhoneNumber = phoneNumber
                };
                var result = await _userManager.CreateAsync(user, Input.Password);

                if (result.Succeeded)
                {
                    var adminRoleName = GlobalConstants.AdministratorRole;
                    await EnsureRoleExists(adminRoleName);
                    await AssignRoleToFirstNUsers(GlobalConstants.AdminsCount, user, adminRoleName);

                    _logger.LogInformation("User created a new account with password.");
                    cache.Remove(GlobalConstants.StatisticsCasheName);
                    StatusMessages.Add("Successfull Registration!");
                    Thread.Sleep(1000);

                    await _signInManager.SignInAsync(user, isPersistent : true);

                    return(LocalRedirect(returnUrl));
                }

                StatusMessages = result.Errors.Select(x => "Error: " + x.Description).ToList();
            }

            return(Page());
        }
Ejemplo n.º 29
0
        /// <summary>
        /// All button presses are routed via comamnds here which do execute one of these commands
        /// </summary>
        /// <returns></returns>
        private Dictionary <string, ICommand> CreateUICommands()
        {
            Dictionary <string, ICommand> commands = new Dictionary <string, ICommand>
            {
                { "LogSlow", CreateCommand(_ => Hooker.LogSlowEvent()) },
                { "LogFast", CreateCommand(_ => Hooker.LogFastEvent()) },
                { "Config", CreateCommand(_ => ShowConfigDialog()) },
                { "TraceRefresh", CreateCommand(_ =>
                    {
                        TraceSessions = LocalTraceControler.GetTraceSessions();
                        WCFHost.GetTraceSessions.Execute();
                    }) },
                { "StartTracing", CreateCommand(_ => StartTracing()) },
                { "StopTracing", CreateCommand(_ => StopTracing()) },
                { "CancelTracing", CreateCommand(_ => CancelTracing()) },
                { "RegisterETWProvider", CreateCommand(_ =>
                    {
                        string output = HookEvents.RegisterItself();
                        SetStatusMessage("Registering ETW provider: " + output);
                    }) },
                { "ConfigReset", CreateCommand(_ => {
                        Configuration.Default.Reset();
                        Configuration.Default.Save();
                        LoadSettings();
                    }) },
                { "ShowMessages", CreateCommand(_ => ShowMessages()) },
                { "NetworkSendToggle", CreateCommand(_ => NetworkSendState.NetworkSendChangeState()) },
                { "NetworkReceiveToggle", CreateCommand(_ => NetworkReceiveState.NetworkReceiveChangeState()) },
                { "ClearStatusMessages", CreateCommand(_ => StatusMessages.Clear()) },
                { "ShowCommandLineOptions", CreateCommand(_ => ShowCommandLineOptions()) },
                { "About", CreateCommand(_ => AboutBox()) },
            };


            return(commands);
        }
Ejemplo n.º 30
0
        private void WriteOutput(string text, OutputMessageLevel level, bool removeLastItem = false)
        {
            var messageColor = Colors.Gray;

            switch (level)
            {
            case OutputMessageLevel.Normal:
                messageColor = Colors.Black;
                break;

            case OutputMessageLevel.Informational:
                messageColor = Colors.Gray;
                break;

            case OutputMessageLevel.Success:
                messageColor = Colors.Green;
                break;

            case OutputMessageLevel.Warning:
                messageColor = Colors.Goldenrod;
                break;

            case OutputMessageLevel.Error:
                messageColor = Colors.Red;
                break;
            }

            if (this.Dispatcher.CheckAccess())
            {
                if (removeLastItem && StatusMessages.Count > 0)
                {
                    StatusMessages.Remove(StatusMessages.LastOrDefault());
                }

                var message = new OutputMessage
                {
                    Message      = text,
                    MessageColor = messageColor
                };

                StatusMessages.Add(message);
                StatusListBox.ScrollIntoView(message);
            }
            else
            {
                this.Dispatcher.Invoke(() =>
                {
                    if (removeLastItem && StatusMessages.Count > 0)
                    {
                        StatusMessages.Remove(StatusMessages.LastOrDefault());
                    }

                    var message = new OutputMessage
                    {
                        Message      = text,
                        MessageColor = messageColor
                    };

                    StatusMessages.Add(message);
                    StatusListBox.ScrollIntoView(message);
                });
            }
        }
Ejemplo n.º 31
0
        void backgroundWorkerNewsFeed_DoWork(object sender, DoWorkEventArgs e)
        {
            try
            {
                if (e != null)
                {
                    if (e.Cancel)
                    {
                        return;
                    }
                }
                dynamic parameters = new ExpandoObject();

                if (!IsInitialFetch && LastUpdate != null)
                {
                    // danach kamen keine Updates mehr durch :(
                    //  parameters.since = GetUnixTimestamp(LastUpdate).ToString();
                }

                string[] feeds = { "home", "feed" };

                foreach (string feedName in feeds)
                {
                    dynamic result = facebookClient.Get("/me/" + feedName, parameters); // Home

                    if (result != null)
                    {
                        foreach (dynamic post in result.data)
                        {
                            if (e != null)
                            {
                                if (e.Cancel)
                                {
                                    return;
                                }
                            }
                            FacebookItem item = FacebookItem.ConvertResponseToItem(post, this);
                            if (item == null)
                            {
                                AppController.Current.Logger.writeToLogfile("Null item in facebook retrieval");
                                continue;
                            }

                            FacebookItem ExistingItem = null;
                            try
                            {
                                switch (item.MessageType)
                                {
                                case FacebookItem.MessageTypes.Link:
                                    if (Links.Where(oldItem => oldItem.fullId == item.fullId).Count() > 0)
                                    {
                                        ExistingItem = Links.Where(oldItem => oldItem.fullId == item.fullId).First();
                                    }

                                    break;

                                case FacebookItem.MessageTypes.Video:
                                    if (Videos.Where(oldItem => oldItem.fullId == item.fullId).Count() > 0)
                                    {
                                        ExistingItem = Videos.Where(oldItem => oldItem.fullId == item.fullId).First();
                                    }

                                    break;

                                case FacebookItem.MessageTypes.Photo:
                                    if (Photos.Where(oldItem => oldItem.fullId == item.fullId).Count() > 0)
                                    {
                                        ExistingItem = Photos.Where(oldItem => oldItem.fullId == item.fullId).First();
                                    }

                                    break;

                                case FacebookItem.MessageTypes.Note:
                                    if (Notes.Where(oldItem => oldItem.fullId == item.fullId).Count() > 0)
                                    {
                                        ExistingItem = Notes.Where(oldItem => oldItem.fullId == item.fullId).First();
                                    }

                                    break;

                                case FacebookItem.MessageTypes.Event:
                                    if (Events.Where(oldItem => oldItem.fullId == item.fullId).Count() > 0)
                                    {
                                        ExistingItem = Events.Where(oldItem => oldItem.fullId == item.fullId).First();
                                    }

                                    break;

                                case FacebookItem.MessageTypes.CheckIn:
                                    if (CheckIns.Where(oldItem => oldItem.fullId == item.fullId).Count() > 0)
                                    {
                                        ExistingItem = CheckIns.Where(oldItem => oldItem.fullId == item.fullId).First();
                                    }

                                    break;

                                default:
                                    if (StatusMessages.Where(oldItem => oldItem.fullId == item.fullId).Count() > 0)
                                    {
                                        ExistingItem = StatusMessages.Where(oldItem => oldItem.fullId == item.fullId).First();
                                    }

                                    break;
                                }
                            }
                            catch
                            {
                                ExistingItem = null;
                            }
                            if (ExistingItem == null)
                            {
                                try
                                {
                                    dynamic comments = facebookClient.Get("/" + item.fullId + "/comments", parameters);
                                    item.Comments.Clear();
                                    if (comments != null)
                                    {
                                        if (comments.data != null)
                                        {
                                            AppController.Current.Logger.writeToLogfile("Facebook item has comments/data");
                                            foreach (dynamic fbcomment in comments.data)
                                            {
                                                AppController.Current.Logger.writeToLogfile("Reading comment");
                                                FacebookComment comment = new FacebookComment(fbcomment);
                                                comment.Account = item.Account;
                                                if (comment.User.Id == this.Id.ToString())
                                                {
                                                    item.isCommented = true;
                                                }
                                                item.Comments.Add(comment);
                                            }
                                        }
                                    }
                                }
                                catch { }
                                item.ReceivingAccount = this;
                                backgroundWorkerNewsFeed.ReportProgress(100, item);
                                continue;
                            }
                            else
                            {
                                if (item.LikesCount != ExistingItem.LikesCount)
                                {
                                    item.HasUpdatedLikes = true;
                                }

                                List <FacebookComment> updatedComments = new List <FacebookComment>();
                                foreach (FacebookComment comment in item.Comments)
                                {
                                    if (e != null)
                                    {
                                        if (e.Cancel)
                                        {
                                            return;
                                        }
                                    }
                                    if (ExistingItem.Comments.Where(c => c.Text == comment.Text && c.User.Id == comment.User.Id).Count() == 0)
                                    {
                                        updatedComments.Add(comment);
                                    }
                                }

                                if (updatedComments.Count > 0)
                                {
                                    item.HasUpdatedComments = true;
                                    item.Comments.Clear();
                                    foreach (FacebookComment comment in updatedComments)
                                    {
                                        item.Comments.Add(comment);
                                    }
                                }
                                if (item.HasUpdatedComments || item.HasUpdatedLikes)
                                {
                                    item.ReceivingAccount = this;
                                    backgroundWorkerNewsFeed.ReportProgress(100, item);
                                }
                                else
                                {
                                    item = null;
                                }
                            }
                        }
                    }
                }
            }
            catch (FacebookOAuthException oauthExp)
            {
                AppController.Current.Logger.writeToLogfile(oauthExp);
            }
            catch (Exception exp)
            {
                AppController.Current.Logger.writeToLogfile(exp);;
            }
        }