Beispiel #1
0
        public void RemoveFullDetailsItem(TreeItem ti)
        {
            if (IsSelectedProfileWritable)
            {
                // Prompt the user for confirmation in the cases where we are removing a group, or
                // the property also appears in the preview details, and so will be removed there too
                MessageBoxResult ans = MessageBoxResult.Yes;
                if ((PropType)ti.Item == PropType.Group)
                {
                    ans = MessageBox.Show(String.Format(LocalizedMessages.RemovePropertyGroupQuestion, ti.Name),
                                          LocalizedMessages.RemovePropertyGroupHeader, MessageBoxButton.YesNo);
                }
                else if (SelectedProfile.HasPropertyInPreviewDetails(ti.Name) || SelectedProfile.HasPropertyInInfoTip(ti.Name))
                {
                    ans = MessageBox.Show(String.Format(LocalizedMessages.RemovePropertyQuestion, ti.Name),
                                          LocalizedMessages.RemovePropertyHeader, MessageBoxButton.YesNo);
                }

                if (ans == MessageBoxResult.Yes)
                {
                    SelectedProfile.RemoveFullDetailsItem(ti);
                    IsDirty = true;
                }
            }
        }