Esempio n. 1
0
        public override void Do()
        {
            base.Do();

            oldSelection        = GridLayer.Selection;
            GridLayer.Selection = new GridSelection(GridLayer, selectArea);
        }
        public override void Do()
        {
            base.Do();

            oldSelection        = GridLayer.Selection;
            GridLayer.Selection = null;
        }
Esempio n. 3
0
        private void Grid_Aanpassen_Click(object sender, RoutedEventArgs e) //Deze Click Event komt uiteindelijk bij de features.xaml
        {
            string GridSelection;

            if (Grid_Selection.SelectedValue == null)
            {
                GridSelection = "";
            }
            else
            {
                GridSelection = Grid_Selection.SelectedValue.ToString(); //Hoe kan ik dit met NULL door laten gaan??
            }
            if (GridSelection.Contains("16 (4x4)"))
            {
                PlayField_Clear();

                for (int i = 0; i < 4; i++) //i = 4, vanwege een grid van 4 x 4
                {
                    playfield.RowDefinitions.Add(new RowDefinition());
                    playfield.ColumnDefinitions.Add(new ColumnDefinition());
                }
            }
            else if (GridSelection.Contains("36 (6x6)"))
            {
                PlayField_Clear();

                for (int i = 0; i < 6; i++)
                {
                    playfield.RowDefinitions.Add(new RowDefinition());
                    playfield.ColumnDefinitions.Add(new ColumnDefinition());
                }
            }

            Console.WriteLine(GridSelection);
        }
Esempio n. 4
0
        private void frmBiayaOperasionalBrowse_Load(object sender, EventArgs e)
        {
            this.WindowState = FormWindowState.Maximized;

            rdbTanggal.FromDate = GlobalVar.DateOfServer;
            rdbTanggal.ToDate   = GlobalVar.DateOfServer;

            selectedGrid = GridSelection.Header;

            cmdSearch_Click(sender, e);
            Modus = enumModus.Clear;
            SetEnable();
        }
Esempio n. 5
0
        private async Task MoveToRight()
        {
            await Task.WhenAll(CollapseSelector(),
                               LblLeftSelectedText.FadeTo(0, 200),
                               LblLeftUnselectedText.FadeTo(1, 200),
                               Task.Delay(200));

            await Task.WhenAll(GridSelection.TranslateTo(GridContent.Width / 2, 0, 200),
                               Task.Delay(200));

            await Task.WhenAll(ExpandSelector(),
                               LblRightSelectedText.FadeTo(1, 200),
                               LblRightUnselectedText.FadeTo(0, 200),
                               Task.Delay(200));
        }
        public async Task <IActionResult> ProductDelete(GridSelection selection)
        {
            var ids        = selection.GetEntityIds();
            var numDeleted = 0;

            if (ids.Any())
            {
                var products = await _db.Products.GetManyAsync(ids, true);

                // TODO: (core) Actually delete!
                numDeleted = products.Count;
            }

            return(Json(new { Success = true, Count = numDeleted }));
        }
Esempio n. 7
0
        public override void Do()
        {
            base.Do();

            oldSelection        = GridLayer.Selection;
            GridLayer.Selection = new GridSelection(GridLayer, area);
            GridLayer.Selection.SetUnderFromGrid();

            for (int i = 0; i < area.Width; i++)
            {
                for (int j = 0; j < area.Height; j++)
                {
                    GridLayer.Grid[i + area.X, j + area.Y] = newBits[i, j];
                }
            }
        }
        public override void Do()
        {
            base.Do();

            oldSelection        = GridLayer.Selection;
            GridLayer.Selection = null;

            oldBits = new bool[oldSelection.Area.Width, oldSelection.Area.Height];
            for (int i = 0; i < oldSelection.Area.Width; i++)
            {
                for (int j = 0; j < oldSelection.Area.Height; j++)
                {
                    oldBits[i, j] = GridLayer.Grid[i + oldSelection.Area.X, j + oldSelection.Area.Y];
                    GridLayer.Grid[i + oldSelection.Area.X, j + oldSelection.Area.Y] = oldSelection.Under[i, j];
                }
            }
        }
        public async Task <IActionResult> QueuedEmailDelete(GridSelection selection)
        {
            var ids        = selection.GetEntityIds().ToList();
            var numDeleted = 0;

            if (ids.Any())
            {
                numDeleted = await _db.QueuedEmails
                             .Where(x => ids.Contains(x.Id))
                             .BatchDeleteAsync();
            }

            return(Json(new
            {
                Success = true,
                Count = numDeleted
            }));
        }
