private byte GetValueOrDefault(BinaryEditor binaryEditor)
 {
     if (binaryEditor.IsEnabled)
     {
         return(binaryEditor.ByteValue);
     }
     else
     {
         return(0);
     }
 }
Exemple #2
0
        /// <summary>
        /// 右侧ListView双击事件
        /// </summary>
        internal static void OnListViewDoubleClickAction()
        {
            if (MainForm.main.listView_Registry.SelectedItems.Count.Equals(1))
            {
                cRegValue value = (cRegValue)MainForm.main.listView_Registry.SelectedItems[0].SubItems[2].Tag;
                if (value.ParentKey != null)
                {
                    Registry_ValueEditor editor = null;

                    switch (value.Kind)
                    {
                    case RegistryValueKind.String:
                    case RegistryValueKind.ExpandString:
                        editor = new StringEditor(value);
                        break;

                    case RegistryValueKind.Binary:
                        editor = new BinaryEditor(value);
                        break;

                    case RegistryValueKind.DWord:
                    case RegistryValueKind.QWord:
                        editor = new DWordQWordEditor(value);
                        break;

                    case RegistryValueKind.MultiString:
                        editor = new MultiStringEditor(value);
                        break;

                    case RegistryValueKind.Unknown:
                    case RegistryValueKind.None:
                        break;

                    default:
                        break;
                    }

                    if (editor != null)
                    {
                        if (editor.ShowDialog(MainForm.main) == DialogResult.OK)
                        {
                            RefreshValues();
                        }
                    }
                }
            }
        }
Exemple #3
0
        private void OnValueEditAction()
        {
            if (lstValues.SelectedItems.Count == 1)
            {
                RegValue value = (RegValue)lstValues.SelectedItems[0].SubItems[2].Tag;
                if (value.ParentKey != null)
                {
                    ValueEditor editor = null;

                    switch (value.Kind)
                    {
                    case RegistryValueKind.Binary:
                        editor = new BinaryEditor(value);
                        break;

                    case RegistryValueKind.MultiString:
                        editor = new MultiStringEditor(value);
                        break;

                    case RegistryValueKind.DWord:
                    case RegistryValueKind.QWord:
                        editor = new DWordEditor(value);
                        break;

                    case RegistryValueKind.String:
                    case RegistryValueKind.ExpandString:
                        editor = new StringEditor(value);
                        break;

                    case RegistryValueKind.Unknown:
                    default:
                        break;
                    }

                    if (editor != null)
                    {
                        if (editor.ShowDialog(this) == DialogResult.OK)
                        {
                            RefreshValues();
                        }
                    }
                }
            }
        }