Inheritance: InteractButton
示例#1
0
        public static async Task Main(string[] args)
        {
            var builder = new ConfigurationBuilder()
                          .SetBasePath(Directory.GetCurrentDirectory())
                          .AddJsonFile("AppSettings.json");

            var config = builder.Build();

            var configuration = config.GetSection("ApiConfiguration").Get <ApiConfiguration>();

            Console.WriteLine("Iniciando...");

            ItemMenu[] itensMenu = new ItemMenu[]
            {
                MenuPlaygroundAPI,
                MenuPlaygroundCarrinho
            };

            int opcao;

            do
            {
                ImprimirMenu(itensMenu);
                var linha = Console.ReadLine();
                int.TryParse(linha, out opcao);
                if (opcao > 0)
                {
                    await itensMenu[opcao - 1](configuration);
                }
            } while (opcao > 0);
        }
示例#2
0
        private static void ExibirMenu()
        {
            var itensMenu = new ItemMenu[]
            {
                TestesContaBancaria,
                TestesEmprestimo
            };

            int opcao = 0;

            do
            {
                Console.Clear();
                for (int i = 0; i < itensMenu.Length; i++)
                {
                    string name      = itensMenu[i].Method.Name;
                    var    descricao = Regex.Replace(name, "([A-Z]{1,2}|[0-9]+)", " $1").TrimStart();
                    Console.WriteLine($"{i + 1} - {descricao}");
                }
                Console.WriteLine($"0 - Sair");
                Console.WriteLine();
                Console.Write("Digite uma opção: ");
                string input = Console.ReadLine();
                int.TryParse(input, out opcao);
                if (opcao > 0)
                {
                    Console.Clear();
                    itensMenu[opcao - 1]();
                    Console.Write("Tecle algo para continuar... ");
                    Console.ReadKey();
                }
            }while (opcao != 0);
        }
示例#3
0
        public UserMenu(ItemMenu itemMenu = null, MainWindow Parent = null)
        {
            InitializeComponent();

            _parent          = Parent;
            this.DataContext = itemMenu;
        }
        public async Task <IActionResult> Edit(string id)
        {
            try
            {
                if (!string.IsNullOrEmpty(id))
                {
                    var respuesta = await apiServicios.SeleccionarAsync <Response>(id, new Uri(WebApp.BaseAddress),
                                                                                   "api/ItemMenus");

                    if (respuesta.IsSuccess)
                    {
                        var respuestaitemmenu = JsonConvert.DeserializeObject <ItemMenu>(respuesta.Resultado.ToString());
                        var itemmenu          = new ItemMenu
                        {
                            IdSubMenu = respuestaitemmenu.IdSubMenu,

                            Estado = respuestaitemmenu.Estado
                        };
                        ViewData["IdPerfil"] = new SelectList(await apiServicios.Listar <Perfil>(new Uri(WebApp.BaseAddress), "api/Perfils/ListarPerfil"), "IdPerfil", "Descripcion");
                        ViewData["IdMenu"]   = new SelectList(await apiServicios.Listar <Menu>(new Uri(WebApp.BaseAddress), "api/Menus/ListarMenus"), "IdMenu", "Titulo");

                        return(View(itemmenu));
                    }
                }

                return(BadRequest());
            }
            catch (Exception ex)
            {
                return(BadRequest());
            }
        }
        public async Task <IActionResult> Edit(string id, ItemMenu itemmenu)
        {
            Response response = new Response();

            try
            {
                if (!string.IsNullOrEmpty(id))
                {
                    response = await apiServicios.EditarAsync(id, itemmenu, new Uri(WebApp.BaseAddress),
                                                              "api/ItemMenus");

                    if (response.IsSuccess)
                    {
                        return(RedirectToAction("Index"));
                    }
                    ViewData["IdPerfil"] = new SelectList(await apiServicios.Listar <Perfil>(new Uri(WebApp.BaseAddress), "api/Perfils/ListarPerfil"), "IdPerfil", "Descripcion");
                    ViewData["IdMenu"]   = new SelectList(await apiServicios.Listar <Menu>(new Uri(WebApp.BaseAddress), "api/Menus/ListarMenus"), "IdMenu", "Titulo");
                    return(View(itemmenu));
                }
                return(BadRequest());
            }
            catch (Exception ex)
            {
                return(BadRequest());
            }
        }
示例#6
0
        public UserMenuDropDown(ItemMenu itemMenu = null, MainWindow parent = null, users user = null)
        {
            this.DataContext = itemMenu;
            _parent          = parent;

            InitializeComponent();
        }
示例#7
0
    public void Item(Fighter f)
    {
        BaseAction();

        Action = ActionState.item;
        ItemMenu.Open(f);
    }
示例#8
0
        private async void OnTappedSaveItem(object sender, EventArgs args)
        {
            var dal = new ItemMenuDAL();

            if (this.itemMenu == null)
            {
                this.itemMenu = new ItemMenu();
            }
            this.itemMenu.Nome           = nome.Text;
            this.itemMenu.Descricao      = descricao.Text;
            this.itemMenu.Preco          = Convert.ToDouble(preco.Text);
            this.itemMenu.TipoItemMenuId = Convert.ToInt32(idTipo.Text);
            this.itemMenu.Foto           = bytesFoto;

            if (this.itemMenu.ItemMenuId == null)
            {
                dal.Add(this.itemMenu);
                await App.Current.MainPage.DisplayAlert("Inserção de item", "Item inserido com sucesso", "OK");
            }
            else
            {
                dal.Update(this.itemMenu);
                await App.Current.MainPage.DisplayAlert("Alteração de item", "Item alterado com sucesso", "OK");

                await Navigation.PopAsync();
            }

            ClearControls();
        }
