Пример #1
0
        void BtnGCNGToggleClick(object sender, EventArgs e)
        {
            String fct = "togglepublishnotifications";

            try
            {
                if (!SpecialFeatures.SpecialFeaturesMgt.AreSpecialFeaturesEnabled())
                {
                    return;
                }
                CookieContainer cookieJar = _daddy.CheckGCAccount(true, false);
                if (cookieJar == null)
                {
                    return;
                }

                List <GCNotification> associatedGCN;
                List <String>         ids = GetSelectedIds(out associatedGCN);
                if (ids.Count == 0)
                {
                    _daddy.MsgActionWarning(this, _daddy.GetTranslator().GetString("LblErrorNoSelectionElt"));
                    return;
                }


                DialogResult dialogResult = MessageBox.Show(_daddy.GetTranslator().GetString("AskConfirm"),
                                                            _daddy.GetTranslator().GetString(fct),
                                                            MessageBoxButtons.YesNo, MessageBoxIcon.Question);
                if (dialogResult == DialogResult.Yes)
                {
                    foreach (String id in ids)
                    {
                        NotificationsManager.ToggleNotificationsImpl(_daddy, id, cookieJar);
                    }

                    PopulateList();
                    _daddy.MsgActionDone(this);
                }
            }
            catch (Exception ex)
            {
                _daddy.ShowException("", _daddy.GetTranslator().GetString(fct), ex);
            }
        }