Esempio n. 10
0
    public override void OnInspectorGUI()
    {
        DrawDefaultInspector();

        GridSelection selection = (GridSelection)target;
        Transform     parent    = GridSelection.grid.transform.parent;

        if (parent != null && parent.GetComponent <Map>())
        {
            if (GUILayout.Button("Create MapEvent2D"))
            {
                MapEvent2D mapEvent = Instantiate(AssetDatabase.LoadAssetAtPath <MapEvent2D>(PrefabPath)).GetComponent <MapEvent2D>();
                mapEvent.name = "Event" + Random.Range(1000000, 9999999);
                Map map = parent.GetComponent <Map>();
                GameObjectUtility.SetParentAndAlign(mapEvent.gameObject, map.objectLayer.gameObject);
                Undo.RegisterCreatedObjectUndo(mapEvent, "Create " + mapEvent.name);
                mapEvent.SetLocation(MapEvent2D.GridLocationTileCoords(GridSelection.position));
                Selection.activeObject = mapEvent.gameObject;
            }
        }
    }
Esempio n. 11
0
        public async Task <IActionResult> CookieInfoDelete(GridSelection selection)
        {
            var numDeleted = 0;

            // First deserialize setting.
            var ciList = JsonConvert.DeserializeObject <List <CookieInfo> >(_privacySettings.CookieInfos);

            foreach (var name in selection.SelectedKeys)
            {
                ciList.Remove(x => x.Name.EqualsNoCase(name));
                numDeleted++;
            }

            // Now serialize again.
            _privacySettings.CookieInfos = JsonConvert.SerializeObject(ciList, Formatting.None);

            // Save setting.
            await Services.Settings.ApplySettingAsync(_privacySettings, x => x.CookieInfos, 0);

            return(Json(new { Success = true, Count = numDeleted }));
        }
        public async Task <IActionResult> GenericAttributeDelete(GridSelection selection, string entityName)
        {
            var ids        = selection.GetEntityIds();
            var numDeleted = 0;

            if (ids.Any())
            {
                var(readPermission, updatePermission) = GetGenericAttributesInfos(entityName);

                if (updatePermission.HasValue() && !await Services.Permissions.AuthorizeAsync(updatePermission))
                {
                    NotifyError(await Services.Permissions.GetUnauthorizedMessageAsync(updatePermission));
                    return(Json(new { Success = false, Count = numDeleted }));
                }

                numDeleted = await _db.GenericAttributes
                             .Where(x => ids.Contains(x.Id))
                             .BatchDeleteAsync();
            }

            return(Json(new { Success = true, Count = numDeleted }));
        }