示例#9
0
 public static void Itemmenu()
 {
     ItemMenu = YMenu.AddSubMenu("物品设置", "QSS");
     ItemMenu.Add("Items", new CheckBox("使用物品"));
     ItemMenu.Add("myhp", new Slider("使用破败当我血<或=", 70, 0, 101));
     ItemMenu.AddSeparator();
     ItemMenu.Add("use", new KeyBind("使用水银/小水银", true, KeyBind.BindTypes.PressToggle, 'K'));
     ItemMenu.Add("delay", new Slider("使用延迟", 1000, 0, 2000));
     ItemMenu.Add("Blind",
         new CheckBox("当被-致盲", false));
     ItemMenu.Add("Charm",
         new CheckBox("当被-魅惑"));
     ItemMenu.Add("Fear",
         new CheckBox("当被-恐惧"));
     ItemMenu.Add("Polymorph",
         new CheckBox("当被-变形"));
     ItemMenu.Add("Stun",
         new CheckBox("当被-眩晕"));
     ItemMenu.Add("Snare",
         new CheckBox("当-踩到陷阱"));
     ItemMenu.Add("Silence",
         new CheckBox("当被-沉默", false));
     ItemMenu.Add("Taunt",
         new CheckBox("当被-嘲讽"));
     ItemMenu.Add("Suppression",
         new CheckBox("当被-压制"));
 }
 public static void Itemmenu()
 {
     ItemMenu = YMenu.AddSubMenu("物品", "QSS");
     ItemMenu.AddGroupLabel("进攻类物品");
     ItemMenu.Add("Items", new CheckBox("使用物品"));
     ItemMenu.Add("myhp", new Slider("使用破败当我的生命 <=", 70, 0, 101));
     ItemMenu.AddGroupLabel("Qss");
     ItemMenu.Add("use", new KeyBind("使用净化/水银", true, KeyBind.BindTypes.PressToggle, 'K'));
     ItemMenu.Add("delay", new Slider("激活延迟", 1000, 0, 2000));
     ItemMenu.Add("Blind",
                  new CheckBox("致盲", false));
     ItemMenu.Add("Charm",
                  new CheckBox("魅惑"));
     ItemMenu.Add("Fear",
                  new CheckBox("恐惧"));
     ItemMenu.Add("Polymorph",
                  new CheckBox("变形"));
     ItemMenu.Add("Stun",
                  new CheckBox("晕眩"));
     ItemMenu.Add("Snare",
                  new CheckBox("定身"));
     ItemMenu.Add("Silence",
                  new CheckBox("沉默", false));
     ItemMenu.Add("Taunt",
                  new CheckBox("嘲讽"));
     ItemMenu.Add("Suppression",
                  new CheckBox("压制(螃蟹,蝎子,蚂蚱,狼人那类R)"));
 }
示例#11
0
    public void menuItemAction(ItemMenu item)
    {
        switch (item)
        {
        case ItemMenu.Resume:
            menuShown = false;
            break;

        case ItemMenu.Again:
            UnityEngine.SceneManagement.SceneManager.LoadScene("Main");
            break;

        case ItemMenu.ExitToMainMenu:
            UnityEngine.SceneManagement.SceneManager.LoadScene("Main Menu");
            break;

        case ItemMenu.Exit:
            if (showEndCredits)
            {
                GameObject exitMessage = new GameObject("Exit Message");
                DontDestroyOnLoad(exitMessage);
                UnityEngine.SceneManagement.SceneManager.LoadScene("Credits");
            }
            else
            {
                Application.Quit();
            }
            break;
        }
    }
示例#12
0
        void MenuItemclick(object sender, MouseButtonEventArgs e)
        {
            for (int i = 0; i < home.Menu.Children.Count; i++)
            {
                if (home.Menu.Children[i] is UserControlMenuItem)
                {
                    (home.Menu.Children[i] as UserControlMenuItem).ListViewItemMenu.Foreground = (SolidColorBrush)(new BrushConverter().ConvertFrom("#8A651F"));
                }
            }
            //TODO kiválasztott menü elemek piros betűszíne

            if (sender is ListBoxItem)
            {
                ItemMenu it = ((ItemMenu)((ListBoxItem)sender).DataContext);
                (sender as ListBoxItem).Foreground = Brushes.Red;

                if ((string)(sender as ListBoxItem).Content == (rm as ResourceManager).GetString("Menu_Exit"))
                {
                    home.Exit_Click(sender, e);
                }
                else if ((string)(sender as ListBoxItem).Content == (rm as ResourceManager).GetString("Menu_Logout"))
                {
                    home.Back_Click(sender, e);
                }
                else
                {
                    home.SwitchScreen(it.Screen);
                }
            }
            ExpanderMenu.IsExpanded   = true;
            ListViewMenu.SelectedItem = null;
        }
