public static DebuggerSettings LoadDebuggerSettings(ILSpySettings settings)
		{
			XElement e = settings[DEBUGGER_SETTINGS];
			DebuggerSettings s = new DebuggerSettings();
			s.ShowWarnings = (bool?)e.Attribute(SHOW_WARNINGS) ?? s.ShowWarnings;
			s.AskForArguments = (bool?)e.Attribute(ASK_ARGUMENTS) ?? s.AskForArguments;
			
			return s;
		}
示例#2
0
		public void Load(ILSpySettings settings)
		{
			XElement e = settings[DEBUGGER_SETTINGS];
			ShowWarnings = (bool?)e.Attribute(SHOW_WARNINGS) ?? ShowWarnings;
			AskForArguments = (bool?)e.Attribute(ASK_ARGUMENTS) ?? AskForArguments;
			ShowAllBookmarks = (bool?)e.Attribute(SHOW_BOOKMARKS) ?? ShowAllBookmarks;
			ShowModuleName = (bool?)e.Attribute(SHOW_MODULE) ?? ShowModuleName;
			ShowArguments = (bool?)e.Attribute(SHOW_ARGUMENTS) ?? ShowArguments;
			ShowArgumentValues = (bool?)e.Attribute(SHOW_ARGUMENTVALUE) ?? ShowArgumentValues;
		}
		public static DecompilerSettings LoadDecompilerSettings(ILSpySettings settings)
		{
			XElement e = settings["DecompilerSettings"];
			DecompilerSettings s = new DecompilerSettings();
			s.AnonymousMethods = (bool?)e.Attribute("anonymousMethods") ?? s.AnonymousMethods;
			s.YieldReturn = (bool?)e.Attribute("yieldReturn") ?? s.YieldReturn;
			s.QueryExpressions = (bool?)e.Attribute("queryExpressions") ?? s.QueryExpressions;
			s.UseDebugSymbols = (bool?)e.Attribute("useDebugSymbols") ?? s.UseDebugSymbols;
			s.ShowXmlDocumentation = (bool?)e.Attribute("xmlDoc") ?? s.ShowXmlDocumentation;
			return s;
		}
		public static DecompilerSettings LoadDecompilerSettings(ILSpySettings settings)
		{
			XElement e = settings["DecompilerSettings"];
			DecompilerSettings s = new DecompilerSettings();
			s.AnonymousMethods = (bool?)e.Attribute("anonymousMethods") ?? s.AnonymousMethods;
			s.YieldReturn = (bool?)e.Attribute("yieldReturn") ?? s.YieldReturn;
			s.AsyncAwait = (bool?)e.Attribute("asyncAwait") ?? s.AsyncAwait;
			s.QueryExpressions = (bool?)e.Attribute("queryExpressions") ?? s.QueryExpressions;
			s.UseDebugSymbols = (bool?)e.Attribute("useDebugSymbols") ?? s.UseDebugSymbols;
			s.ShowXmlDocumentation = (bool?)e.Attribute("xmlDoc") ?? s.ShowXmlDocumentation;
			s.FoldBraces = (bool?)e.Attribute("foldBraces") ?? s.FoldBraces;
            s.IndentString = (string)e.Attribute("indentString") ?? "\t";
			return s;
		}
示例#5
0
        public static DecompilerSettings LoadDecompilerSettings(ILSpySettings settings)
        {
            XElement           e = settings["DecompilerSettings"];
            DecompilerSettings s = new DecompilerSettings();

            s.ShowDebugInfo           = (bool?)e.Attribute("showDebugInfo") ?? s.ShowDebugInfo;
            s.ShowXmlDocumentation    = (bool?)e.Attribute("xmlDoc") ?? s.ShowXmlDocumentation;
            s.FoldBraces              = (bool?)e.Attribute("foldBraces") ?? s.FoldBraces;
            s.ExpandMemberDefinitions = (bool?)e.Attribute("expandMemberDefinitions") ?? s.ExpandMemberDefinitions;
            s.RemoveDeadCode          = (bool?)e.Attribute("removeDeadCode") ?? s.RemoveDeadCode;
            s.UsingDeclarations       = (bool?)e.Attribute("usingDeclarations") ?? s.UsingDeclarations;
            s.AlwaysUseBraces         = (bool?)e.Attribute("alwaysUseBraces") ?? s.AlwaysUseBraces;
            return(s);
        }
示例#6
0
        void LoadInternal()
        {
            ILSpySettings settings = ILSpySettings.Load();
            var           bpsx     = settings[SETTINGS_NAME];

            BreakpointManager.Instance.Clear();
            foreach (var bpx in bpsx.Elements("Breakpoint"))
            {
                uint?  token            = (uint?)bpx.Attribute("Token");
                string assemblyFullPath = SessionSettings.Unescape((string)bpx.Attribute("AssemblyFullPath"));
                string moduleFullPath   = SessionSettings.Unescape((string)bpx.Attribute("ModuleFullPath"));
                bool   isDynamic        = (bool?)bpx.Attribute("IsDynamic") ?? false;
                bool   isInMemory       = (bool?)bpx.Attribute("IsInMemory") ?? false;
                uint?  ilOffset         = (uint?)bpx.Attribute("ILOffset") ?? (uint?)bpx.Attribute("From");       //TODO: Remove "From" some time after this commit
                bool?  isEnabled        = (bool?)bpx.Attribute("IsEnabled");

                if (token == null)
                {
                    continue;
                }
                if (string.IsNullOrEmpty(moduleFullPath))
                {
                    continue;
                }
                if (ilOffset == null)
                {
                    continue;
                }
                if (isEnabled == null)
                {
                    continue;
                }

                var snModule = new SerializedDnModule(moduleFullPath, isDynamic, isInMemory);
                var key      = MethodKey.Create(token.Value, snModule);

                if (!isInMemory)
                {
                    var s = SessionSettings.Unescape((string)bpx.Attribute("Method"));
                    if (s == null || s != GetMethodAsString(assemblyFullPath, key))
                    {
                        continue;
                    }
                }

                var bp = new ILCodeBreakpoint(assemblyFullPath, key, ilOffset.Value, isEnabled.Value);
                BreakpointManager.Instance.Add(bp);
            }
        }
