Beispiel #1
0
        public Interfaces.Plugin.IToolResult ShowDialog(ref SimPe.Interfaces.Files.IPackedFileDescriptor pfd, ref SimPe.Interfaces.Files.IPackageFile package)
        {
            if (Helper.StartedGui == Executable.Default)
            {
                if (Message.Show(SimPe.Localization.GetString("ObsoleteOW"), SimPe.Localization.GetString("Warning"), System.Windows.Forms.MessageBoxButtons.YesNo) == System.Windows.Forms.DialogResult.No)
                {
                    return(new ToolResult(false, false));
                }
            }

            SimPe.Interfaces.Files.IPackageFile pkg = ws.Execute(prov, package);

            if (pkg != null)
            {
                if (pkg.Reader != null)
                {
                    if (!pkg.Reader.BaseStream.CanWrite)
                    {
                        new ToolResult(false, false);
                    }
                }

                package = pkg;
                return(new ToolResult(false, true));
            }
            else
            {
                return(new ToolResult(false, false));
            }
        }