示例#13
0
        public MainWindow()

        {
            InitializeComponent();

            var menuInicio = new List <SubItem>();
            var item0      = new ItemMenu("Home", menuInicio, PackIconKind.MonitorDashboard);


            var menuCliente = new List <SubItem>();

            menuCliente.Add(new SubItem("Formulario Postulacion", new UserControlAgregarContratos()));
            menuCliente.Add(new SubItem("Informe de Habitabilidad", new UserControlListarCliente()));

            var item1 = new ItemMenu("Postulacion", menuCliente, PackIconKind.Account);


            var menuContrato = new List <SubItem>();

            menuContrato.Add(new SubItem("Datos Postulante", new UserControlCrearCliente()));

            var item2 = new ItemMenu("Informacion", menuContrato, PackIconKind.Information);



            Menu.Children.Add(new UserControlMenuItem(item0, this));
            Menu.Children.Add(new UserControlMenuItem(item1, this));
            Menu.Children.Add(new UserControlMenuItem(item2, this));
        }
 public UsCtrl_MenuItem_ViewModel(ItemMenu itemMenu)
 {
     _Initialize(itemMenu);
     Header   = itemMenu.Header;
     SubItems = itemMenu.SubItems;
     Icon     = itemMenu.Icon;
 }
        /// <summary>
        /// User Window
        /// </summary>
        public UserWindow()
        {
            InitializeComponent();
            this.DataContext = new UserWindowViewModel(this);
            this.Language    = XmlLanguage.GetLanguage("en-GB");
            UserData userData = new UserData();

            this.Name = "UserWindow";

            lblName.Content = LoggedInUser.CurrentUser.FirstName + " " + LoggedInUser.CurrentUser.LastName;
            List <tblRelationship> allRelationshipPending = userData.GetAllPandingUsers(LoggedInUser.CurrentUser).ToList();

            var menuUsers = new List <Subitem>
            {
                new Subitem("Find Friends", new AllUsersWindow()),
                new Subitem($"Panding Friends", new AllPendingUsersWindow()),
                new Subitem("All Friends", new AllFriendWindow()),
            };
            var menuProfile = new List <Subitem>
            {
                new Subitem("My Profile", new UserProfileWindow()),
                new Subitem($"My Posts", new UserPostsWindow()),
            };
            var item1 = new ItemMenu("Friends", menuUsers, PackIconKind.Twitter);
            var item2 = new ItemMenu("Profile", menuProfile, PackIconKind.Account);

            Menu.Children.Add(new UserControlMenuItem(item1, this));
            Menu.Children.Add(new UserControlMenuItem(item2, this));

            //determines the current page length
            this.MaxHeight = SystemParameters.MaximizedPrimaryScreenHeight;

            //Current time
            Time();
        }
示例#16
0
        public async Task <Response> PutItemMenu([FromRoute] int id, [FromBody] ItemMenu itemmenu)
        {
            if (!ModelState.IsValid)
            {
                return(new Response
                {
                    IsSuccess = false,
                    Message = Mensaje.ModeloInvalido
                });
            }

            if (id != itemmenu.IdSubMenu)
            {
                return(new Response
                {
                    IsSuccess = false,
                    Message = Mensaje.Error
                });
            }

            _context.Entry(itemmenu).State = EntityState.Modified;
            await _context.SaveChangesAsync();

            return(new Response
            {
                IsSuccess = true,
                Message = Mensaje.RegistroEditado
            });
        }
示例#17
0
        public UserView(vwUser user)
        {
            InitializeComponent();
            User             = user;
            this.DataContext = new UserViewModel(this, user);
            var menuProfile = new List <SubItem>();

            menuProfile.Add(new SubItem("View my profile", new ProfileView(user)));
            var item1 = new ItemMenu("Profile", menuProfile, PackIconKind.Person);

            var menuFeed = new List <SubItem>();

            menuFeed.Add(new SubItem("Search feed", new FeedView(user)));
            var item2 = new ItemMenu("Feed", menuFeed, PackIconKind.Feedback);

            var menuRequests = new List <SubItem>();

            menuRequests.Add(new SubItem("View and send requests", new RequestsView(user)));
            var item3 = new ItemMenu("Requests", menuRequests, PackIconKind.PersonQuestion);

            var item0 = new ItemMenu("", new UserControl(), PackIconKind.ViewDashboard);

            Menu.Children.Add(new UserControlMenuItem(item0, this));
            Menu.Children.Add(new UserControlMenuItem(item1, this));
            Menu.Children.Add(new UserControlMenuItem(item2, this));
            Menu.Children.Add(new UserControlMenuItem(item3, this));
        }
示例#18
0
        public async Task <Response> InsertarItemMenu([FromBody] ItemMenu itemmenu)
        {
            try
            {
                if (!ModelState.IsValid)
                {
                    return(new Response
                    {
                        IsSuccess = false,
                        Message = Mensaje.ModeloInvalido
                    });
                }

                _context.ItemMenu.Add(itemmenu);
                await _context.SaveChangesAsync();

                return(new Response
                {
                    IsSuccess = true,
                    Message = Mensaje.Satisfactorio
                });
            }
            catch (Exception)
            {
                return(new Response
                {
                    IsSuccess = false,
                    Message = Mensaje.Error
                });
            }
        }
