Esempio n. 1
0
        private static void CheckProtocols(IWin32Window parent, ArrayList list)
        {
            string friendlyName = ((IResource)list[0]).GetPropText(_propFriendlyName);
            string message      = Core.ProductFullName + " is not your default " + friendlyName +
                                  ". Would you like to make it your default " + friendlyName + "?";
            string checkBoxText = "&Check if " + Core.ProductFullName + " is the default " + friendlyName + " on startup";

            MessageBoxWithCheckBox.Result result =
                MessageBoxWithCheckBox.ShowYesNo(parent, message, Core.ProductFullName, checkBoxText, true);
            foreach (IResource protocol in list)
            {
                string protocolName = protocol.GetStringProp(PROTOCOL);
                if (!result.Checked)
                {
                    SetCheckNeeded(protocolName, false);
                }
                if (result.IdPressedButton == (int)DialogResult.Yes)
                {
                    SetAsDefaultHandler(protocol, result.Checked);
                }
            }
        }
Esempio n. 2
0
            public override DialogResult ConfirmDeleteResources(IResourceList list, bool permanent, bool showCancel)
            {
                int fromCount, toCount, ccCount;

                CountCorrespondenceCounts(list, out fromCount, out toCount, out ccCount);

                string message = string.Empty;

                if (fromCount + toCount + ccCount > 0)
                {
                    if (fromCount > 0)
                    {
                        message += fromCount + " outcoming items";
                    }
                    if (toCount > 0)
                    {
                        if (message.Length > 0)
                        {
                            if (ccCount > 0)
                            {
                                message += ", ";
                            }
                            else
                            {
                                message += " and ";
                            }
                        }
                        message += toCount + " incoming items";
                    }
                    if (ccCount > 0)
                    {
                        if (message.Length > 0)
                        {
                            message += " and ";
                        }
                        message += ccCount + " Carbon Copy items";
                    }
                    string prefix;
                    if (list.Count == 1)
                    {
                        prefix = "A contact \'" + list[0].DisplayName + "\' has ";
                    }
                    else
                    {
                        prefix = "Selected contacts have ";
                    }
                    message = prefix + message + ".  These items will be moved to Deleted Resources. ";
                }

                message += "Are you sure you wish to delete ";
                if (list.Count == 1)
                {
                    message += "'" + list[0].DisplayName + "'?";
                }
                else
                {
                    message += list.Count + " contacts?";
                }

                MessageBoxWithCheckBox.Result result;
                result = MessageBoxWithCheckBox.ShowYesNo(Core.MainWindow, message, "Delete Contact",
                                                          "&Ignore incoming correspondence from this contact", true);
                SavedIgnoranceValue = result.Checked;
                return((result.IdPressedButton == (int)DialogResult.Yes) ? DialogResult.Yes : DialogResult.No);
            }