示例#7
0
        void Load()
        {
            try {
                disableSaveCounter++;

                var settings = ILSpySettings.Load();
                var csx      = settings[SETTINGS_NAME];
                ShowNamespaces   = (bool?)csx.Attribute("ShowNamespaces") ?? true;
                ShowTypeKeywords = (bool?)csx.Attribute("ShowTypeKeywords") ?? true;
                ShowTokens       = (bool?)csx.Attribute("ShowTokens") ?? false;
            }
            finally {
                disableSaveCounter--;
            }
        }
		public static DecompilerSettings LoadDecompilerSettings(ILSpySettings settings)
		{
			XElement e = settings["DecompilerSettings"];
			DecompilerSettings s = new DecompilerSettings();
			s.AnonymousMethods = (bool?)e.Attribute("anonymousMethods") ?? s.AnonymousMethods;
			s.YieldReturn = (bool?)e.Attribute("yieldReturn") ?? s.YieldReturn;
			s.AsyncAwait = (bool?)e.Attribute("asyncAwait") ?? s.AsyncAwait;
			s.QueryExpressions = (bool?)e.Attribute("queryExpressions") ?? s.QueryExpressions;
			s.ExpressionTrees = (bool?)e.Attribute("expressionTrees") ?? s.ExpressionTrees;
			s.UseDebugSymbols = (bool?)e.Attribute("useDebugSymbols") ?? s.UseDebugSymbols;
			s.ShowXmlDocumentation = (bool?)e.Attribute("xmlDoc") ?? s.ShowXmlDocumentation;
			s.AddILComments = (bool?)e.Attribute("addILComments") ?? s.AddILComments;
			s.RemoveEmptyDefaultConstructors = (bool?)e.Attribute("removeEmptyDefaultConstructors") ?? s.RemoveEmptyDefaultConstructors;
			return s;
		}
        public static DecompilerSettings LoadDecompilerSettings(ILSpySettings settings)
        {
            XElement           e = settings["DecompilerSettings"];
            DecompilerSettings s = new DecompilerSettings();

            s.AnonymousMethods     = (bool?)e.Attribute("anonymousMethods") ?? s.AnonymousMethods;
            s.YieldReturn          = (bool?)e.Attribute("yieldReturn") ?? s.YieldReturn;
            s.AsyncAwait           = (bool?)e.Attribute("asyncAwait") ?? s.AsyncAwait;
            s.QueryExpressions     = (bool?)e.Attribute("queryExpressions") ?? s.QueryExpressions;
            s.ExpressionTrees      = (bool?)e.Attribute("expressionTrees") ?? s.ExpressionTrees;
            s.UseDebugSymbols      = (bool?)e.Attribute("useDebugSymbols") ?? s.UseDebugSymbols;
            s.ShowXmlDocumentation = (bool?)e.Attribute("xmlDoc") ?? s.ShowXmlDocumentation;
            s.FoldBraces           = (bool?)e.Attribute("foldBraces") ?? s.FoldBraces;
            return(s);
        }
