Beispiel #1
0
 public void Fire1(IGoo p)
 {
     if (OnEvent01 != null)
     {
         OnEvent01(p);
     }
 }
                public GooApplication(IGoo goopage, HistoryScope<ApplicationState> gooscope)
                {
                    // init state! this will be sent to server at every new web call.
                    this.state = gooscope.state;
                    FlashTitle();


                    Native.document.title = state.title;
                    Native.document.body.style.borderTop = "1em red solid";

                    Action ShowDataTable =
                        delegate
                        {
                            goopage.output.Clear();

                            var f = new Form
                            {
                                Text = new { this.state.data.TableName }.ToString(),
                                ControlBox = false,
                                ShowIcon = false,

                                //WindowState = FormWindowState.Maximized
                            };

                            new DataGridView
                            {
                                // script: error JSC1000: No implementation found for this native method, please implement [System.Windows.Forms.DataGridView.set_BorderStyle(System.Windows.Forms.BorderStyle)]
                                //BorderStyle = BorderStyle.Fixed3D 
                                //AutoSize = true,
                                AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.AllCells,

                                DataSource = this.state.data,
                                Dock = DockStyle.Fill
                            }.AttachTo(f);

                            // do we need this?

                            f.GetHTMLTarget().AttachTo(goopage.output);

                            f.Show();

                            f.WindowState = FormWindowState.Maximized;
                            f.PopupInsteadOfClosing(
                                HandleFormClosing: false

                                // , 
                                // does not play well with maximized yet
                                //SpecialNoMovement: true
                                );

                        };

                    if (this.state.data == null)
                    {
                        // can we remove this from history then?

                        new IHTMLButton { innerText = "a page reload makes us forget DataTable. go back and get new data!" }.AttachTo(goopage.output).WhenClicked(
                            delegate
                            {

                                Native.window.history.back();
                            }
                        );

                        new IHTMLBreak().AttachTo(goopage.output);

                        new IHTMLButton { innerText = "or get new data, if the server is available" }.AttachTo(goopage.output).WhenClicked(
                            async delegate
                            {
                                Native.document.body.style.borderTop = "1em black solid";

                                this.reason = "page reload makes us forget DataTable";
                                //this.state = (await this.DoEnterData()).state;

                                var x = await this.DoEnterData();

                                this.state = x.state;

                                Native.document.body.style.borderTop = "1em red solid";

                                ShowDataTable();
                            }
                        );
                    }
                    else
                    {
                        ShowDataTable();
                    }

                    #region undo
                    gooscope.With(
                         async delegate
                         {
                             await gooscope;



                             // time to undo
                             Native.document.body.style.borderTop = "0.3em yellow solid";
                         }
                     );
                    #endregion

                }
Beispiel #3
0
 string IGoo.this[string p, IGoo p2]
 {
     get { return(p); }
     set { }
 }
                public GooApplication(IGoo goopage, HistoryScope <ApplicationState> gooscope)
                {
                    // init state! this will be sent to server at every new web call.
                    this.state = gooscope.state;
                    FlashTitle();


                    Native.document.title = state.title;
                    Native.document.body.style.borderTop = "1em red solid";

                    Action ShowDataTable =
                        delegate
                    {
                        goopage.output.Clear();

                        var f = new Form
                        {
                            Text = new { this.state.data.TableName }.ToString(),
                            ControlBox = false,
                            ShowIcon   = false,

                            //WindowState = FormWindowState.Maximized
                        };

                        new DataGridView
                        {
                            // script: error JSC1000: No implementation found for this native method, please implement [System.Windows.Forms.DataGridView.set_BorderStyle(System.Windows.Forms.BorderStyle)]
                            //BorderStyle = BorderStyle.Fixed3D
                            //AutoSize = true,
                            AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.AllCells,

                            DataSource = this.state.data,
                            Dock       = DockStyle.Fill
                        }.AttachTo(f);

                        // do we need this?

                        f.GetHTMLTarget().AttachTo(goopage.output);

                        f.Show();

                        f.WindowState = FormWindowState.Maximized;
                        f.PopupInsteadOfClosing(
                            HandleFormClosing: false

                            // ,
                            // does not play well with maximized yet
                            //SpecialNoMovement: true
                            );
                    };

                    if (this.state.data == null)
                    {
                        // can we remove this from history then?

                        new IHTMLButton {
                            innerText = "a page reload makes us forget DataTable. go back and get new data!"
                        }.AttachTo(goopage.output).WhenClicked(
                            delegate
                        {
                            Native.window.history.back();
                        }
                            );

                        new IHTMLBreak().AttachTo(goopage.output);

                        new IHTMLButton {
                            innerText = "or get new data, if the server is available"
                        }.AttachTo(goopage.output).WhenClicked(
                            async delegate
                        {
                            Native.document.body.style.borderTop = "1em black solid";

                            this.reason = "page reload makes us forget DataTable";
                            //this.state = (await this.DoEnterData()).state;

                            var x = await this.DoEnterData();

                            this.state = x.state;

                            Native.document.body.style.borderTop = "1em red solid";

                            ShowDataTable();
                        }
                            );
                    }
                    else
                    {
                        ShowDataTable();
                    }

                    #region undo
                    gooscope.With(
                        async delegate
                    {
                        await gooscope;



                        // time to undo
                        Native.document.body.style.borderTop = "0.3em yellow solid";
                    }
                        );
                    #endregion
                }