Esempio n. 13
0
        public FilterControl(PPDDevice device, PPDFramework.Resource.ResourceManager resourceManager, ISound sound, SongSelectFilter filter) : base(device)
        {
            this.sound  = sound;
            this.filter = filter;
            selection   = new GridSelection();

            PictureObject back;

            var mainSprite = new SpriteObject(device);

            mainSprite.AddChild(new TextureString(device, Utility.Language["SortField"], 22, PPDColors.White)
            {
                Position = new Vector2(50, 80)
            });
            var sortFieldSprite = new SpriteObject(device);

            this.AddChild(sortFieldSprite);
            sortFieldSprite.AddChild(nameRadio = new RadioBoxComponent(device, resourceManager, Utility.Path, Utility.Language["Name"])
            {
                Position = new Vector2(80, 120),
                Selected = true
            });
            nameRadio.Update();
            sortFieldSprite.AddChild(timeRadio = new RadioBoxComponent(device, resourceManager, Utility.Path, Utility.Language["Time"])
            {
                Position = new Vector2(nameRadio.Position.X + nameRadio.Width + Margin, 120)
            });
            timeRadio.Update();
            sortFieldSprite.AddChild(updateDateRadio = new RadioBoxComponent(device, resourceManager, Utility.Path, Utility.Language["UpdateDate"])
            {
                Position = new Vector2(timeRadio.Position.X + timeRadio.Width + Margin, 120)
            });
            updateDateRadio.Update();
            sortFieldSprite.AddChild(bpmRadio = new RadioBoxComponent(device, resourceManager, Utility.Path, Utility.Language["BPM"])
            {
                Position = new Vector2(updateDateRadio.Position.X + updateDateRadio.Width + Margin, 120)
            });
            bpmRadio.Update();
            sortFieldSprite.AddChild(authorRadio = new RadioBoxComponent(device, resourceManager, Utility.Path, Utility.Language["Author"])
            {
                Position = new Vector2(bpmRadio.Position.X + bpmRadio.Width + Margin, 120)
            });

            mainSprite.AddChild(new TextureString(device, Utility.Language["SortOrder"], 22, PPDColors.White)
            {
                Position = new Vector2(50, 160)
            });
            var sortOrderSprite = new SpriteObject(device);

            this.AddChild(sortOrderSprite);
            sortOrderSprite.AddChild(ascRadio = new RadioBoxComponent(device, resourceManager, Utility.Path, Utility.Language["Ascendant"])
            {
                Position = new Vector2(80, 200)
            });
            nameRadio.Update();
            sortOrderSprite.AddChild(descRadio = new RadioBoxComponent(device, resourceManager, Utility.Path, Utility.Language["Descendant"])
            {
                Position = new Vector2(ascRadio.Position.X + ascRadio.Width + Margin, 200)
            });

            mainSprite.AddChild(new TextureString(device, Utility.Language["Type"], 22, PPDColors.White)
            {
                Position = new Vector2(50, 240)
            });
            mainSprite.AddChild(easyCheck = new CheckBoxComponent(device, resourceManager, Utility.Path, "EASY")
            {
                Position = new Vector2(80, 280)
            });
            easyCheck.Update();
            mainSprite.AddChild(normalCheck = new CheckBoxComponent(device, resourceManager, Utility.Path, "NORMAL")
            {
                Position = new Vector2(easyCheck.Position.X + easyCheck.Width + Margin, 280)
            });
            normalCheck.Update();
            mainSprite.AddChild(hardCheck = new CheckBoxComponent(device, resourceManager, Utility.Path, "HARD")
            {
                Position = new Vector2(normalCheck.Position.X + normalCheck.Width + Margin, 280)
            });
            hardCheck.Update();
            mainSprite.AddChild(extremeCheck = new CheckBoxComponent(device, resourceManager, Utility.Path, "EXTREME")
            {
                Position = new Vector2(hardCheck.Position.X + hardCheck.Width + Margin, 280)
            });
            mainSprite.AddChild(normalScoreCheck = new CheckBoxComponent(device, resourceManager, Utility.Path, Utility.Language["NormalScore"])
            {
                Position = new Vector2(80, 320)
            });
            normalScoreCheck.Update();
            mainSprite.AddChild(acScoreCheck = new CheckBoxComponent(device, resourceManager, Utility.Path, Utility.Language["ACScore"])
            {
                Position = new Vector2(normalScoreCheck.Position.X + normalScoreCheck.Width + Margin, 320)
            });
            acScoreCheck.Update();
            mainSprite.AddChild(acftScoreCheck = new CheckBoxComponent(device, resourceManager, Utility.Path, Utility.Language["ACFTScore"])
            {
                Position = new Vector2(acScoreCheck.Position.X + acScoreCheck.Width + Margin, 320)
            });

            mainSprite.AddChild(setDefaultButton = new ButtonComponent(device, resourceManager, Utility.Path, Utility.Language["SetDefault"])
            {
                Position = new Vector2(300, 370)
            });

            selectList = new SelectableComponent[] {
                nameRadio,
                timeRadio,
                updateDateRadio,
                bpmRadio,
                authorRadio,
                ascRadio,
                descRadio,
                easyCheck,
                normalCheck,
                hardCheck,
                extremeCheck,
                normalScoreCheck,
                acScoreCheck,
                acftScoreCheck,
                setDefaultButton
            };
            foreach (SelectableComponent comp in selectList)
            {
                selection.Add(comp.Position);
            }

            this.AddChild(mainSprite);
            this.AddChild(back = new PictureObject(device, resourceManager, Utility.Path.Combine("dialog_back.png")));
            this.AddChild(new RectangleComponent(device, resourceManager, PPDColors.Black)
            {
                RectangleHeight = 450,
                RectangleWidth  = 800,
                Alpha           = 0.65f
            });
            back.AddChild(new TextureString(device, Utility.Language["Filter"], 30, PPDColors.White)
            {
                Position = new Vector2(35, 30)
            });

            Inputed     += FilterControl_Inputed;
            GotFocused  += FilterControl_GotFocused;
            LostFocused += FilterControl_LostFocused;
        }