示例#10
0
        void LoadInternal()
        {
            ILSpySettings settings = ILSpySettings.Load();
            var           exs      = settings[SETTINGS_NAME];

            ExceptionManager.Instance.RestoreDefaults();
            foreach (var exx in exs.Elements("Exception"))
            {
                var  exceptionType      = (ExceptionType?)(int?)exx.Attribute("ExceptionType");
                var  fullName           = SessionSettings.Unescape((string)exx.Attribute("FullName"));
                bool?breakOnFirstChance = (bool?)exx.Attribute("BreakOnFirstChance");
                bool isOtherExceptions  = (bool?)exx.Attribute("IsOtherExceptions") ?? false;
                var  diffType           = (ExceptionDiffType?)(int?)exx.Attribute("DiffType");

                if (diffType == null)
                {
                    continue;
                }
                if (exceptionType == null || (int)exceptionType.Value < 0 || exceptionType.Value >= ExceptionType.Last)
                {
                    continue;
                }
                if (fullName == null)
                {
                    continue;
                }

                var key = new ExceptionInfoKey(exceptionType.Value, fullName);
                switch (diffType.Value)
                {
                case ExceptionDiffType.Remove:
                    ExceptionManager.Instance.Remove(key);
                    break;

                case ExceptionDiffType.AddOrUpdate:
                    if (breakOnFirstChance == null)
                    {
                        continue;
                    }
                    ExceptionManager.Instance.AddOrUpdate(key, breakOnFirstChance.Value, isOtherExceptions);
                    break;

                default:
                    Debug.Fail("Unknown ExceptionDiffType");
                    break;
                }
            }
        }
        public LinqPadSpyContainer(Application currentApplication, Language decompiledLanguage)
        {
            if (currentApplication == null)
            {
                throw new ArgumentNullException("currentApplication");
            }
            if (decompiledLanguage == null)
            {
                throw new ArgumentNullException("decompiledLanguage");
            }

            this.decompiledLanguage = decompiledLanguage;

            this.currentApplication = currentApplication;

            // Initialize supported ILSpy languages. Values used for the combobox.
            Languages.Initialize(CompositionContainerBuilder.Container);

            this.CurrentAssemblyList = new AssemblyList("LINQPadAssemblyList", this.currentApplication);

            ICSharpCode.ILSpy.App.CompositionContainer = CompositionContainerBuilder.Container;

            CompositionContainerBuilder.Container.ComposeParts(this);

            // A hack to get around the global shared state of the Window object throughout ILSpy.
            ICSharpCode.ILSpy.MainWindow.SpyWindow = this;

            this.spySettings = ILSpySettings.Load();

            this.sessionSettings = new SessionSettings(this.spySettings)
            {
                ActiveAssemblyList = this.CurrentAssemblyList.ListName
            };

            SetUpDataContext();

            this.assemblyPath = LinqPadUtil.GetLastLinqPadQueryAssembly();

            this.decompilerTextView = GetDecompilerTextView();

            InitializeComponent();

            this.mainPane.Content = this.decompilerTextView;

            this.InitToolbar();

            this.Loaded += new RoutedEventHandler(this.MainWindowLoaded);
        }
        public void Closed()
        {
            DebuggerService.DebugStarted -= new EventHandler(OnDebugStarted);
            DebuggerService.DebugStopped -= new EventHandler(OnDebugStopped);
            if (null != m_currentDebugger)
            {
                OnDebugStopped(null, EventArgs.Empty);
            }

            // save settings
            DebuggerSettings.Instance.PropertyChanged -= new PropertyChangedEventHandler(OnDebuggerSettingChanged);
            ILSpySettings.Update(
                delegate(XElement root) {
                DebuggerSettings.Instance.Save(root);
            });
        }
示例#13
0
		public void Load(ILSpySettings settings)
		{
			XElement e = settings[DEBUGGER_SETTINGS];
			AskForArguments = (bool?)e.Attribute(ASK_ARGUMENTS) ?? AskForArguments;
			ShowModuleName = (bool?)e.Attribute(SHOW_MODULE) ?? ShowModuleName;
			ShowArguments = (bool?)e.Attribute(SHOW_ARGUMENTS) ?? ShowArguments;
			ShowArgumentValues = (bool?)e.Attribute(SHOW_ARGUMENTVALUE) ?? ShowArgumentValues;
			BreakAtBeginning = (bool?)e.Attribute(BREAK_AT_BEGINNING) ?? BreakAtBeginning;
			EnableJustMyCode = (bool?)e.Attribute(ENABLE_JUST_MY_CODE) ?? EnableJustMyCode;
			StepOverDebuggerAttributes = (bool?)e.Attribute(STEP_OVER_DEBUGGER_ATTRIBUTES) ?? StepOverDebuggerAttributes;
			StepOverAllProperties = (bool?)e.Attribute(STEP_OVER_ALL_PROPERTIES) ?? StepOverAllProperties;
			StepOverSingleLineProperties = (bool?)e.Attribute(STEP_OVER_SINGLE_LINE_PROPERTIES) ?? StepOverSingleLineProperties;
			StepOverFieldAccessProperties = (bool?)e.Attribute(STEP_OVER_FIELD_ACCESS_PROPERTIES) ?? StepOverFieldAccessProperties;

			UpdateDebugger();
		}
 void OKButton_Click(object sender, RoutedEventArgs e)
 {
     ILSpySettings.Update(
         delegate(XElement root) {
         foreach (var optionPage in optionPages)
         {
             IOptionPage page = optionPage.Value as IOptionPage;
             if (page != null)
             {
                 page.Save(root);
             }
         }
     });
     this.DialogResult = true;
     Close();
 }
示例#15
0
        public static DecompilerSettings LoadDecompilerSettings(ILSpySettings settings)
        {
            XElement           e = settings["DecompilerSettings"];
            DecompilerSettings s = new DecompilerSettings();

            s.AnonymousMethods               = (bool?)e.Attribute("anonymousMethods") ?? s.AnonymousMethods;
            s.YieldReturn                    = (bool?)e.Attribute("yieldReturn") ?? s.YieldReturn;
            s.AsyncAwait                     = (bool?)e.Attribute("asyncAwait") ?? s.AsyncAwait;
            s.QueryExpressions               = (bool?)e.Attribute("queryExpressions") ?? s.QueryExpressions;
            s.ExpressionTrees                = (bool?)e.Attribute("expressionTrees") ?? s.ExpressionTrees;
            s.UseDebugSymbols                = (bool?)e.Attribute("useDebugSymbols") ?? s.UseDebugSymbols;
            s.ShowXmlDocumentation           = (bool?)e.Attribute("xmlDoc") ?? s.ShowXmlDocumentation;
            s.AddILComments                  = (bool?)e.Attribute("addILComments") ?? s.AddILComments;
            s.RemoveEmptyDefaultConstructors = (bool?)e.Attribute("removeEmptyDefaultConstructors") ?? s.RemoveEmptyDefaultConstructors;
            return(s);
        }
        public static DisplaySettings LoadDisplaySettings(ILSpySettings settings)
        {
            XElement e = settings["DisplaySettings"];
            var      s = new DisplaySettings();

            s.SelectedFont               = new FontFamily((string)e.Attribute("Font") ?? "Consolas");
            s.SelectedFontSize           = (double?)e.Attribute("FontSize") ?? 10.0 * 4 / 3;
            s.ShowLineNumbers            = (bool?)e.Attribute("ShowLineNumbers") ?? false;
            s.ShowMetadataTokens         = (bool?)e.Attribute("ShowMetadataTokens") ?? false;
            s.ShowMetadataTokensInBase10 = (bool?)e.Attribute("ShowMetadataTokensInBase10") ?? false;
            s.EnableWordWrap             = (bool?)e.Attribute("EnableWordWrap") ?? false;
            s.SortResults             = (bool?)e.Attribute("SortResults") ?? true;
            s.FoldBraces              = (bool?)e.Attribute("FoldBraces") ?? false;
            s.ExpandMemberDefinitions = (bool?)e.Attribute("ExpandMemberDefinitions") ?? false;

            return(s);
        }
