예제 #1
0
            /// <summary>
            /// Initializes a new instance of the <see cref="ToolbarItem"/> class.
            /// </summary>
            /// <param name="parent">The parent.</param>
            /// <param name="type">The type.</param>
            /// <param name="pos">The position.</param>
            /// <param name="sprite">The sprite.</param>
            public ToolbarItem(Control parent, ToolbarItemType type, Vector2 pos, ISprite sprite)
                : base(parent, pos, new Vector2(_itemSize))
            {
                Sprite = sprite;
                _type  = type;

                Tooltip = TooltipHandler;
            }
예제 #2
0
        public static string GetToolbarItemTypeCssClass(ToolbarItemType type)
        {
            switch (type)
            {
            case ToolbarItemType.Default: return(String.Empty);

            case ToolbarItemType.BulkSelect: return(BulkSelect);

            case ToolbarItemType.ChipGroup: return(ChipGroup);

            case ToolbarItemType.OverflowMenu: return(OverflowMenu);

            case ToolbarItemType.Pagination: return(Pagination);

            case ToolbarItemType.SearchFilter: return(SearchFilter);

            default: throw new NotImplementedException();
            }
        }
예제 #3
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ToolbarEventArgs"/> class.
 /// </summary>
 /// <param name="itemType"><see cref="ToolbarItemType"/> for the Toolbar item that raised the event.</param>
 /// <param name="control">The <see cref="Control"/> that raised the event.</param>
 public ToolbarEventArgs(ToolbarItemType itemType, Control control)
 {
     _itemType = itemType;
     _control = control;
 }
예제 #4
0
 public ToolbarItem(ToolbarItemType type, Cursor cursor)
 {
     _cursor = cursor;
     _type = type;
     LoadTexture(type);
 }
예제 #5
0
 private void LoadTexture(ToolbarItemType type)
 {
     if (type == ToolbarItemType.Food)
         _texture = GameLoop.GlobalContent.Load<Texture2D>("foodSquare");
     else if (type == ToolbarItemType.Crop)
         _texture = GameLoop.GlobalContent.Load<Texture2D>("cropSquare");
     else if (type == ToolbarItemType.Mine)
         _texture = GameLoop.GlobalContent.Load<Texture2D>("mineSquare");
     else if (type == ToolbarItemType.Industry)
         _texture = GameLoop.GlobalContent.Load<Texture2D>("industrySquare");
     else if (type == ToolbarItemType.Sawmill)
         _texture = GameLoop.GlobalContent.Load<Texture2D>("sawSquare");
     else if (type == ToolbarItemType.Carpenter)
         _texture = GameLoop.GlobalContent.Load<Texture2D>("carpenterSquare");
     else if (type == ToolbarItemType.Mason)
         _texture = GameLoop.GlobalContent.Load<Texture2D>("masonSquare");
     else if (type == ToolbarItemType.Furnace)
         _texture = GameLoop.GlobalContent.Load<Texture2D>("furnisSquare");
     else if (type == ToolbarItemType.Equiptment)
         _texture = GameLoop.GlobalContent.Load<Texture2D>("squareToolItem");
     else if (type == ToolbarItemType.Kitchen)
         _texture = GameLoop.GlobalContent.Load<Texture2D>("kitchenSquare");
     else if (type == ToolbarItemType.Brewery)
         _texture = GameLoop.GlobalContent.Load<Texture2D>("brewerySquare");
     else if (type == ToolbarItemType.Toolsmith)
         _texture = GameLoop.GlobalContent.Load<Texture2D>("toolsmithSquare");
     else if (type == ToolbarItemType.Pasturing)
         _texture = GameLoop.GlobalContent.Load<Texture2D>("pasturingSquare");
     else if (type == ToolbarItemType.Electronics)
         _texture = GameLoop.GlobalContent.Load<Texture2D>("electricitySquare");
     else if (type == ToolbarItemType.Battery)
         _texture = GameLoop.GlobalContent.Load<Texture2D>("batterySquare");
     else if (type == ToolbarItemType.ElectricBik)
         _texture = GameLoop.GlobalContent.Load<Texture2D>("bikeSquare");
     else if (type == ToolbarItemType.CoalPower)
         _texture = GameLoop.GlobalContent.Load<Texture2D>("coalSquare");
     else if (type == ToolbarItemType.Weaver)
         _texture = GameLoop.GlobalContent.Load<Texture2D>("clowthSquare");
     else if (type == ToolbarItemType.IndoorCrop)
         _texture = GameLoop.GlobalContent.Load<Texture2D>("indoorSquare");
     else if (type == ToolbarItemType.Bed)
         _texture = GameLoop.GlobalContent.Load<Texture2D>("bedSquare");
     else
     {
         throw new Exception("Unknown toolbaritem type");
     }
 }
예제 #6
0
            /// <summary>
            /// Initializes a new instance of the <see cref="ToolbarItem"/> class.
            /// </summary>
            /// <param name="parent">The parent.</param>
            /// <param name="type">The type.</param>
            /// <param name="pos">The position.</param>
            /// <param name="sprite">The sprite.</param>
            public ToolbarItem(Control parent, ToolbarItemType type, Vector2 pos, ISprite sprite)
                : base(parent, pos, new Vector2(_itemSize))
            {
                Sprite = sprite;
                _type = type;

                Tooltip = TooltipHandler;
            }
예제 #7
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ToolbarEventArgs"/> class.
 /// </summary>
 /// <param name="itemType"><see cref="ToolbarItemType"/> for the Toolbar item that raised the event.</param>
 /// <param name="control">The <see cref="Control"/> that raised the event.</param>
 public ToolbarEventArgs(ToolbarItemType itemType, Control control)
 {
     _itemType = itemType;
     _control  = control;
 }