Esempio n. 1
0
    static void Main()
    {
        List <int> myList = new List <int>();

        //Console.WriteLine(typeof(myArray);
        myList.Add(3244);
        myList.Add(1233);
        Goo.Print(myList.ToList());
        Goo.Print("John Green");
    }
Esempio n. 2
0
        public static void Main(string[] args)
        {
            var foo = new Foo();

            System.Console.WriteLine(foo.Bar());
            System.Console.WriteLine(foo.Bar("World"));
            var goo = new Goo();

            System.Console.WriteLine(goo.Bar("Hello"));
            var foo2 = new Foo2();

            System.Console.WriteLine(foo2.Bar("Hello"));
        }
Esempio n. 3
0
        static void Main(string[] args)
        {
            const string cultureCode = "pt-PT";

            Thread.CurrentThread.CurrentUICulture = new CultureInfo(cultureCode);
            Thread.CurrentThread.CurrentCulture   = new CultureInfo(cultureCode);

            var foo = new Foo();

            PrintIFoo(foo);

            var goo = new Goo();

            PrintIFoo(goo);

            var woo = new Woo();

            PrintIFoo(woo);

            Console.ReadLine();
        }
            public FooApplication(IFoo foopage, HistoryScope<ApplicationState> fooscope)
            {
                // init state! this will be sent to server at every new web call.
                this.state = fooscope.state;
                FlashTitle();

                // how do we know when we need to shut down?
                // if we go back in time we need to shut down
                // should we have a Dispose method?
                // can we await on scope?



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


                foopage.output.innerText = new { this.state.title }.ToString();

                foopage.EnterData.WhenClicked(
                    async delegate
                    {
                        this.reason = "foopage.EnterData.WhenClicked";

                        // what if server has gone away?
                        var newscope = await this.DoEnterData();

                        newscope_data = newscope.state.data;

                        // DataTable is not correctly stored in HistoryAPI yet
                        newscope.state.data = null;

                        // ready to transition to a new 
                        Native.window.history.pushState(
                            newscope.state,
                            async scope =>
                            {
                                Console.WriteLine("at DoEnterData");



                                scope.state.data = newscope_data;
                                newscope_data = null;

                                // now what?
                                // we get here either by a click or a reload

                                #region do
                                // we need a copy of childnodes!
                                var oldpagenodes = Native.document.body.childNodes.ToArray();

                                var goopage = new Goo();

                                Native.document.body.Clear();

                                #endregion

                                Native.document.body.appendChild(
                                    goopage.body.childNodes.ToArray()
                                );

                                // should we automate this somehow?
                                var gooapp = new GooApplication(goopage, scope);

                                // we only use the data once?
                                //scope.state.data = null;


                                await scope;
                                Native.document.body.Clear();


                                #region undo

                                Native.document.body.appendChild(
                                     oldpagenodes
                                );

                                // http://connect.microsoft.com/VisualStudio/feedback/details/534869/arrow-keys-stop-working-in-editor
                                // are we sure the state has been restored?

                                // show our intent to reload
                                IStyleSheet.Default["title"].style.color = "red";

                                // wait for any animation, sound to complete, then wipe
                                // what if we move in time during the delay?
                                await Task.Delay(500);

                                Native.document.location.reload();
                                #endregion

                            }
                        );
                    }
                );



                //Native.document.body.style[await scope].borderLeft = "0.3em yellow solid";

                fooscope.With(
                    async delegate
                    {
                        await fooscope;



                        // time to undo
                        Native.document.body.style.borderLeft = "0.3em yellow solid";
                    }
                );
            }
Esempio n. 5
0
 public ManyCtor2(Goo goo)
 {
     Goo = goo;
 }