示例#17
0
        public OptionsDialog()
        {
            InitializeComponent();
            ILSpySettings settings = ILSpySettings.Load();
            var           creators = MefState.Instance.optionPages.OrderBy(p => p.Metadata.Order).ToArray();

            optionPages = creators.Select(p => p.Value.Create()).ToArray();
            for (int i = 0; i < creators.Length; i++)
            {
                TabItem tabItem = new TabItem();
                tabItem.Header  = creators[i].Metadata.Title;
                tabItem.Content = optionPages[i];
                tabControl.Items.Add(tabItem);

                optionPages[i].Load(settings);
            }
        }
示例#18
0
        void OnDebuggerSettingChanged(object sender, PropertyChangedEventArgs args)
        {
            ILSpySettings.Update(
                delegate(XElement root) {
                DebuggerSettings.Instance.Save(root);
            });

            if (args.PropertyName == "ShowModuleName")
            {
                SwitchModuleColumn();
            }
            else if (args.PropertyName == "ShowArguments" ||
                     args.PropertyName == "ShowArgumentValues")
            {
                RefreshPad();
            }
        }
示例#19
0
        public static Decompiler.DecompilerSettings LoadDecompilerSettings(ILSpySettings settings)
        {
            XElement e           = settings["DecompilerSettings"];
            var      newSettings = new Decompiler.DecompilerSettings();
            var      properties  = typeof(Decompiler.DecompilerSettings).GetProperties()
                                   .Where(p => p.GetCustomAttribute <BrowsableAttribute>()?.Browsable != false);

            foreach (var p in properties)
            {
                var value = (bool?)e.Attribute(p.Name);
                if (value.HasValue)
                {
                    p.SetValue(newSettings, value.Value);
                }
            }
            return(newSettings);
        }
示例#20
0
        public void Load(ILSpySettings settings)
        {
            XElement e = settings[DEBUGGER_SETTINGS];

            AskForArguments               = (bool?)e.Attribute(ASK_ARGUMENTS) ?? AskForArguments;
            ShowModuleName                = (bool?)e.Attribute(SHOW_MODULE) ?? ShowModuleName;
            ShowArguments                 = (bool?)e.Attribute(SHOW_ARGUMENTS) ?? ShowArguments;
            ShowArgumentValues            = (bool?)e.Attribute(SHOW_ARGUMENTVALUE) ?? ShowArgumentValues;
            BreakAtBeginning              = (bool?)e.Attribute(BREAK_AT_BEGINNING) ?? BreakAtBeginning;
            EnableJustMyCode              = (bool?)e.Attribute(ENABLE_JUST_MY_CODE) ?? EnableJustMyCode;
            StepOverDebuggerAttributes    = (bool?)e.Attribute(STEP_OVER_DEBUGGER_ATTRIBUTES) ?? StepOverDebuggerAttributes;
            StepOverAllProperties         = (bool?)e.Attribute(STEP_OVER_ALL_PROPERTIES) ?? StepOverAllProperties;
            StepOverSingleLineProperties  = (bool?)e.Attribute(STEP_OVER_SINGLE_LINE_PROPERTIES) ?? StepOverSingleLineProperties;
            StepOverFieldAccessProperties = (bool?)e.Attribute(STEP_OVER_FIELD_ACCESS_PROPERTIES) ?? StepOverFieldAccessProperties;

            UpdateDebugger();
        }
示例#21
0
        public static bool GetIsShowDebugInfo(ILSpySettings settings)
        {
            if (settings == null)
            {
                settings = ILSpySettings.Load();
            }
            XElement   e = settings[ns + "ReadyToRunOptions"];
            XAttribute a = e.Attribute("IsShowDebugInfo");

            if (a == null)
            {
                return(true);
            }
            else
            {
                return((bool)a);
            }
        }
示例#22
0
        public static string GetDisassemblyFormat(ILSpySettings settings)
        {
            if (settings == null)
            {
                settings = ILSpySettings.Load();
            }
            XElement   e = settings[ns + "ReadyToRunOptions"];
            XAttribute a = e.Attribute("DisassemblyFormat");

            if (a == null)
            {
                return(ReadyToRunOptions.intel);
            }
            else
            {
                return((string)a);
            }
        }
