Ejemplo n.º 1
0
        private void CreateOrLoadSaveFile(string key)
        {
            var filePath = GetPersistentFilePath(key + ".json");

            if (File.Exists(filePath))
            {
                try
                {
                    var json = File.ReadAllText(filePath);
                    selection = JsonUtility.FromJson <DissassemblerSelectionInfo>(json);
                    DoLog("Loaded Selection\n" + json);
                }
                catch
                {
                    // ignored
                }
            }

            if (selection != null)
            {
                return;
            }
            selection = new DissassemblerSelectionInfo()
            {
                key = key
            };

            SaveSelection();
        }
Ejemplo n.º 2
0
        public void Add(DissassemblerSelectionInfo selection, int offset = -1)
        {
            if (this.MatchesCurrentIndex(selection.selectedAssembly, selection.selectedType, selection.selectedMethod, offset))
            {
                return;
            }

            if (!this.AtEnd)
            {
                for (var i = this.history.Count - 1; i > index; i--)
                {
                    history.RemoveAt(i);
                }
            }

            this.history.Add(new ILNavigatorNavEntry(selection.selectedAssembly, selection.selectedType, selection.selectedMethod, offset));
            this.index = this.history.Count - 1;
        }