Click here to Skip to main content
15,915,160 members
Home / Discussions / C#
   

C#

 
GeneralRe: IQueryable or IEnumerable as returns from Repositories Pin
PIEBALDconsult1-Mar-12 11:42
mvePIEBALDconsult1-Mar-12 11:42 
QuestionIs it possible to battery status of Digital camera using c# and WIA? Pin
Icarii1-Mar-12 4:15
Icarii1-Mar-12 4:15 
AnswerRe: Is it possible to battery status of Digital camera using c# and WIA? Pin
Dave Kreskowiak1-Mar-12 9:00
mveDave Kreskowiak1-Mar-12 9:00 
GeneralRe: Is it possible to battery status of Digital camera using c# and WIA? Pin
Icarii1-Mar-12 9:49
Icarii1-Mar-12 9:49 
GeneralRe: Is it possible to battery status of Digital camera using c# and WIA? Pin
#realJSOP1-Mar-12 10:08
professional#realJSOP1-Mar-12 10:08 
GeneralRe: Is it possible to battery status of Digital camera using c# and WIA? Pin
Icarii1-Mar-12 9:50
Icarii1-Mar-12 9:50 
GeneralRe: Is it possible to battery status of Digital camera using c# and WIA? Pin
Dave Kreskowiak1-Mar-12 12:59
mveDave Kreskowiak1-Mar-12 12:59 
GeneralRe: Is it possible to battery status of Digital camera using c# and WIA? Pin
Icarii1-Mar-12 16:50
Icarii1-Mar-12 16:50 
Dave, thank for your replies.

I got it to work using C# and WIA. Here is the code.

C#
private void BatteryWIAStatus()
{
    if (camera != null)
    {
        camera.ExecuteCommand(WIA.CommandID.wiaCommandSynchronize);
        try
        {
            foreach (WIA.Property i in camera.Properties)
            {

                if (i.Name == "Battery Status")
                {
                    string bStat = i.get_Value().ToString();
                    lblBattery.Text = "Battery " + bStat + "%";
                }
            }
        }
        catch (Exception ex)
        {
            MessageBox.Show(ex.Message, "Error has occurred!", MessageBoxButtons.OK, MessageBoxIcon.Error);
        }

    }
}


I put the Synchronize command in to update the status as it appears the battery status is cached. Still testing that part.
QuestionExchange Server 2007 - Commands Pin
Sebastian T Xavier29-Feb-12 22:53
Sebastian T Xavier29-Feb-12 22:53 
AnswerRe: Exchange Server 2007 - Commands Pin
Dave Kreskowiak1-Mar-12 3:37
mveDave Kreskowiak1-Mar-12 3:37 
QuestionQuick Constructor Question Pin
Kevin Marois29-Feb-12 12:01
professionalKevin Marois29-Feb-12 12:01 
AnswerRe: Quick Constructor Question Pin
RobCroll29-Feb-12 13:36
RobCroll29-Feb-12 13:36 
GeneralRe: Quick Constructor Question Pin
J4amieC1-Mar-12 5:22
J4amieC1-Mar-12 5:22 
AnswerRe: Quick Constructor Question Pin
GParkings29-Feb-12 22:47
GParkings29-Feb-12 22:47 
AnswerRe: Quick Constructor Question Pin
BobJanova1-Mar-12 5:27
BobJanova1-Mar-12 5:27 
QuestionPassing values between classes Pin
CCodeNewbie29-Feb-12 10:33
CCodeNewbie29-Feb-12 10:33 
AnswerRe: Passing values between classes Pin
Wes Aday29-Feb-12 10:54
professionalWes Aday29-Feb-12 10:54 
GeneralRe: Passing values between classes Pin
CCodeNewbie29-Feb-12 11:11
CCodeNewbie29-Feb-12 11:11 
GeneralRe: Passing values between classes Pin
Wes Aday29-Feb-12 11:24
professionalWes Aday29-Feb-12 11:24 
GeneralRe: Passing values between classes Pin
CCodeNewbie29-Feb-12 11:37
CCodeNewbie29-Feb-12 11:37 
GeneralRe: Passing values between classes Pin
Pete O'Hanlon29-Feb-12 11:45
mvePete O'Hanlon29-Feb-12 11:45 
GeneralRe: Passing values between classes Pin
CCodeNewbie29-Feb-12 11:56
CCodeNewbie29-Feb-12 11:56 
GeneralRe: Passing values between classes Pin
Wes Aday29-Feb-12 12:44
professionalWes Aday29-Feb-12 12:44 
GeneralRe: Passing values between classes Pin
Pete O'Hanlon29-Feb-12 22:14
mvePete O'Hanlon29-Feb-12 22:14 
GeneralRe: Passing values between classes Pin
CCodeNewbie5-Mar-12 6:07
CCodeNewbie5-Mar-12 6:07 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.