コード例 #1
0
        public override void OpenPhysicalFile(string fileName)
        {
            var tabId = $"{Key}::{fileName}";

            if (Substrate.ShowTabById(tabId))
            {
                return;
            }

            LogOutput($"Loading pak file: {fileName}");

            try
            {
                var pv = new Controls.PakViewer();
                pv.TabModel.ContentId = tabId;
                pv.LoadPak(fileName);
                Substrate.AddTool(pv.TabModel, Substrate.GetHostWindow(), Dock.Left, new GridLength(400));
                Substrate.AddRecentFile(fileName);

                LogOutput($"Loaded pak file: {fileName}");
            }
            catch (Exception ex)
            {
                var message = $"Unable to load {Path.GetFileName(fileName)}:{Environment.NewLine}{ex.Message}";
                Substrate.ShowErrorMessage(message);
                Substrate.LogError(message, ex);
            }
        }
コード例 #2
0
        public override void OpenPhysicalFile(string fileName)
        {
            var tabId = $"{Key}::{fileName}";

            if (Substrate.ShowTabById(tabId))
            {
                return;
            }

            LogOutput($"Loading map file: {fileName}");

            try
            {
                var mv = new Controls.MapViewer();
                mv.TabModel.ContentId = tabId;
                mv.LoadMap(fileName);
                Substrate.AddTool(mv.TabModel, Substrate.GetHostWindow(), Dock.Left, new GridLength(400));
                Substrate.AddRecentFile(fileName);

                if (Settings.AutoMapFolder)
                {
                    Settings.MapFolder = Path.GetDirectoryName(fileName);
                }

                LogOutput($"Loaded map file: {fileName}");
            }
            catch (Exception ex)
            {
                var message = $"Unable to load {Path.GetFileName(fileName)}:{Environment.NewLine}{ex.Message}";
                Substrate.ShowErrorMessage(message);
                Substrate.LogError(message, ex);
            }
        }