Esempio n. 14
0
 private void dgvDetail_Click(object sender, EventArgs e)
 {
     selectedGrid = GridSelection.Detail;
 }
Esempio n. 15
0
 private void dgvHeader_Click(object sender, EventArgs e)
 {
     selectedGrid = GridSelection.Header;
 }
Esempio n. 16
0
        protected GeneralDialogBase(PPDDevice device, PPDFramework.Resource.ResourceManager resourceManager,
                                    ISound sound, string displayText, string[] buttonTexts) : base(device)
        {
            this.sound = sound;
            selection  = new GridSelection();
            sprite     = new SpriteObject(device);
            back       = new EffectObject(device, resourceManager, Utility.Path.Combine("tweetconfirm.etd"))
            {
                Position = new Vector2(400, 225)
            };
            message = new TextureString(device, displayText, 16, 340, 300, true, PPDColors.White)
            {
                Position = new Vector2(230, 120)
            };

            black = new RectangleComponent(device, resourceManager, PPDColors.Black)
            {
                RectangleHeight = 450,
                RectangleWidth  = 800
            };

            buttons = new Button[buttonTexts.Length];
            if (buttons.Length == 1)
            {
                buttons[0] = new Button(device, resourceManager, Utility.Path, buttonTexts[0])
                {
                    Position = new Vector2(400, 315)
                };
                buttons[0].Selected = false;
                sprite.AddChild(buttons[0]);
                selection.Add(buttons[0].Position);
            }
            else
            {
                rowCount = (int)Math.Ceiling(buttonTexts.Length / 2f);
                for (int i = 0; i < buttons.Length; i++)
                {
                    int rowIndex    = i / 2;
                    int columnIndex = i % 2;
                    buttons[i] = new Button(device, resourceManager, Utility.Path, buttonTexts[i])
                    {
                        Position = new Vector2(300 + columnIndex * 200, 315 - (rowCount - rowIndex - 1) * 50)
                    };
                    buttons[i].Selected = false;
                    sprite.AddChild(buttons[i]);
                    selection.Add(buttons[i].Position);
                }
            }

            buttons[0].Selected = true;

            black.Alpha = 0;

            back.Hidden   = true;
            sprite.Hidden = true;

            GotFocused  += PreviewPlayDialog_GotFocused;
            LostFocused += PreviewPlayDialog_LostFocused;
            Inputed     += PreviewPlayDialog_Inputed;

            sprite.AddChild(message);

            this.AddChild(sprite);
            this.AddChild(back);
            this.AddChild(black);
        }
