예제 #1
0
        protected override void BeginProcessing()
        {
            if (parPath.StartsWith(@".\"))
            {
                parPath = System.IO.Path.Combine(this.CurrentProviderLocation("FileSystem").ProviderPath, parPath.Substring(2));
            }

            parPath = System.IO.Path.GetFullPath(parPath);

            if (!File.Exists(parPath))
            {
                ThrowTerminatingError(new ErrorRecord(new FileNotFoundException("File was not found"), "100", ErrorCategory.ResourceUnavailable, parPath));
            }

            // New form and browser
            ScriptForm form = new ScriptForm();

            form.LoadApplication(parPath);
            form.ProviderPath = CurrentProviderLocation("FileSystem").ProviderPath;
            form.Show();

            while (form.Visible && form.PipelineStatus == PipelineState.NotStarted)
            {
                System.Windows.Forms.Application.DoEvents();
                Thread.Sleep(1);
            }

            if (form.ExitObject != null)
            {
                WriteObject(form.ExitObject);
            }
        }
예제 #2
0
        private void Script_FormClosed(object pSender, FormClosedEventArgs pArgs)
        {
            ScriptForm script = pSender as ScriptForm;

            //script.Packet.Selected = true;
            MainForm.StructureForm.ParseMaplePacket(script.Packet);
            Activate();
        }
예제 #3
0
        private void mViewCommonScriptMenu_Click(object pSender, EventArgs pArgs)
        {
            string scriptPath = Helpers.GetCommonScriptPath(Locale, Build);

            Helpers.MakeSureFileDirectoryExists(scriptPath);

            var script = new ScriptForm(scriptPath, null);

            script.FormClosed += CommonScript_FormClosed;
            script.Show(DockPanel, new Rectangle(MainForm.Location, new Size(600, 300)));
        }
예제 #4
0
        private void mPacketList_ItemActivate(object pSender, EventArgs pArgs)
        {
            if (ListView.SelectedIndices.Count == 0)
            {
                return;
            }
            MaplePacket packet = ListView.Selected;

            string scriptPath = Helpers.GetScriptPath(Locale, Build, packet.Outbound, packet.Opcode);

            Helpers.MakeSureFileDirectoryExists(scriptPath);

            var script = new ScriptForm(scriptPath, packet);

            script.FormClosed += Script_FormClosed;
            script.Show(DockPanel, new Rectangle(MainForm.Location, new Size(600, 300)));
        }
예제 #5
0
        protected override void Update(double deltaTime)
        {
            if (form == null && Input.Ctrl && !Input.Alt && !Input.Shift && Input.IsKeyPressed(OpenTK.Input.Key.Enter))
            {
                if (form == null)
                {
                    form = new ScriptForm();
                    form.Show(System.Windows.Forms.NativeWindow.FromHandle(MMW.Window.WindowInfo.Handle));
                    form.TopLevel = true;

                    form.FormClosed += (s, e) =>
                    {
                        form = null;
                    };
                }
                else
                {
                    form.TopMost = true;
                }
            }
        }