示例#19
0
        // Función de carga de datos en tabla stock
        private void button1_Click(object sender, EventArgs e)
        {
            string nombre, descripcion;

            nombre = textBox2.Text;

            descripcion = textBox6.Text;


            int cantidad = Int32.Parse(textBox5.Text);


            float precio = float.Parse(textBox8.Text);

            ItemMenu i = new ItemMenu();

            if (i.AgregarItem(nombre, descripcion, precio, cantidad) == true)
            {
                MessageBox.Show("El producto fue cargado con éxito");
            }
            else
            {
                MessageBox.Show("Error al cargar");
            }
        }
示例#20
0
        public MainMenuViewModel()
        {
            Menu = new ObservableCollection <ItemMenu>();

            var product = new ItemMenu()
            {
                Name = "Продукт",
                Open = new Command((() =>
                {
                    var view = new ProductsView();
                    CurrentPage = view;
                }))
            };

            var unit = new ItemMenu()
            {
                Name = "Единицы измерения",
                Open = new Command((() =>
                {
                    var view = new UnitsView();
                    CurrentPage = view;
                }))
            };

            var recipe = new ItemMenu()
            {
                Name = "Рецепты",
                Open = new Command((() =>
                {
                    var view = new RecipeView();
                    CurrentPage = view;
                }))
            };

            var provider = new ItemMenu()
            {
                Name = "Поставщики",
                Open = new Command((() =>
                {
                    var view = new ProductsView();
                    CurrentPage = view;
                }))
            };

            var location = new ItemMenu()
            {
                Name = "Локации",
                Open = new Command((() =>
                {
                    var view = new LocationView();
                    CurrentPage = view;
                }))
            };

            Menu.Add(product);
            Menu.Add(unit);
            Menu.Add(location);
            Menu.Add(recipe);
            Menu.Add(provider);
        }
示例#21
0
 public UserControlMenuItem(ItemMenu itemMenu)
 {
     InitializeComponent();
     ExpanderMenu.Visibility     = itemMenu.SubItems == null ? Visibility.Collapsed : Visibility.Visible;
     ListViewItemMenu.Visibility = itemMenu.SubItems == null ? Visibility.Visible : Visibility.Collapsed;
     this.DataContext            = itemMenu;
 }
示例#22
0
        public MainWindow()
        {
            InitializeComponent();

            Director director = new Director();

            List <SubItem> subItemsEngine = new List <SubItem> {
                new SubItemASDN("Асинхронный двигатель насосов", logger, director.MakeModelEMotors(new AsdnSingleBuilder())),
                new SubItemASDNRED("Асинхронный двигатель насосов\r\n с шихтованным ротором", logger, director.MakeModelEMotors(new AsdnRedSingleBuilder()))
            };
            List <SubItem> subItemsMagnet = new List <SubItem> {
                new SubItemPremagFlat("Электромагнит постоянного тока\r\n с плоским якорем", logger, director.MakeModelEMagnet(new PremagFlatArmBuilder())),
                new SubItemPremagPlunger("Электромагнит постоянного тока\r\n с плунжером", logger, director.MakeModelEMagnet(new PremagPlungerBuilder())),
                new SubItemPremagAxis("Электромагнит осевого\r\n электромагнитного подшипника", logger)
            };

            ItemMenu itemMenu1 = new ItemMenu("Расчет электродвигателей", subItemsEngine, PackIconKind.Engine);
            ItemMenu itemMenu2 = new ItemMenu("Расчет электромагнитов", subItemsMagnet, PackIconKind.Magnet);
            ItemMenu itemMenu0 = new ItemMenu("Перечень расчетов", null, PackIconKind.ClipboardTextOutline);

            Menu.Children.Add(new UserControlMenuItem(itemMenu0, this));


            Menu.Children.Add(new UserControlMenuItem(itemMenu1, this));
            Menu.Children.Add(new UserControlMenuItem(itemMenu2, this));
        }