Esempio n. 17
0
        public GameRuleComponent(PPDDevice device, PPDFramework.Resource.ResourceManager resourceManager, ISound sound) : base(device)
        {
            this.resourceManager = resourceManager;
            this.sound           = sound;

            this.AddChild(back = new PictureObject(device, resourceManager, Utility.Path.Combine("dialog_back.png")));
            this.AddChild(new RectangleComponent(device, resourceManager, PPDColors.Black)
            {
                RectangleHeight = 450,
                RectangleWidth  = 800,
                Alpha           = 0.75f
            });

            back.AddChild(ruleSprite = new SpriteObject(device));
            ruleSprite.AddChild(itemSupplyTypeSprite = new SpriteObject(device));
            back.AddChild(new TextureString(device, Utility.Language["ChangeRule"], 30, PPDColors.White)
            {
                Position = new Vector2(35, 30)
            });

            ruleSprite.AddChild(resultSort = new ListBoxComponent(device, resourceManager, Utility.Path, Utility.Language["RankOrder"], Utility.Language["Score"], Utility.Language["Accuracy"])
            {
                Position = new SharpDX.Vector2(80, 80),
                Selected = true
            });
            ruleSprite.AddChild(itemAvailable = new CheckBoxComponent(device, resourceManager, Utility.Path, Utility.Language["ItemAvailable"])
            {
                Position = new SharpDX.Vector2(50, 120)
            });
            ruleSprite.AddChild(okButton = new ButtonComponent(device, resourceManager, Utility.Path, Utility.Language["OK"])
            {
                Position = new Vector2(270, 380)
            });
            ruleSprite.AddChild(cancelButton = new ButtonComponent(device, resourceManager, Utility.Path, Utility.Language["Cancel"])
            {
                Position = new Vector2(470, 380)
            });
            ruleSprite.AddChild(maxItemCount = new ListBoxComponent(device, resourceManager, Utility.Path, Utility.Language["MaxItemCount"], 1, 2, 3, 4, 5, 6)
            {
                Position = new Vector2(110, 160)
            });
            itemSupplyTypeSprite.AddChild(comboSupply = new RadioBoxComponent(device, resourceManager, Utility.Path, Utility.Language["DependentOnComboOrWorst"])
            {
                Position = new Vector2(80, 200)
            });
            ruleSprite.AddChild(comboSupplyCount = new ListBoxComponent(device, resourceManager, Utility.Path, Utility.Language["ItemPerCombo"], 50, 60, 70, 80, 90, 100)
            {
                Position = new Vector2(130, 240)
            });
            ruleSprite.AddChild(worstSupplyCount = new ListBoxComponent(device, resourceManager, Utility.Path, Utility.Language["ItemPerWorst"], 50, 60, 70, 80, 90, 100)
            {
                Position = new Vector2(130, 280)
            });
            itemSupplyTypeSprite.AddChild(rankSupply = new RadioBoxComponent(device, resourceManager, Utility.Path, Utility.Language["DependentOnRank"])
            {
                Position = new Vector2(80, 320)
            });

            selectList = new SelectableComponent[] {
                resultSort,
                itemAvailable,
                maxItemCount,
                comboSupply,
                comboSupplyCount,
                worstSupplyCount,
                rankSupply,
                okButton,
                cancelButton
            };
            gridSelection = new GridSelection();
            foreach (SelectableComponent comp in selectList)
            {
                gridSelection.Add(comp.Position);
            }
            resultSort.SelectedItem       = Utility.Language[gameRule.ResultSortType.ToString()];
            itemAvailable.Checked         = gameRule.ItemAvailable;
            comboSupply.Checked           = gameRule.ItemSupplyType == ItemSupplyType.ComboWorstCount;
            rankSupply.Checked            = gameRule.ItemSupplyType == ItemSupplyType.Rank;
            comboSupplyCount.SelectedItem = gameRule.ItemSupplyComboCount;
            worstSupplyCount.SelectedItem = gameRule.ItemSupplyWorstCount;
            maxItemCount.SelectedItem     = gameRule.MaxItemCount;

            Inputed    += ItemSettingComponent_Inputed;
            GotFocused += ItemSettingComponent_GotFocused;
        }
Esempio n. 18
0
        public async Task <IActionResult> DeleteExecutionInfos(GridSelection selection)
        {
            var numDeleted = await _taskStore.DeleteExecutionInfosByIdsAsync(selection.GetEntityIds());

            return(Json(new { Success = true, Count = numDeleted }));
        }