示例#23
0
        public override void Execute(object parameter)
        {
            if (!CurrentDebugger.IsDebugging)
            {
                var      settings        = ILSpySettings.Load();
                XElement e               = settings["DebuggerSettings"];
                var      askForArguments = (bool?)e.Attribute("askForArguments");
                if (askForArguments.HasValue && askForArguments.Value)
                {
                    var window = new ExecuteProcessWindow {
                        Owner = MainWindow.Instance
                    };
                    if (window.ShowDialog() == true)
                    {
                        string fileName = window.SelectedExecutable;

                        // add it to references
                        MainWindow.Instance.OpenFiles(new [] { fileName }, false);

                        // execute the process
                        this.StartExecutable(fileName, window.WorkingDirectory, window.Arguments);
                    }
                }
                else
                {
                    OpenFileDialog dialog = new OpenFileDialog()
                    {
                        Filter           = ".NET Executable (*.exe) | *.exe",
                        RestoreDirectory = true,
                        DefaultExt       = "exe"
                    };
                    if (dialog.ShowDialog() == true)
                    {
                        string fileName = dialog.FileName;

                        // add it to references
                        MainWindow.Instance.OpenFiles(new [] { fileName }, false);

                        // execute the process
                        this.StartExecutable(fileName, null, null);
                    }
                }
            }
        }
        public OptionsDialog()
        {
            InitializeComponent();
            App.CompositionContainer.ComposeParts(this);
            ILSpySettings settings = ILSpySettings.Load();

            foreach (var optionPage in optionPages.OrderBy(p => p.Metadata.Order))
            {
                TabItem tabItem = new TabItem();
                tabItem.Header  = optionPage.Metadata.Title;
                tabItem.Content = optionPage.Value;
                tabControl.Items.Add(tabItem);

                IOptionPage page = optionPage.Value as IOptionPage;
                if (page != null)
                {
                    page.Load(settings);
                }
            }
        }
示例#25
0
        public static DecompilerSettings LoadDecompilerSettings(ILSpySettings settings)
        {
            XElement           e = settings["DecompilerSettings"];
            DecompilerSettings s = new DecompilerSettings();

            s.AnonymousMethods               = (bool?)e.Attribute("anonymousMethods") ?? s.AnonymousMethods;
            s.AnonymousTypes                 = (bool?)e.Attribute("anonymousTypes") ?? s.AnonymousTypes;
            s.YieldReturn                    = (bool?)e.Attribute("yieldReturn") ?? s.YieldReturn;
            s.AsyncAwait                     = (bool?)e.Attribute("asyncAwait") ?? s.AsyncAwait;
            s.AutomaticProperties            = (bool?)e.Attribute("automaticProperties") ?? s.AutomaticProperties;
            s.QueryExpressions               = (bool?)e.Attribute("queryExpressions") ?? s.QueryExpressions;
            s.ExpressionTrees                = (bool?)e.Attribute("expressionTrees") ?? s.ExpressionTrees;
            s.UseDebugSymbols                = (bool?)e.Attribute("useDebugSymbols") ?? s.UseDebugSymbols;
            s.ShowDebugInfo                  = (bool?)e.Attribute("showDebugInfo") ?? s.ShowDebugInfo;
            s.ShowXmlDocumentation           = (bool?)e.Attribute("xmlDoc") ?? s.ShowXmlDocumentation;
            s.FoldBraces                     = (bool?)e.Attribute("foldBraces") ?? s.FoldBraces;
            s.UsingDeclarations              = (bool?)e.Attribute("usingDeclarations") ?? s.UsingDeclarations;
            s.FullyQualifyAmbiguousTypeNames = (bool?)e.Attribute("fullyQualifyAmbiguousTypeNames") ?? s.FullyQualifyAmbiguousTypeNames;
            return(s);
        }
示例#26
0
        public void Show()
        {
            if (!IsVisible)
            {
                // load debugger settings (to update context menu)
                ILSpySettings settings = ILSpySettings.Load();
                DebuggerSettings.Instance.Load(settings);
                DebuggerSettings.Instance.PropertyChanged += new PropertyChangedEventHandler(OnDebuggerSettingChanged);

                SwitchModuleColumn();
                MainWindow.Instance.ShowInBottomPane("Callstack", this);

                DebuggerService.DebugStarted += new EventHandler(OnDebugStarted);
                DebuggerService.DebugStopped += new EventHandler(OnDebugStopped);
                if (DebuggerService.IsDebuggerStarted)
                {
                    OnDebugStarted(null, EventArgs.Empty);
                }
            }
        }
示例#27
0
        public static DisplaySettings LoadDisplaySettings(ILSpySettings settings)
        {
            XElement        e = settings["DisplaySettings"];
            DisplaySettings s = new DisplaySettings();

            s.SelectedFont                      = new FontFamily(SessionSettings.Unescape((string)e.Attribute("Font")) ?? GetDefaultFont());
            s.SelectedFontSize                  = (double?)e.Attribute("FontSize") ?? 10.0 * 4 / 3;
            s.ShowLineNumbers                   = (bool?)e.Attribute("ShowLineNumbers") ?? true;
            s.ShowMetadataTokens                = (bool?)e.Attribute("ShowMetadataTokens") ?? true;
            s.ShowAssemblyVersion               = (bool?)e.Attribute("ShowAssemblyVersion") ?? true;
            s.ShowAssemblyPublicKeyToken        = (bool?)e.Attribute("ShowAssemblyPublicKeyToken") ?? false;
            s.DecompileFullType                 = (bool?)e.Attribute("DecompileFullType") ?? true;
            s.NewEmptyTabs                      = (bool?)e.Attribute("NewEmptyTabs") ?? false;
            s.RestoreTabsAtStartup              = (bool?)e.Attribute("RestoreTabsAtStartup") ?? true;
            s.AutoHighlightRefs                 = (bool?)e.Attribute("AutoHighlightRefs") ?? true;
            s.SyntaxHighlightTreeViewUI         = (bool?)e.Attribute("SyntaxHighlightTreeViewUI") ?? true;
            s.SyntaxHighlightAnalyzerTreeViewUI = (bool?)e.Attribute("SyntaxHighlightAnalyzerTreeViewUI") ?? true;
            s.SyntaxHighlightSearchListUI       = (bool?)e.Attribute("SyntaxHighlightSearchListUI") ?? true;

            return(s);
        }
