Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8045007
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T05:24:29+00:00 2026-06-05T05:24:29+00:00

A strange thing, I have two enum sets: public enum ComponentActionTypes { Add =

  • 0

A strange thing, I have two enum sets:

public enum ComponentActionTypes {
    Add = 0,
    Move = 1,
    Delete = 2,
    Edit = 3,
    Enable = 4,
    Disable = 5
}
public enum ComponentNames {
    Component = 0,
    Logo = 1,
    Main_menu = 2,
    Search_box = 3,
    Highlighter = 4,
    RSS = 5,
    Twitter = 6,
    YouTube = 7
}

when I try to print the following text,

ActionText =
string.Format("{0}ed a {1}", action.ComponentActionType, action.ComponentName);

will generate:

184ed a Logo instead of Added a Logo

action.ComponentActionType is converted to number (ToString didn’t help) and also a

strange number (like 184, not the enum number itself)

Any idea how to solve this?

Update:

namespace BrandToolbar.Common.ActionLog.Model
{
    public class ActionItem
    {
        public Guid UserId { get; set; }
        public Int64 PublicId { get; set; }
        public ComponentActionTypes ComponentActionType { get; set; }
        public DateTime Date { get; set; }
        public ComponentNames ComponentName { get; set; }
        public string UiJsonPreview { get; set; }
    }
}


public static ActionItemUI ConvertModelToUiObj(ActionItem action)
{
    return new ActionItemUI()
    {
        ActionText = string.Format(
            "{0}ed a {1}",
            action.ComponentActionType,
            action.ComponentName
        ).Replace("_", " "),
        TooltipText = string.Format(
            "{0}ed on {1}",
            action.ComponentActionType,
            action.Date.ToString(StringFormatter.DateFormat)
        ),
        ImageUrl = string.Empty,
        ConponentText = string.Empty
    };
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T05:24:32+00:00Added an answer on June 5, 2026 at 5:24 am

    Can you check how the ComponentActionType field is filled? Enum values can contain other values than listed. For example: this is perfectly valid:

        enum foo {A = 1,B = 2,C = 3};
        var b = (foo)7;
    

    (If it wasn’t allowed by default, masking with enums would not be possible). The string representation in this case for b is 7, because it cannot be matched to an item in the enumeration.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have two different mvc3 projects. The strange thing now when i log into
I have this strange thing with input and output streams, whitch I just can't
I have a kind of strange thing that I really nead for my text
I have the following query, now the strange thing is if I run this
during my debug sessions I found a strange thing occurring. I have an EditText
I found a very interesting/strange thing about MAX() function in SQL. I have column
I have the method below to parse data from the twitter search, strange thing
I have two classes: class Foo{ public int FooId { get; set; } ...
Using RoR 2.3.8. I have two models. It's strange that when I typed text
Seeing some strange things; help is being solicited. I have a query, like so:

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.