Esempio n. 6
0
            public FooApplication(IFoo foopage, HistoryScope <ApplicationState> fooscope)
            {
                // init state! this will be sent to server at every new web call.
                this.state = fooscope.state;
                FlashTitle();

                // how do we know when we need to shut down?
                // if we go back in time we need to shut down
                // should we have a Dispose method?
                // can we await on scope?



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


                foopage.output.innerText = new { this.state.title }.ToString();

                foopage.EnterData.WhenClicked(
                    async delegate
                {
                    this.reason = "foopage.EnterData.WhenClicked";

                    // what if server has gone away?
                    var newscope = await this.DoEnterData();

                    newscope_data = newscope.state.data;

                    // DataTable is not correctly stored in HistoryAPI yet
                    newscope.state.data = null;

                    // ready to transition to a new
                    Native.window.history.pushState(
                        newscope.state,
                        async scope =>
                    {
                        Console.WriteLine("at DoEnterData");



                        scope.state.data = newscope_data;
                        newscope_data    = null;

                        // now what?
                        // we get here either by a click or a reload

                        #region do
                        // we need a copy of childnodes!
                        var oldpagenodes = Native.document.body.childNodes.ToArray();

                        var goopage = new Goo();

                        Native.document.body.Clear();

                        #endregion

                        Native.document.body.appendChild(
                            goopage.body.childNodes.ToArray()
                            );

                        // should we automate this somehow?
                        var gooapp = new GooApplication(goopage, scope);

                        // we only use the data once?
                        //scope.state.data = null;


                        await scope;
                        Native.document.body.Clear();


                        #region undo

                        Native.document.body.appendChild(
                            oldpagenodes
                            );

                        // http://connect.microsoft.com/VisualStudio/feedback/details/534869/arrow-keys-stop-working-in-editor
                        // are we sure the state has been restored?

                        // show our intent to reload
                        IStyleSheet.Default["title"].style.color = "red";

                        // wait for any animation, sound to complete, then wipe
                        // what if we move in time during the delay?
                        await Task.Delay(500);

                        Native.document.location.reload();
                        #endregion
                    }
                        );
                }
                    );



                //Native.document.body.style[await scope].borderLeft = "0.3em yellow solid";

                fooscope.With(
                    async delegate
                {
                    await fooscope;



                    // time to undo
                    Native.document.body.style.borderLeft = "0.3em yellow solid";
                }
                    );
            }
    public static void Main()
    {
        Goo x = new Goo();

        x = x.next();
    }