示例#28
0
        void Load(ILSpySettings settings)
        {
            var csx = settings[SETTINGS_NAME];

            UseHexadecimal               = (bool?)csx.Attribute("UseHexadecimal") ?? true;
            SyntaxHighlightCallStack     = (bool?)csx.Attribute("SyntaxHighlightCallStack") ?? true;
            SyntaxHighlightBreakpoints   = (bool?)csx.Attribute("SyntaxHighlightBreakpoints") ?? true;
            SyntaxHighlightThreads       = (bool?)csx.Attribute("SyntaxHighlightThreads") ?? true;
            SyntaxHighlightModules       = (bool?)csx.Attribute("SyntaxHighlightModules") ?? true;
            SyntaxHighlightLocals        = (bool?)csx.Attribute("SyntaxHighlightLocals") ?? true;
            SyntaxHighlightAttach        = (bool?)csx.Attribute("SyntaxHighlightAttach") ?? true;
            SyntaxHighlightExceptions    = (bool?)csx.Attribute("SyntaxHighlightExceptions") ?? true;
            BreakProcessType             = (BreakProcessType)((int?)csx.Attribute("BreakProcessType") ?? (int)BreakProcessType.ModuleCctorOrEntryPoint);
            PropertyEvalAndFunctionCalls = (bool?)csx.Attribute("PropertyEvalAndFunctionCalls") ?? true;
            UseStringConversionFunction  = (bool?)csx.Attribute("UseStringConversionFunction") ?? true;
            DebuggerBrowsableAttributesCanHidePropsFields = (bool?)csx.Attribute("DebuggerBrowsableAttributesCanHidePropsFields") ?? true;
            CompilerGeneratedAttributesCanHideFields      = (bool?)csx.Attribute("CompilerGeneratedAttributesCanHideFields") ?? true;
            DisableManagedDebuggerDetection = (bool?)csx.Attribute("DisableManagedDebuggerDetection") ?? true;
            IgnoreBreakInstructions         = (bool?)csx.Attribute("IgnoreBreakInstructions") ?? false;
            CoreCLRDbgShimFilename          = SessionSettings.Unescape((string)csx.Attribute("CoreCLRDbgShimFilename") ?? string.Empty);
        }
示例#29
0
        public override void Execute(object parameter)
        {
            if (!CurrentDebugger.IsDebugging)
            {
                var      settings     = ILSpySettings.Load();
                XElement e            = settings["DebuggerSettings"];
                var      showWarnings = (bool?)e.Attribute("showWarnings");
                if ((showWarnings.HasValue && showWarnings.Value) || !showWarnings.HasValue)
                {
                    MessageBox.Show("Warning: When attaching to an application, some local variables might not be available. If possible, use the \"Start Executable\" command.",
                                    "Attach to a process", MessageBoxButton.OK, MessageBoxImage.Warning);
                }

                var window = new AttachToProcessWindow {
                    Owner = MainWindow.Instance
                };
                if (window.ShowDialog() == true)
                {
                    StartAttaching(window.SelectedProcess);
                }
            }
        }
示例#30
0
        void Load()
        {
            try {
                disableSaveCounter++;

                var settings = ILSpySettings.Load();
                var csx      = settings[SETTINGS_NAME];
                ShowModuleNames     = (bool?)csx.Attribute("ShowModuleNames") ?? true;
                ShowParameterTypes  = (bool?)csx.Attribute("ShowParameterTypes") ?? true;
                ShowParameterNames  = (bool?)csx.Attribute("ShowParameterNames") ?? true;
                ShowParameterValues = (bool?)csx.Attribute("ShowParameterValues") ?? false;
                ShowIP           = (bool?)csx.Attribute("ShowIP") ?? true;
                ShowOwnerTypes   = (bool?)csx.Attribute("ShowOwnerTypes") ?? true;
                ShowNamespaces   = (bool?)csx.Attribute("ShowNamespaces") ?? true;
                ShowTypeKeywords = (bool?)csx.Attribute("ShowTypeKeywords") ?? true;
                ShowTokens       = (bool?)csx.Attribute("ShowTokens") ?? false;
                ShowReturnTypes  = (bool?)csx.Attribute("ShowReturnTypes") ?? false;
            }
            finally {
                disableSaveCounter--;
            }
        }
