Пример #1
0
            public Dashboard(IAppDashboard page)
            {
                page.LogOut.onclick +=
                    delegate
                    {
                        session.Delete();

                        Native.Document.location.reload();
                    };

                page.TellServerToDropMySession.onclick +=
                    delegate
                    {
                        this.page_TellServerToDropMySession_onclick(session.Value,
                            delegate
                            {
                                Native.Document.location.reload();
                            }
                        );
                    };

                con.Show();

                Console.WriteLine(session.Value);

                this.account_SelectByCookie(
                    // wow. webmethods are too isolated, cant see cookies:)
                    session.Value,
                    email =>
                    {
                        page.email.innerText = email;
                    }
                );



                page.SinceIAmNowLggedInTellMeHowManyActiveSessionsAreThere.onclick +=
                    async delegate
                    {
                        var x = await this.SinceIAmNowLggedInTellMeHowManyActiveSessionsAreThere(session.Value);

                        Native.window.alert(x);
                    };


                page.ManageMyDevices.onclick +=
                    delegate
                    {
                        new MyDevicesForm
                        {
                            // at this point the client does not actually need to know the account id
                            // account will be taken from session token

                            // we cannot set the account like this anymore?
                            // ??
                            //__account = 42,

                            service = this.IMyDevicesComponent_MyDevices()
                        }.Show();
                    };
            }
Пример #2
0
            public Dashboard(IAppDashboard page)
            {
                page.LogOut.onclick +=
                    delegate
                {
                    session.Delete();

                    Native.Document.location.reload();
                };

                page.TellServerToDropMySession.onclick +=
                    delegate
                {
                    this.page_TellServerToDropMySession_onclick(session.Value,
                                                                delegate
                    {
                        Native.Document.location.reload();
                    }
                                                                );
                };

                con.Show();

                Console.WriteLine(session.Value);

                this.account_SelectByCookie(
                    // wow. webmethods are too isolated, cant see cookies:)
                    session.Value,
                    email =>
                {
                    page.email.innerText = email;
                }
                    );



                page.SinceIAmNowLggedInTellMeHowManyActiveSessionsAreThere.onclick +=
                    async delegate
                {
                    var x = await this.SinceIAmNowLggedInTellMeHowManyActiveSessionsAreThere(session.Value);

                    Native.window.alert(x);
                };


                page.ManageMyDevices.onclick +=
                    delegate
                {
                    new MyDevicesForm
                    {
                        // at this point the client does not actually need to know the account id
                        // account will be taken from session token

                        // we cannot set the account like this anymore?
                        // ??
                        //__account = 42,

                        service = this.IMyDevicesComponent_MyDevices()
                    }.Show();
                };
            }