Esempio n. 8
0
        public static void Game_OnUpdate(EventArgs args)
        {
            _source = ObjectManager.LocalHero;

            if (!Game.IsInGame || Game.IsPaused || Game.IsWatchingGame)
            {
                return;
            }
            if (_source.ClassId != ClassId.CDOTA_Unit_Hero_Bristleback)
            {
                return;
            }
            var _enemy = ObjectManager.GetEntities <Hero>().Where(hero => hero.IsAlive && !hero.IsIllusion && hero.IsVisible && hero.Team != _source.Team);
            var _creep = ObjectManager.GetEntities <Creep>().Where(x => (x.ClassId == ClassId.CDOTA_BaseNPC_Creep_Lane || x.ClassId == ClassId.CDOTA_BaseNPC_Creep_Siege) && x.IsAlive && x.IsSpawned && x.IsVisible).ToList();

            if (_source == null)
            {
                return;
            }
            if (Quill == null)
            {
                Quill = _source.Spellbook.Spell2;
            }
            if (Goo == null)
            {
                Goo = _source.Spellbook.Spell1;
            }
            if (abyssal == null)
            {
                abyssal = _source.FindItem("item_abyssal_blade");
            }
            if (dust == null)
            {
                dust = _source.FindItem("item_dust");
            }
            if (atos == null)
            {
                atos = _source.FindItem("item_rod_of_atos");
            }
            if (solar == null)
            {
                solar = _source.FindItem("item_solar_crest");
            }
            if (medallion == null)
            {
                medallion = _source.FindItem("item_medallion_of_courage");
            }
            if (halberd == null)
            {
                halberd = _source.FindItem("item_heavens_halberd");
            }
            if (Menu.Item("Quill").GetValue <StringList>().SelectedIndex == 3 && Quill.CanBeCasted() && _source.CanCast() && Utils.SleepCheck("quill") && !_source.IsChanneling() && !_source.IsInvisible())
            {
                foreach (var x in _creep)
                {
                    if (x.Team == _source.GetEnemyTeam() && x.Health > 0 && x.Health < (Quilldmg[Quill.Level - 1] * (1 - x.DamageResist) + 20) && GetDistance2D(x.Position, _source.Position) < Quill.CastRange && Utils.SleepCheck("quill"))
                    {
                        Quill.UseAbility();
                        Utils.Sleep(150 + Game.Ping, "quill");
                    }
                }
            }
            if (Menu.Item("Quill").GetValue <StringList>().SelectedIndex == 0 && Quill.CanBeCasted() && _source.CanCast() && Utils.SleepCheck("quill") && !_source.IsChanneling() && !_source.IsInvisible())
            {
                Quill.UseAbility();
                Utils.Sleep(150 + Game.Ping, "quill");
            }
            if (Menu.Item("Quill").GetValue <StringList>().SelectedIndex == 1 && Quill.CanBeCasted() && _source.CanCast() && Utils.SleepCheck("quill") && !_source.IsChanneling() && !_source.IsInvisible())
            {
                foreach (var enemy in _enemy)
                {
                    if (GetDistance2D(enemy.Position, _source.Position) < Quill.CastRange)
                    {
                        Quill.UseAbility();
                        Utils.Sleep(150 + Game.Ping, "quill");
                    }
                }
            }
            if (chase && Menu.Item("enable").GetValue <bool>())
            {
                _target = _source.ClosestToMouseTarget(1000);
                if (_source.CanAttack() && _source.CanCast())
                {
                    var linken = _target.Modifiers.Any(x => x.Name == "modifier_item_spheretarget") || _target.Inventory.Items.Any(x => x.Name == "item_sphere");
                    if (abyssal != null && abyssal.CanBeCasted() && Utils.SleepCheck("item_abyssal") && !linken)
                    {
                        abyssal.UseAbility(_target);
                        Utils.Sleep(400 + Game.Ping, "item_abyssal");
                    }
                    if (abyssal != null)
                    {
                        Utils.ChainStun(_source, 310, null, false);
                    }
                    if (medallion != null && medallion.CanBeCasted() && Utils.SleepCheck("item_medal") && !linken)
                    {
                        medallion.UseAbility(_target);
                        Utils.Sleep(150 + Game.Ping, "item_medal");
                    }
                    if (atos != null && atos.CanBeCasted() && Utils.SleepCheck("item_atos") && !linken)
                    {
                        medallion.UseAbility(_target);
                        Utils.Sleep(150 + Game.Ping, "item_atos");
                    }
                    if (solar != null && solar.CanBeCasted() && Utils.SleepCheck("item_solar") && !linken)
                    {
                        solar.UseAbility(_target);
                        Utils.Sleep(200 + Game.Ping, "item_solar");
                    }
                    if (dust != null && dust.CanBeCasted() && (_target.CanGoInvis() || _target.IsInvisible()) && Utils.SleepCheck("dust"))
                    {
                        dust.UseAbility();
                        Utils.Sleep(200 + Game.Ping, "dust");
                    }
                    if (Goo.CanBeCasted() && _source.CanAttack() && !_target.IsInvul() && Utils.SleepCheck("Goo"))
                    {
                        if (_source.HasItem(ClassId.CDOTA_Item_UltimateScepter))
                        {
                            if (GetDistance2D(_target.Position, _source.Position) < Goo.CastRange)
                            {
                                Goo.UseAbility();
                                Utils.Sleep(150 + Game.Ping, "Goo");
                            }
                            else
                            {
                                _source.Attack(_target);
                                Utils.Sleep(Game.Ping + 150, "atk");
                            }
                        }
                        else
                        {
                            Goo.UseAbility(_target);
                            Utils.Sleep(150 + Game.Ping, "Goo");
                        }
                    }
                    if (!Goo.CanBeCasted() && Utils.SleepCheck("animationatk"))
                    {
                        _source.Attack(_target);
                        Utils.Sleep(Game.Ping + 150, "animationatk");
                    }
                    if (Quill.CanBeCasted() && Utils.SleepCheck("quill"))
                    {
                        Quill.UseAbility();
                        Utils.Sleep(150 + Game.Ping, "quill");
                    }
                }
                else
                {
                    if (Utils.SleepCheck("atk"))
                    {
                        _source.Attack(_target);
                    }
                    Utils.Sleep(1000, "atk");
                }
            }
        }