コード例 #1
0
        void LoadInternal()
        {
            var section = settingsManager.GetOrCreateSection(SETTINGS_GUID);

            breakpointManager.Clear();
            foreach (var bpx in section.SectionsWithName("Breakpoint"))
            {
                uint?  token          = bpx.Attribute <uint?>("Token");
                string asmFullName    = bpx.Attribute <string>("AssemblyFullName");
                string moduleName     = bpx.Attribute <string>("ModuleName");
                bool?  isDynamic      = bpx.Attribute <bool?>("IsDynamic");
                bool?  isInMemory     = bpx.Attribute <bool?>("IsInMemory");
                bool   moduleNameOnly = bpx.Attribute <bool?>("ModuleNameOnly") ?? false;
                uint?  ilOffset       = bpx.Attribute <uint?>("ILOffset");
                bool?  isEnabled      = bpx.Attribute <bool?>("IsEnabled");

                if (token == null)
                {
                    continue;
                }
                if (isDynamic == null || isInMemory == null)
                {
                    continue;
                }
                if (string.IsNullOrEmpty(asmFullName) && !moduleNameOnly)
                {
                    continue;
                }
                if (string.IsNullOrEmpty(moduleName))
                {
                    continue;
                }
                if (ilOffset == null)
                {
                    continue;
                }
                if (isEnabled == null)
                {
                    continue;
                }

                var snModule = SerializedDnModule.Create(asmFullName, moduleName, isDynamic.Value, isInMemory.Value, moduleNameOnly);
                var key      = new SerializedDnToken(snModule, token.Value);

                if (!isInMemory.Value && !isDynamic.Value)
                {
                    var s = bpx.Attribute <string>("Method");
                    if (s == null || s != GetMethodAsString(key))
                    {
                        continue;
                    }
                }

                var bp = new ILCodeBreakpoint(key, ilOffset.Value, isEnabled.Value);
                breakpointManager.Add(bp);
            }
        }