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

  • Home
  • SEARCH
  • 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 8013033
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T19:31:08+00:00 2026-06-04T19:31:08+00:00

I am currently trying to develop a mobile barcode reader in Windows Phone 7.5

  • 0

I am currently trying to develop a mobile barcode reader in Windows Phone 7.5 using the ZXing library.
Seeing that I am posting here, you might already have guessed that I am facing some kind of problem that I don’t know any solution to.

The problem is the following:
The ZXing library allows for multiple barcode formats – however, I’d like to include a settings menu for the user to focus on one barcode specifically.

The BarcodeFormat-object is static and contains the readonly members (of type BarcodeFormat) that I want to assign.

Seeing and hearing that Reflection is THE powerful weapon for dynamic behaviour like this, I thought I’d give it a try.

So far I have code that gets all the possible formats from ZXing using

MemberInfo[] plist = typeof(BarcodeFormat).GetMembers();

That works for getting the names of the formats, meaning I can successfully show the names in a list.
But I am running into a problem when trying to assign these formats to the actual reader, because I only have the MemberInfo and no longer the BarcodeFormat.

So far I have only found examples where the user wanted to access (set / get) variables dynamically.
The proposed solutions however did not seem to fit my problem – at least I didn’t find any way to assign the format in those ways.

Any help would be great 🙂
Thank you very much.

EDIT:
The BarcodeFormat is used like this:

WP7BarcodeManager.ScanMode = BarcodeFormat.ITF;

In this example, only barcodes in the ITF (interleaved 2 out of 5) format would be accepted.

I have so far tried the following approaches.

Simply assign the MemberInfo object instead of the original BarcodeFormat object.

Cast the MemberInfo object to BarcodeFormat.

I tried to use FieldInfo and getValue, however it seems that I have to create an example object and assign a value to the needed field in order to get the value. This can’t be done here, because the object is static and the field is readonly.

The whole ZXing library is compiled as a DLL that I link my project to. (it seems to be linked correctly, because everything else works). An example declaration of BarcodeFormat looks like this

public static readonly BarcodeFormat ITF
  • 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-04T19:31:10+00:00Added an answer on June 4, 2026 at 7:31 pm

    get ITF dynamically:

    var formatName = "ITF";
    var format = typeof(BarcodeFormat)
       .GetProperty(formatName, BindingFlags.Static | BindingFlags.Public)
       .GetValue(null, null);
    

    set WP7BarcodeManager.ScanMode:

    WP7BarcodeManager.ScanMode = (BarcodeFormat)format;
    

    ps

    member to BarcodeFormat:

    var _format = member is PropertyInfo 
      ? ((PropertyInfo)member).GetValue(null, null)
      : ((FieldInfo)member).GetValue(null);
    var format = (BarcodeFormat)_format;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I an trying to develop a windows application using C# that can play streamed
I'm trying to develop an ebook reader(for mobile devices) which is platform independent. Currently
I'm currently trying to develop an interactive chart using the RaphaelJS vector library. I
Here's my problem. I'm currently trying to develop a .Net Compact Framework 2.0 application
Currently, I'm trying to develop a rich internet application using Flash Builder 4 Beta
I am currently using Mono for Android to develop a mobile application. I have
I am trying to develop an android module for titanium mobile 1.8.1. Here are
I'm currently trying to develop a project based upon Firemonkey. I'm using Firemonkey for
I am currently trying to develop a simple plugin for visual studio 2008 using
I am currently trying to develop a small simulation program in xna that takes

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.