Exemplo n.º 1
0
        private void Window_Loaded(object sender, RoutedEventArgs e)
        {
            IncludeNotes     = AppSettings.Global.GetBool(AppSettings.EXPORT_INCLUDE_NOTES, false);
            ShowOffset       = AppSettings.Global.GetBool(AppSettings.EXPORT_SHOW_OFFSET, false);
            ShowAddress      = AppSettings.Global.GetBool(AppSettings.EXPORT_SHOW_ADDR, false);
            ShowBytes        = AppSettings.Global.GetBool(AppSettings.EXPORT_SHOW_BYTES, false);
            ShowFlags        = AppSettings.Global.GetBool(AppSettings.EXPORT_SHOW_FLAGS, false);
            ShowAttr         = AppSettings.Global.GetBool(AppSettings.EXPORT_SHOW_ATTR, false);
            SelectionOnly    = AppSettings.Global.GetBool(AppSettings.EXPORT_SELECTION_ONLY, false);
            LongLabelNewLine =
                AppSettings.Global.GetBool(AppSettings.EXPORT_LONG_LABEL_NEW_LINE, false);
            GenerateImageFiles =
                AppSettings.Global.GetBool(AppSettings.EXPORT_GENERATE_IMAGE_FILES, true);

            int[]  colWidths = new int[] { 16, 8, 18, 100 };  // wide output
            string colStr    = AppSettings.Global.GetString(AppSettings.EXPORT_COL_WIDTHS, null);

            try {
                if (!string.IsNullOrEmpty(colStr))
                {
                    colWidths = TextUtil.DeserializeIntArray(colStr);
                    if (colWidths.Length != 4)
                    {
                        throw new InvalidOperationException("Bad length " + colWidths.Length);
                    }
                }
            } finally {
                AsmLabelColWidth   = colWidths[0];
                AsmOpcodeColWidth  = colWidths[1];
                AsmOperandColWidth = colWidths[2];
                AsmCommentColWidth = colWidths[3];
            }

            TextMode mode = (TextMode)AppSettings.Global.GetEnum(AppSettings.EXPORT_TEXT_MODE,
                                                                 typeof(TextMode), (int)TextMode.PlainText);

            if (mode == TextMode.PlainText)
            {
                TextModePlain = true;
            }
            else
            {
                TextModeCsv = true;
            }
        }