示例#23
0
        public MainWindow()
        {
            InitializeComponent();
            //startUpdate();

            showLoading();

            /*
             * var menuRegister = new List<SubItem>();
             * menuRegister.Add(new SubItem("chat tool"));
             * menuRegister.Add(new SubItem("botlist tool"));
             * menuRegister.Add(new SubItem("about"));
             * var item3 = new ItemMenu("settings", menuRegister, PackIconKind.Register);
             */

            var item0 = new ItemMenu("chat tool", new ChatTool(), PackIconKind.ViewDashboard);

            var item1 = new ItemMenu("create botlist", new Botlist(), PackIconKind.InsertDriveFile);
            var item2 = new ItemMenu("settings", new Settings(), PackIconKind.Settings);
            var item3 = new ItemMenu("hype tool", new HypeTool(), PackIconKind.Biohazard);
            var item4 = new ItemMenu("halloween tool", new Halloween(), PackIconKind.Biohazard);

            Menu.Children.Add(new UserControlMenuItem(item0, this));
            Menu.Children.Add(new UserControlMenuItem(item1, this));
            Menu.Children.Add(new UserControlMenuItem(item3, this));
            //Menu.Children.Add(new UserControlMenuItem(item4, this)); // use for Halloween feature
            Menu.Children.Add(new UserControlMenuItem(item2, this));
        }
        private void AddItemMainFrame()
        {
            var menuRegister = new List <SubItem>();

            menuRegister.Add(new SubItem("New registration", "Nueva Matricula", PackIconKind.Create, new UserControlStudent()));
            menuRegister.Add(new SubItem("Registry", "Registros de Matriculas", PackIconKind.Database, new UserControl_BD_Student()));
            ItemMenu item1 = new ItemMenu("Student", menuRegister, PackIconKind.Register);


            var menuReports = new List <SubItem>();

            menuReports.Add(new SubItem("Add", "Agregar Usuarios", PackIconKind.UserTick, new UserControlViewModel()));
            ItemMenu item2 = new ItemMenu("Admin", menuReports, PackIconKind.FileReport);



            MenuItem.Children.Add(new UserControlMenuItem(item1, this));

            if (v)
            {
                MenuItem.Children.Add(new UserControlMenuItem(item2, this));
            }

            confi = new UserControl_Configuracion();
        }
        public MainWindow()
        {
            InitializeComponent();
            Bot.getBot().startReceiving();
            var menuRegister = new List <SubItem>();

            menuRegister.Add(new SubItem("Опрос да / нет с документом"));
            menuRegister.Add(new SubItem("Опрос да / нет с видео"));
            menuRegister.Add(new SubItem("Опрос да / нет с фото"));
            menuRegister.Add(new SubItem("Опрос да / нет"));
            menuRegister.Add(new SubItem("Опрос с документом (1 - 5 \nответов)"));
            menuRegister.Add(new SubItem("Опрос с видео (1 - 5 ответов)"));
            menuRegister.Add(new SubItem("Опрос (1 - 5 ответов)"));
            var item1 = new ItemMenu("Опросы", menuRegister, PackIconKind.Poll);


            menuSchedule.Add(new SubItem("Текст с видео", new UserControlTextVideo()));
            menuSchedule.Add(new SubItem("Текст с документом"));
            menuSchedule.Add(new SubItem("Текст с геолокацией"));
            menuSchedule.Add(new SubItem("Текст с опросом Да/Нет"));
            menuSchedule.Add(new SubItem("Текст с ссылкой"));
            menuSchedule.Add(new SubItem("Текст с картинкой", new TexAndImage()));
            menuSchedule.Add(new SubItem("Простой текст", new UserControlText()));
            var item2 = new ItemMenu("Тексты", menuSchedule, PackIconKind.Text);

            var menuFinancial = new List <SubItem>();

            menuFinancial.Add(new SubItem("Создать"));
            var item3 = new ItemMenu("Пустой шаблон", menuFinancial, PackIconKind.Edit);

            Menu.Children.Add(new UserControlMenuItem(item1, this));
            Menu.Children.Add(new UserControlMenuItem(item2, this));
            Menu.Children.Add(new UserControlMenuItem(item3, this));
        }
示例#26
0
        public MainWindow()

        {
            InitializeComponent();

            var menuInicio = new List <SubItem>();
            var item0      = new ItemMenu("Inicio", menuInicio, PackIconKind.House);


            var menuCliente = new List <SubItem>();

            menuCliente.Add(new SubItem("Ingresar Cliente", new UserControlCrearCliente()));
            menuCliente.Add(new SubItem("Lista de Clientes", new UserControlListarCliente()));

            var item1 = new ItemMenu("Adm Clientes", menuCliente, PackIconKind.Account);


            var menuContrato = new List <SubItem>();

            menuContrato.Add(new SubItem("Ingresar Contrato", new UserControlAgregarContratos()));
            menuContrato.Add(new SubItem("Lista de Contratos", new UserControlListarContratos()));

            var item2 = new ItemMenu("Adm Contratos", menuContrato, PackIconKind.Contract);



            Menu.Children.Add(new UserControlMenuItem(item0, this));
            Menu.Children.Add(new UserControlMenuItem(item1, this));
            Menu.Children.Add(new UserControlMenuItem(item2, this));
        }
 public ItemMenuViewModel(ItemMenu itemMenu, MainViewModel context)
 {
     ExVisibility   = itemMenu.SubItems == null ? Visibility.Collapsed : Visibility.Visible;
     ListVisibility = itemMenu.SubItems == null ? Visibility.Visible : Visibility.Collapsed;
     ItemMenu       = itemMenu;
     Context        = context;
 }
示例#28
0
 private void button1_Click(object sender, EventArgs e)
 {
     if (dataGridView1.SelectedRows.Count > 0)
     {
         string Id;
         int    IdAux;
         Id    = dataGridView1.CurrentRow.Cells["codItem"].Value.ToString();
         IdAux = int.Parse(Id);
         ItemMenu i = new ItemMenu();
         if (i.EliminarItem(IdAux) == true)
         {
             MessageBox.Show("La modificacion se realizo con exito");
         }
         else
         {
             MessageBox.Show("La modificacion no se pudo realizar");
         }
         DataSet DS = new DataSet();
         i  = new ItemMenu();
         DS = i.MostrarItem();
         dataGridView1.DataSource = DS.Tables[0];
     }
     else
     {
         MessageBox.Show("Seleccione la fila a eliminar");
     }
 }