示例#31
0
 public static DecompilerSettings LoadDecompilerSettings(ILSpySettings settings)
 {
     XElement e = settings["DecompilerSettings"];
     DecompilerSettings s = new DecompilerSettings();
     s.AnonymousMethods = (bool?)e.Attribute("anonymousMethods") ?? s.AnonymousMethods;
     s.YieldReturn = (bool?)e.Attribute("yieldReturn") ?? s.YieldReturn;
     s.AsyncAwait = (bool?)e.Attribute("asyncAwait") ?? s.AsyncAwait;
     s.QueryExpressions = (bool?)e.Attribute("queryExpressions") ?? s.QueryExpressions;
     s.ExpressionTrees = (bool?)e.Attribute("expressionTrees") ?? s.ExpressionTrees;
     s.UseDebugSymbols = (bool?)e.Attribute("useDebugSymbols") ?? s.UseDebugSymbols;
     s.ShowXmlDocumentation = (bool?)e.Attribute("xmlDoc") ?? s.ShowXmlDocumentation;
     s.ShowILComments = (bool?)e.Attribute("showILComments") ?? s.ShowILComments;
     s.RemoveEmptyDefaultConstructors = (bool?)e.Attribute("removeEmptyDefaultConstructors") ?? s.RemoveEmptyDefaultConstructors;
     s.ShowTokenAndRvaComments = (bool?)e.Attribute("showTokenAndRvaComments") ?? s.ShowTokenAndRvaComments;
     s.ShowILBytes = (bool?)e.Attribute("showILBytes") ?? s.ShowILBytes;
     s.DecompilationObject0 = (DecompilationObject)((int?)e.Attribute("decompilationObject0") ?? (int)s.DecompilationObject0);
     s.DecompilationObject1 = (DecompilationObject)((int?)e.Attribute("decompilationObject1") ?? (int)s.DecompilationObject1);
     s.DecompilationObject2 = (DecompilationObject)((int?)e.Attribute("decompilationObject2") ?? (int)s.DecompilationObject2);
     s.DecompilationObject3 = (DecompilationObject)((int?)e.Attribute("decompilationObject3") ?? (int)s.DecompilationObject3);
     s.DecompilationObject4 = (DecompilationObject)((int?)e.Attribute("decompilationObject4") ?? (int)s.DecompilationObject4);
     s.SortMembers = (bool?)e.Attribute("sortMembers") ?? s.SortMembers;
     return s;
 }
        public static DisplaySettings LoadDisplaySettings(ILSpySettings settings)
        {
            XElement e = settings["DisplaySettings"];
            var      s = new DisplaySettings();

            s.SelectedFont               = new FontFamily((string)e.Attribute("Font") ?? FontManager.Current.DefaultFontFamilyName);
            s.SelectedFontSize           = (double?)e.Attribute("FontSize") ?? 10.0 * 4 / 3;
            s.ShowLineNumbers            = (bool?)e.Attribute("ShowLineNumbers") ?? false;
            s.ShowDebugInfo              = (bool?)e.Attribute("ShowDebugInfo") ?? false;
            s.ShowMetadataTokens         = (bool?)e.Attribute("ShowMetadataTokens") ?? false;
            s.ShowMetadataTokensInBase10 = (bool?)e.Attribute("ShowMetadataTokensInBase10") ?? false;
            s.EnableWordWrap             = (bool?)e.Attribute("EnableWordWrap") ?? false;
            s.SortResults             = (bool?)e.Attribute("SortResults") ?? true;
            s.FoldBraces              = (bool?)e.Attribute("FoldBraces") ?? false;
            s.ExpandMemberDefinitions = (bool?)e.Attribute("ExpandMemberDefinitions") ?? false;
            s.ExpandUsingDeclarations = (bool?)e.Attribute("ExpandUsingDeclarations") ?? false;
            s.IndentationUseTabs      = (bool?)e.Attribute("IndentationUseTabs") ?? true;
            s.IndentationSize         = (int?)e.Attribute("IndentationSize") ?? 4;
            s.IndentationTabSize      = (int?)e.Attribute("IndentationTabSize") ?? 4;
            s.HighlightMatchingBraces = (bool?)e.Attribute("HighlightMatchingBraces") ?? true;

            return(s);
        }
示例#33
0
        public OptionsDialog()
        {
            InitializeComponent();
            // These used to have [ImportMany(..., RequiredCreationPolicy = CreationPolicy.NonShared)], so they use their own
            // ExportProvider instance.
            // FIXME: Ideally, the export provider should be disposed when it's no longer needed.
            var ep = App.ExportProviderFactory.CreateExportProvider();

            this.optionPages = ep.GetExports <UIElement, IOptionsMetadata>("OptionPages").ToArray();
            ILSpySettings settings = ILSpySettings.Load();

            foreach (var optionPage in optionPages.OrderBy(p => p.Metadata.Order))
            {
                var tabItem = new TabItemViewModel(MainWindow.GetResourceString(optionPage.Metadata.Title), optionPage.Value);

                tabControl.Items.Add(tabItem);

                IOptionPage page = optionPage.Value as IOptionPage;
                if (page != null)
                {
                    page.Load(settings);
                }
            }
        }
示例#34
0
        public static DecompilerSettings LoadDecompilerSettings(ILSpySettings settings)
        {
            XElement           e = settings["DecompilerSettings"];
            DecompilerSettings s = new DecompilerSettings();

            s.AnonymousMethods               = (bool?)e.Attribute("anonymousMethods") ?? s.AnonymousMethods;
            s.YieldReturn                    = (bool?)e.Attribute("yieldReturn") ?? s.YieldReturn;
            s.AsyncAwait                     = (bool?)e.Attribute("asyncAwait") ?? s.AsyncAwait;
            s.QueryExpressions               = (bool?)e.Attribute("queryExpressions") ?? s.QueryExpressions;
            s.ExpressionTrees                = (bool?)e.Attribute("expressionTrees") ?? s.ExpressionTrees;
            s.UseDebugSymbols                = (bool?)e.Attribute("useDebugSymbols") ?? s.UseDebugSymbols;
            s.ShowXmlDocumentation           = (bool?)e.Attribute("xmlDoc") ?? s.ShowXmlDocumentation;
            s.ShowILComments                 = (bool?)e.Attribute("showILComments") ?? s.ShowILComments;
            s.RemoveEmptyDefaultConstructors = (bool?)e.Attribute("removeEmptyDefaultConstructors") ?? s.RemoveEmptyDefaultConstructors;
            s.ShowTokenAndRvaComments        = (bool?)e.Attribute("showTokenAndRvaComments") ?? s.ShowTokenAndRvaComments;
            s.ShowILBytes                    = (bool?)e.Attribute("showILBytes") ?? s.ShowILBytes;
            s.DecompilationObject0           = (DecompilationObject)((int?)e.Attribute("decompilationObject0") ?? (int)s.DecompilationObject0);
            s.DecompilationObject1           = (DecompilationObject)((int?)e.Attribute("decompilationObject1") ?? (int)s.DecompilationObject1);
            s.DecompilationObject2           = (DecompilationObject)((int?)e.Attribute("decompilationObject2") ?? (int)s.DecompilationObject2);
            s.DecompilationObject3           = (DecompilationObject)((int?)e.Attribute("decompilationObject3") ?? (int)s.DecompilationObject3);
            s.DecompilationObject4           = (DecompilationObject)((int?)e.Attribute("decompilationObject4") ?? (int)s.DecompilationObject4);
            s.SortMembers                    = (bool?)e.Attribute("sortMembers") ?? s.SortMembers;
            return(s);
        }