示例#29
0
            public HeroMenu(MenuFactory factory, string heroName)
            {
                var lang = SandboxConfig.Language;

                if (lang == "zh-Hans" || lang == "zh-Hant")
                {
                    Translations = JsonConvert.DeserializeObject <Dictionary <int, string> >(Resource1.cn);
                }
                else if (lang == "bg")
                {
                    Translations = JsonConvert.DeserializeObject <Dictionary <int, string> >(Resource1.ru);
                }
                else
                {
                    Translations = JsonConvert.DeserializeObject <Dictionary <int, string> >(Resource1.en);
                }

                this.Factory                   = factory.MenuWithTexture(Game.Localize(heroName), heroName);
                this.ItemMenu                  = Factory.Menu("Items", "items");
                this.LinkenBreakerMenu         = ItemMenu.Menu("Linken Breakers", "linkenbreakers");
                this.LinkenBreakerPriorityMenu = LinkenBreakerMenu.Item("Priority", new PriorityChanger(LinkenAbilityPriorityList));
                this.LinkenBreakerTogglerMenu  = LinkenBreakerMenu.Item("Toggler", new AbilityToggler(LinkenAbilityTogglerDic));

                this.UnitController = Factory.MenuWithTexture(Translations[2], "npc_dota_neutral_centaur_khan");
                this.Bodyblocker    = this.UnitController.MenuWithTexture(Translations[3], "earthshaker_fissure");
                var ucMenu = this.UnitController;
                var bb     = this.Bodyblocker;

                this.ControlUnits     = ucMenu.Item(Translations[4], true);
                this.Enabled          = bb.Item(Translations[5], true);
                this.UseUnitAbilities = ucMenu.Item(Translations[6], true);
                this.BlockSensitivity = bb.Item(Translations[7], new Slider(150, 50, 300));
                this.BlockSensitivity.Item.Tooltip = Translations[8];
            }
示例#30
0
 public static void Itemmenu()
 {
     ItemMenu = YMenu.AddSubMenu("Items", "QSS");
     ItemMenu.AddGroupLabel("Aggressive Items");
     ItemMenu.Add("Items", new CheckBox("Use Items"));
     ItemMenu.Add("myhp", new Slider("Use BOTRK if my HP is <=", 70, 0, 101));
     ItemMenu.AddGroupLabel("Qss");
     ItemMenu.Add("use", new KeyBind("Use QSS/Mercurial", true, KeyBind.BindTypes.PressToggle, 'K'));
     ItemMenu.Add("delay", new Slider("Activation Delay", 1000, 0, 2000));
     ItemMenu.Add("Blind",
                  new CheckBox("Blind", false));
     ItemMenu.Add("Charm",
                  new CheckBox("Charm"));
     ItemMenu.Add("Fear",
                  new CheckBox("Fear"));
     ItemMenu.Add("Polymorph",
                  new CheckBox("Polymorph"));
     ItemMenu.Add("Stun",
                  new CheckBox("Stun"));
     ItemMenu.Add("Snare",
                  new CheckBox("Snare"));
     ItemMenu.Add("Silence",
                  new CheckBox("Silence", false));
     ItemMenu.Add("Taunt",
                  new CheckBox("Taunt"));
     ItemMenu.Add("Suppression",
                  new CheckBox("Suppression"));
 }
示例#31
0
        public void addMenu(string controller_actual, string action_actual, string text, string controller, string action, string url, Object attributes, string icon)
        {
            Menu.item = new ItemMenu();
            item.Text = text;
            item.ControllerName = controller;
            item.ActionName = action;
            item.Url = url;
            item.icon = icon;

            if(attributes == null)
            {
                if(controller_actual.Equals(controller) && action_actual.Equals(action))
                {
                    item.HtmlAttributes = new { @class = "current" };
                }
                else {
                    item.HtmlAttributes = new { };
                }
            }else
            {
                item.HtmlAttributes = attributes;
            }
            this.items.Add(item);
        }
示例#32
0
 void Awake()
 {
     S = this;
 }