示例#35
0
 internal static OtherSettings Load(ILSpySettings settings)
 {
     var xelem = settings[SETTINGS_SECTION_NAME];
     var s = new OtherSettings();
     s.UseMemoryMappedIO = (bool?)xelem.Attribute("UseMemoryMappedIO") ?? true;
     return s;
 }
		public void Load(ILSpySettings settings)
		{
			var s = DebuggerSettings.Instance;
			s.Load(settings);
			this.DataContext = s;
		}
 public void Load(ILSpySettings settings)
 {
     this.DataContext = OtherSettings.Load(settings);
 }
示例#38
0
 public void Load(ILSpySettings settings)
 {
     this.DataContext = LoadDisplaySettings(settings);
 }
示例#39
0
 public override void Load(ILSpySettings settings)
 {
     this.settings = LoadDecompilerSettings(settings);
 }
示例#40
0
 public void Load(ILSpySettings settings)
 {
     this.DataContext = new DecompilerSettingsViewModel(LoadDecompilerSettings(settings));
 }
示例#41
0
 public override void Load(ILSpySettings settings)
 {
     var s = DebuggerSettings.Instance;
     s.Load(settings);
     this.settings = s;
 }
示例#42
0
 public abstract void Load(ILSpySettings settings);
示例#43
0
 public void Load(ILSpySettings settings)
 {
     this.DataContext = LoadDecompilerSettings(settings);
 }
示例#44
0
		public void Load(ILSpySettings settings)
		{
			this.DataContext = LoadDisplaySettings(settings);
		}
示例#45
0
		public static DisplaySettings LoadDisplaySettings(ILSpySettings settings)
		{
			XElement e = settings["DisplaySettings"];
			DisplaySettings s = new DisplaySettings();
			s.SelectedFont = new FontFamily((string)e.Attribute("Font") ?? "Consolas");
			s.SelectedFontSize = (double?)e.Attribute("FontSize") ?? 10.0 * 4 / 3;
			s.ShowLineNumbers = (bool?)e.Attribute("ShowLineNumbers") ?? false;
			s.ShowMetadataTokens = (bool?) e.Attribute("ShowMetadataTokens") ?? false;
			
			return s;
		}
示例#46
0
		public override void Load(ILSpySettings settings) {
			this.settings = LoadDecompilerSettings(settings);
		}
示例#47
0
		public static DisplaySettings LoadDisplaySettings(ILSpySettings settings) {
			XElement e = settings["DisplaySettings"];
			DisplaySettings s = new DisplaySettings();
			s.SelectedFont = new FontFamily(SessionSettings.Unescape((string)e.Attribute("Font")) ?? FontUtils.GetDefaultFont());
			s.SelectedFontSize = (double?)e.Attribute("FontSize") ?? FontUtils.DEFAULT_FONT_SIZE;
			s.ShowLineNumbers = (bool?)e.Attribute("ShowLineNumbers") ?? true;
			s.ShowMetadataTokens = (bool?)e.Attribute("ShowMetadataTokens") ?? true;
			s.ShowAssemblyVersion = (bool?)e.Attribute("ShowAssemblyVersion") ?? true;
			s.ShowAssemblyPublicKeyToken = (bool?)e.Attribute("ShowAssemblyPublicKeyToken") ?? false;
			s.DecompileFullType = (bool?)e.Attribute("DecompileFullType") ?? true;
			s.NewEmptyTabs = (bool?)e.Attribute("NewEmptyTabs") ?? false;
			s.RestoreTabsAtStartup = (bool?)e.Attribute("RestoreTabsAtStartup") ?? true;
			s.AutoHighlightRefs = (bool?)e.Attribute("AutoHighlightRefs") ?? true;
			s.SyntaxHighlightTreeViewUI = (bool?)e.Attribute("SyntaxHighlightTreeViewUI") ?? true;
			s.SyntaxHighlightAnalyzerTreeViewUI = (bool?)e.Attribute("SyntaxHighlightAnalyzerTreeViewUI") ?? true;
			s.SyntaxHighlightSearchListUI = (bool?)e.Attribute("SyntaxHighlightSearchListUI") ?? true;
			s.SingleClickExpandsChildren = (bool?)e.Attribute("SingleClickExpandsChildren") ?? true;

			return s;
		}
示例#48
0
		public override void Load(ILSpySettings settings) {
			this.settings = LoadDisplaySettings(settings);
		}