示例#33
0
    void OnGUI()
    {
        if (showSideBar)
        {
            GUI.skin = skinSideBar;

            // BACKGROUND
            GUI.DrawTexture(new Rect(0, 0, Screen.width / 3, Screen.height), textureSideBar);
            // TÍTULO
            GUI.Box(new Rect(0, 0, Screen.width / 3, Screen.height), "JUICINESS");

            // COLORS
            if (GUI.Button(new Rect(12.5f, 25f, 200, 20), "Colors"))
            {
                itemMenu = ItemMenu.Colors;
            }
            // TWEENING
            if (GUI.Button(new Rect(12.5f, 50f, 200, 20), "Tweening"))
            {
                itemMenu = ItemMenu.Tweening;
            }
            // STRETCH AND SQUEEZE
            if (GUI.Button(new Rect(12.5f, 75f, 200, 20), "Stretch and Squeeze"))
            {
                itemMenu = ItemMenu.StretchAndSqueezem;
            }
            // SOUNDS
            if (GUI.Button(new Rect(12.5f, 100f, 200, 20), "Sounds"))
            {
                itemMenu = ItemMenu.Sounds;
            }
            // PARTICLES
            if (GUI.Button(new Rect(12.5f, 125f, 200, 20), "Particles"))
            {
                itemMenu = ItemMenu.Particles;
            }
            // SCREEN SHAKE
            if (GUI.Button(new Rect(12.5f, 150f, 200, 20), "Screen Shake"))
            {
                itemMenu = ItemMenu.ScreenShake;
            }
            // PERSONALITY
            if (GUI.Button(new Rect(12.5f, 175f, 200, 20), "Personality"))
            {
                itemMenu = ItemMenu.Personality;
            }
            // FINISH HIM
            //if (GUI.Button(new Rect(12.5f, 200f, 200, 20), "Finish Him"))
            //{
            //    itemMenu = ItemMenu.FinishHim;
            //}
            //// OTHER
            //if (GUI.Button(new Rect(12.5f, 225f, 200, 20), "Other"))
            //{
            //    itemMenu = ItemMenu.Other;
            //}

            if (itemMenu == ItemMenu.Colors)
            {
                GUI.Label(new Rect(12.5f, 250f, 200, 20), "Colors");
                colors.ScreenColors = GUI.Toggle(new Rect(12.5f, 275f, 200, 20), colors.ScreenColors, "SCREEN COLORS");
                colors.BackgroundColorEffect = GUI.Toggle(new Rect(12.5f, 300f, 200, 20), colors.BackgroundColorEffect, "BACKGROUND COLOR EFFECT");

                ChangeColors();
                PlayerPrefs.SetInt("SCREEN_COLORS", System.Convert.ToInt32(colors.ScreenColors));
            }
            else if (itemMenu == ItemMenu.Tweening)
            {
                GUI.Label(new Rect(12.5f, 250f, 200, 20), "Tweening");
                tweening.Enabled = GUI.Toggle(new Rect(12.5f, 275f, 200, 20), tweening.Enabled, "TWEENING ENABLED");
                tweening.Bounce_Y = GUI.Toggle(new Rect(12.5f, 300f, 200, 20), tweening.Bounce_Y, "TWEENING BOUNCE Y");
                tweening.Rotation_Smooth = GUI.Toggle(new Rect(12.5f, 325f, 200, 20), tweening.Rotation_Smooth, "TWEENING ROTATION SMOOTH");
                tweening.Time_Scale = GUI.Toggle(new Rect(12.5f, 350f, 200, 20), tweening.Time_Scale, "TWEENING TIME SCALE");
                tweening.Shake = GUI.Toggle(new Rect(12.5f, 380f, 200, 20), tweening.Shake, "TWEENING SHAKE");

                PlayerPrefs.SetInt("TWEENING ENABLE", System.Convert.ToInt32(tweening.Enabled));
                PlayerPrefs.SetInt("TWEENING ROTATION SMOOTH", System.Convert.ToInt32(tweening.Enabled && tweening.Rotation_Smooth));
                PlayerPrefs.SetInt("TWEENING TIME SCALE", System.Convert.ToInt32(tweening.Enabled && tweening.Time_Scale));
                PlayerPrefs.SetInt("TWEENING BOUNCE Y", System.Convert.ToInt32(tweening.Enabled && tweening.Bounce_Y));
                PlayerPrefs.SetInt("TWEENING SHAKE", System.Convert.ToInt32(tweening.Enabled && tweening.Shake));
            }
            else if (itemMenu == ItemMenu.StretchAndSqueezem)
            {
                GUI.Label(new Rect(12.5f, 250f, 200, 20), "Stretch and Squeezem");
                stretchAndSqueeze.ShipStretch = GUI.Toggle(new Rect(12.5f, 275f, 200, 20), stretchAndSqueeze.ShipStretch, "SHIP STRETCH");
                //stretchAndSqueeze.AmmoStretch = GUI.Toggle(new Rect(12.5f, 350f, 200, 20), stretchAndSqueeze.AmmoStretch, "AMMO STRETCH");
                stretchAndSqueeze.AlienStretch = GUI.Toggle(new Rect(12.5f, 300f, 200, 20), stretchAndSqueeze.AlienStretch, "ALIEN STRETCH");
                //stretchAndSqueeze.WallStretch = GUI.Toggle(new Rect(12.5f, 325f, 200, 20), stretchAndSqueeze.WallStretch, "WALL STRETCH");

                ChangeShipStretch();
                //ChangeAmmoStretch();
                ChangeAlienStretch();
                //ChangeWallStretch();
            }
            else if (itemMenu == ItemMenu.Sounds)
            {
                GUI.Label(new Rect(12.5f, 250f, 200, 20), "Sounds");
                sounds.Ammo = GUI.Toggle(new Rect(12.5f, 275f, 200, 20), sounds.Ammo, "SOUND AMMO");
                sounds.Kill = GUI.Toggle(new Rect(12.5f, 300f, 200, 20), sounds.Kill, "SOUND KILL");
                sounds.Effects = GUI.Toggle(new Rect(12.5f, 325f, 200, 20), sounds.Effects, "SOUND EFFECTS");
                sounds.Music = GUI.Toggle(new Rect(12.5f, 350f, 200, 20), sounds.Music, "SOUND MUSIC");
                
                ChangeMusic();
            }
            else if (itemMenu == ItemMenu.Particles)
            {
                GUI.Label(new Rect(12.5f, 250f, 200, 20), "Particles");
                particles.AmmoCollision = GUI.Toggle(new Rect(12.5f, 275f, 200, 20), particles.AmmoCollision, "PARTICLES AMMO COLLISION");
                //particles.AmmoSmoke = GUI.Toggle(new Rect(12.5f, 275f, 200, 20), particles.AmmoSmoke, "PARTICLES AMMO SMOKE");
                particles.FallOff = GUI.Toggle(new Rect(12.5f, 300f, 200, 20), particles.FallOff, "FALL OFF");
                particles.Dark = GUI.Toggle(new Rect(12.5f, 325f, 200, 20), particles.Dark, "DARK");
                //particles.BlockRotate = GUI.Toggle(new Rect(12.5f, 400f, 200, 20), particles.BlockRotate, "BLOCK ROTATE");
                //particles.BlockDarken = GUI.Toggle(new Rect(12.5f, 425f, 200, 20), particles.BlockDarken, "BLOCK DARKEN");
                //particles.BlockShatter = GUI.Toggle(new Rect(12.5f, 450f, 200, 20), particles.BlockDarken, "BLOCK SHATTER");
                //particles.ParticleBlockShatter = GUI.Toggle(new Rect(12.5f, 475f, 200, 20), particles.BlockDarken, "PARTICLE BLOCK SHATTER");
                //particles.ParticlePaddleCollision = GUI.Toggle(new Rect(12.5f, 500f, 200, 20), particles.ParticlePaddleCollision, "PARTICLE PADDLE COLLISION");
                //particles.BallTrail = GUI.Toggle(new Rect(12.5f, 525f, 200, 20), particles.BallTrail, "BALL TRAIL");
            }
            else if (itemMenu == ItemMenu.ScreenShake)
            {
                GUI.Label(new Rect(12.5f, 250f, 200, 20), "Screen Shake");
                screenShake.Shake = GUI.Toggle(new Rect(12.5f, 275f, 200, 20), screenShake.Shake, "SCREEN SHAKE");
                GUI.Label(new Rect(12.5f, 300f, 100, 20), "SHAKE POWER");
                screenShake.ShakePower = GUI.HorizontalSlider(new Rect(110f, 305f, 80, 20), screenShake.ShakePower, 0f, 0.2f); // SHAKE POWER
                GUI.Label(new Rect(197.5f, 300f, 100, 20), screenShake.ShakePower.ToString("f2"));

                Camera.main.GetComponent<CameraShake>().coef_shake_intensity = screenShake.ShakePower;
            }
            else if (itemMenu == ItemMenu.Personality)
            {
                GUI.Label(new Rect(12.5f, 250f, 200, 20), "Personality");
                personality.ShipFace = GUI.Toggle(new Rect(12.5f, 275f, 200, 20), personality.ShipFace, "SHIP FACE");
                //personality.PaddleLookAtBall = GUI.Toggle(new Rect(12.5f, 300f, 200, 20), personality.PaddleLookAtBall, "PADDLE LOOK AT BALL");
                //GUI.Label(new Rect(12.5f, 325f, 100, 20), "PADDLE SMILE");
                //personality.PaddleSmile = GUI.HorizontalSlider(new Rect(110f, 330f, 80, 20), personality.PaddleSmile, 0f, 100f); // PADDLE SMILE
                //GUI.Label(new Rect(197.5f, 325f, 100, 20), personality.PaddleSmile.ToString("f2"));
                //GUI.Label(new Rect(12.5f, 350f, 100, 20), "PADDLE EYE SIZE");
                //personality.PaddleEyeSize = GUI.HorizontalSlider(new Rect(110f, 355f, 80, 20), personality.PaddleEyeSize, 0f, 300f); // PADDLE EYE SIZE
                //GUI.Label(new Rect(197.5f, 350f, 100, 20), personality.PaddleEyeSize.ToString("f2"));
                //GUI.Label(new Rect(12.5f, 375f, 100, 20), "EYE SEPARATION");
                //personality.PaddleEyeSeparation = GUI.HorizontalSlider(new Rect(110f, 380f, 80, 20), personality.PaddleEyeSeparation, 0f, 60f); // PADDLE EYE SEPARATION
                //GUI.Label(new Rect(197.5f, 375f, 100, 20), personality.PaddleEyeSeparation.ToString("f2"));

                shipEyes.SetActive(personality.ShipFace);
            }
            else if (itemMenu == ItemMenu.FinishHim)
            {
                //GUI.Label(new Rect(12.5f, 250f, 200, 20), "Finish Him");
                //finishHim.ScreenColorGlitch = GUI.Toggle(new Rect(12.5f, 275f, 200, 20), finishHim.ScreenColorGlitch, "SCREEN COLOR GLITCH");
            }
            else if (itemMenu == ItemMenu.Other)
            {
                //GUI.Label(new Rect(12.5f, 250f, 200, 20), "Other");
                //GUI.Label(new Rect(12.5f, 275f, 100, 20), "NUM BALLS");
                //other.NumBalls = GUI.HorizontalSlider(new Rect(110f, 280f, 80, 20), other.NumBalls, 0f, 1f); // NUM BALLS
                //GUI.Label(new Rect(197.5f, 275f, 100, 20), other.NumBalls.ToString("f2"));
            }
        }
    }
示例#34
0
 public void agregarItem(ItemMenu pItem)
 {
     if ListaItem[0] = pItem;
     ListaItem[longitud + 1] = item;
 }
示例#35
0
 /*---------------------------------------------------------------------------------------
 -- FUNCTION: 	Start
 -- DATE: 		17/02/2016
 -- REVISIONS:   
 -- DESIGNER:  	Joseph Tam-Huang
 -- PROGRAMMER: 	Joseph Tam-Huang
 -- INTERFACE: 	void Start()
 -- RETURNS: 	void
 -- NOTES:
 -- Retrieves the Inventory script, the Tooltip script and the ItemMenu script.
 ----------------------------------------------------------------------------------------*/
 void Start()
 {
     _inventory = GameObject.Find("Inventory").GetComponent<Inventory>();
     _tooltip = _inventory.GetComponent<Tooltip>();
     _item_menu = _inventory.GetComponent<ItemMenu>();
 }