Foros del Web » Programación para mayores de 30 ;) » .NET »

Gadgets en C#

Estas en el tema de Gadgets en C# en el foro de .NET en Foros del Web. Hola gente, estoy haciendo un programa como dice el titulo en C#... y ahora me entro la necesidad de meter gadgets ya sea de igoogle ...
  #1 (permalink)  
Antiguo 04/11/2009, 21:25
 
Fecha de Ingreso: julio-2008
Ubicación: Santa Fe
Mensajes: 66
Antigüedad: 15 años, 9 meses
Puntos: 0
Gadgets en C#

Hola gente, estoy haciendo un programa como dice el titulo en C#... y ahora me entro la necesidad de meter gadgets ya sea de igoogle o vi algunos muy bonitos de yahoo...

La idea es meter, hora, pronostico, noticias en el windows form...

La cuestion es que googlé un poco y busque algo en este foro pero no encuentro ni nada concreto, ni parecido....

Si alguien alguna vez pudo hacer esto, o sabe por donde empezar o como orientarme, me serviria de gran ayuda!.
  #2 (permalink)  
Antiguo 04/11/2009, 21:28
Avatar de Peterpay
Colaborador
 
Fecha de Ingreso: septiembre-2007
Ubicación: San Francisco, United States
Mensajes: 3.858
Antigüedad: 16 años, 8 meses
Puntos: 87
Respuesta: Gadgets en C#

la forma mas rapida seria usar objetos WebBrowser y ahi apuntar a archivos html q contenga tu codigo de tus gadgets o widgets.

mira esto

http://www.codeproject.com/KB/gadget...hInWindow.aspx
__________________
Curso WF4
http://cursos.gurudotnet.com/ DF
Aprende HTML5

Última edición por Peterpay; 05/11/2009 a las 10:34 Razón: error en el link
  #3 (permalink)  
Antiguo 05/11/2009, 08:40
 
Fecha de Ingreso: julio-2008
Ubicación: Santa Fe
Mensajes: 66
Antigüedad: 15 años, 9 meses
Puntos: 0
Respuesta: Gadgets en C#

No entiendo porque me pasaste el link de un vocero de noticias... pero mas o menos tu idea la entiendo...
  #4 (permalink)  
Antiguo 05/11/2009, 10:33
Avatar de Peterpay
Colaborador
 
Fecha de Ingreso: septiembre-2007
Ubicación: San Francisco, United States
Mensajes: 3.858
Antigüedad: 16 años, 8 meses
Puntos: 87
Respuesta: Gadgets en C#

Cita:
Iniciado por maverick19 Ver Mensaje
No entiendo porque me pasaste el link de un vocero de noticias... pero mas o menos tu idea la entiendo...
disculpame jajaja me equivoque de link jajaja

http://www.codeproject.com/KB/gadget...hInWindow.aspx
__________________
Curso WF4
http://cursos.gurudotnet.com/ DF
Aprende HTML5
  #5 (permalink)  
Antiguo 05/11/2009, 11:58
 
Fecha de Ingreso: julio-2008
Ubicación: Santa Fe
Mensajes: 66
Antigüedad: 15 años, 9 meses
Puntos: 0
Respuesta: Gadgets en C#

Bueno, lo q hice fue buscar un par de gadgets en internet donde me tiraban el codigo siguiente de ejemplo:

Código HTML:
<script type="text/javascript" src="http://widgets.widgadget.com/js/irisjs.js"></script>
<script type="text/javascript" src="http://widgets.widgadget.com/api/widgets/irisjs.php/output/js/wid/2012"></script> 
Y en C# creaba un WebForm y ponia lo siguiente:

this.webBrowser1.Url = new System.Uri(System.Environment.CurrentDirectory + "\\" + "gadget.html", System.UriKind.Absolute);

Y anda perfecto... ahora la complicamos...

Consigo unos gadgets de windows... de los cuales un es el famoso "Weather.Gadget"...



y tiene 3 archivos... 1 XML y 2 HTML, hago el mismo procedimiento... pero ya empiezo a tener problemas, con que no encuentra lo que tendria q encontrar...



A continuacion pongo lo que tiene el weather.html

Código HTML:
<!--//
////////////////////////////////////////////////////////////////////////////////
//
//  THIS CODE IS NOT APPROVED FOR USE IN/ON ANY OTHER UI ELEMENT OR PRODUCT COMPONENT.  
//  Copyright (c) 2009 Microsoft Corporation.  All rights reserved.
//
////////////////////////////////////////////////////////////////////////////////
//-->

<html dir="ltr">
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <title>Weather</title>
    <link href="css/weather.css" rel="stylesheet" type="text/css"/>
    <script src="js/highDpiImageSwap.js" type="text/javascript" language="javascript"></script>
    <script src="js/localizedStrings.js" type="text/javascript" language="javascript"></script>
    <script src="js/library.js" type="text/javascript" language="javascript"></script>
    <script src="js/weather.js" type="text/javascript" language="javascript"></script>
  </head>
  <body id="WeatherGadget" onLoad="setup();" onUnload="cleanup();" scroll="no" UNSELECTABLE="on">
  <g:background id="WeatherBG" style="z-index:-1" />
    <object id="factory" classid="clsid:9DCC3CC8-8609-4863-BAD4-03601F4C65E8" width="0"
        height="0" border="0" type="application/x-oleobject">
    </object>
    <script language="javascript" for="factory">
        function factory::StatusChanged( status )
        {
            System.Debug.outputString("Received Status Change Event");
            System.Debug.outputString("Status: " + status);

            MicrosoftGadget.APIStatusChanged( status );
        }
        function factory::NewLatLongReport( report )
        {
            System.Debug.outputString("Received Location Change Event");
            if ( !LOCATION_SENSING_AUTO_STATES_ARRAY.exists( MicrosoftGadget.currentState ) )
            {
                System.Debug.outputString("Location Change Event ignored");
                return;
            }
            
            try
            {
                System.Debug.outputString("Latitude: " + report.Latitude);
                System.Debug.outputString("Longitude: " + report.Longitude);
                if ( ( (report.Latitude >= -90) && (report.Latitude <= 90) && (report.Longitude <= 180) && (report.Longitude >= -180) ) )
                {
                    MicrosoftGadget.onLocationEventFired( report );
                }
                else
                {
                    System.Debug.outputString( "Invalid Location Data" );
                }
            }
            catch(err)
            {
                System.Debug.outputString( "Error in location packet recieved" );
                System.Debug.outputString( "Error Description: " + err.description + "");
            }
        }
    </script>
    <div id="DockedModeDisplayArea">
      <label id="AgeStampTextDockedMode"></label>
      <div id="DockedModeCurrentConditionsText">
        <div id="TemperatureCurrent"></div>
        <div id="PlaceDockedMode">
            <a href=# id="PlaceHrefDockedMode" target="_blank"></a>
        </div>
        <div id="LocationAPIStatusDockedMode">
              <img id="SensorIconDockedMode" src="images/grayStateIcon.png" alt="" />
        </div>
      </div>
      <img id="DockedModeAccessibilityInformation"  alt="" src="images/1px.gif" border="0" />
    </div>
    <div id="UnDockedModeDisplayArea"> 
      <div id="UnDockedModeCurrentConditionsText">
        <div id="PlaceUnDockedMode">
          <a href=# id="PlaceHrefUnDockedMode" target="_blank"></a>
        </div>
        <div id="LocationAPIStatusUndockedMode">
              <img id="SensorIconUndockedMode" src="images/grayStateIcon.png"  alt="" />
        </div>
        <span id="ConditionCurrentUnDockedMode"></span>
        <div id="TemperatureCurrentUnDockedMode"></div>
        <div id="Today">
          <table cellpadding="0" cellspacing="0">
            <tr>
              <td id="TemperatureHigh0" class="TemperatureHigh"></td>
              <td id="TemperatureSeparator"></td>
              <td id="TemperatureLow0" class="TemperatureLow"></td>
            </tr>
          </table>
        </div>
      </div>
      <div id="UnDockedModeForecasts">
        <table id="Forecasts" cellpadding="0" cellspacing="0" summary="Weather Forecast">
          <colgroup>
            <col width="28" align="right"/>
            <col width="47" align="center"/>
          </colgroup>
          <colgroup width="0*"></colgroup>
          <colgroup>
            <col width="28" align="right"/>
            <col width="47" align="center"/>
          </colgroup>
          <colgroup width="0*"></colgroup>
          <colgroup>
            <col width="28" align="right"/>
            <col width="47" align="center"/>
          </colgroup>
          <thead valign="baseline">
            <tr>
              <th id="Forecast1" class="ForecastDay" colspan="2" rowspan="2" scope="colgroup">
                <a href="#" id="DayOfWeek1" class="DayOfWeek" target="_blank"></a>
              </th>
              <th class="ForecastSeparatorHeaderSection" abbr="" scope="col"><div></div></th>
              <th id="Forecast2" class="ForecastDay" colspan="2" rowspan="2" scope="colgroup">
                <a href="#" id="DayOfWeek2" class="DayOfWeek" target="_blank"></a>
              </th>
              <th class="ForecastSeparatorHeaderSection" abbr="" scope="col"><div></div></th>
              <th id="Forecast3" class="ForecastDay" colspan="2" rowspan="2" scope="colgroup">
                <a href="#" id="DayOfWeek3" class="DayOfWeek" target="_blank"></a>
              </th>
            </tr>
          </thead>
          <tfoot>
            <tr>
              <td id="Separator" colspan="8"><div></div></td>
            </tr>
            <tr>
              <td colspan="8">
                <label id="Attribution"></label>
                <label id="AgeStampTextUndockedMode"></label>
              </td>
            </tr>
          </tfoot>
          <tbody>
            <tr>
              <td class="TemperatureRange" headers="Forecast1">
                <label id="TemperatureHigh1" class="TemperatureHigh"></label>
                <label id="TemperatureLow1" class="TemperatureLow"></label>
              </td>
              <td class="SkyCodeImage" headers="Forecast1">
                <img id="SkyCodeImage1" alt="" src="images/1px.gif" width="42" height="34" />
              </td>
              <td class="ForecastSeparator"></td>
              <td class="TemperatureRange" headers="Forecast2">
                <label id="TemperatureHigh2" class="TemperatureHigh"></label>
                <label id="TemperatureLow2" class="TemperatureLow"></label>
              </td>
              <td class="SkyCodeImage" headers="Forecast2">
                <img id="SkyCodeImage2" alt="" src="images/1px.gif" width="42" height="34" />
              </td>
              <td class="ForecastSeparator"></td>
              <td class="TemperatureRange" headers="Forecast3">
                <label id="TemperatureHigh3" class="TemperatureHigh"></label>
                <label id="TemperatureLow3" class="TemperatureLow"></label>
              </td>
              <td class="SkyCodeImage" headers="Forecast3">
                <img id="SkyCodeImage3" alt="" src="images/1px.gif" width="42" height="34" />
              </td>
            </tr>
          </tbody>
        </table>
      </div>
      <img id="UnDockedModeAccessibilityInformation"  alt="" src="images/1px.gif" border="0" />
    </div>
    <div id="WeatherMessage">
      <table cellpadding="3" cellspacing="0">
        <tr>
          <td>
              <div id='PleaseWaitLoadingSpinner'></div>
              <div id='WeatherMessageIcon'></div>
              <span id="message"></span>
          </td>
        </tr>
      </table>
    </div>
  </body>
  <script language="VBscript">
    Function vbsGetLocale()
      vbsGetLocale = GetLocale()
    End Function
  </script>
</html> 
  #6 (permalink)  
Antiguo 05/11/2009, 12:00
 
Fecha de Ingreso: julio-2008
Ubicación: Santa Fe
Mensajes: 66
Antigüedad: 15 años, 9 meses
Puntos: 0
Respuesta: Gadgets en C#

el gadget.xml:

Código HTML:
<?xml version="1.0" encoding="utf-16"?>
<gadget>
  <name>El Tiempo</name>
  <namespace><!--_locComment_text="{Locked}"-->microsoft.windows</namespace>
  <version><!--_locComment_text="{Locked}"-->1.1.0.0</version>
  <author name="Microsoft Corporation">
    <info url="http://go.microsoft.com/fwlink/?LinkId=124093" text="www.gallery.microsoft.com"/>
    <logo src="logo.png"/>
  </author>
  <copyright>
    <!--_locComment_text="{Locked}"-->© 2009</copyright>
  <description>Consulte previsiones del tiempo en todo el mundo.</description>
  <icons>
    <icon width="130" height="67" src="icon.png"/>
  </icons>
  <hosts>
    <host name="sidebar">
      <autoscaleDPI><!--_locComment_text="{Locked}"-->true</autoscaleDPI>
      <base type="HTML" apiVersion="1.0.0" src="Weather.html"/>
      <permissions><!--_locComment_text="{Locked}"-->Full</permissions>
      <platform minPlatformVersion="1.0"/>
      <defaultImage src="drag.png"/>
    </host>
  </hosts>
</gadget> 
y el setting.html:

Código HTML:
<!--//
////////////////////////////////////////////////////////////////////////////////
//
//  THIS CODE IS NOT APPROVED FOR USE IN/ON ANY OTHER UI ELEMENT OR PRODUCT COMPONENT.  
//  Copyright (c) 2009 Microsoft Corporation.  All rights reserved.
//
////////////////////////////////////////////////////////////////////////////////
//-->
<html dir="ltr">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <title>Weather Settings</title>
    <link href="css/settings.css" rel="stylesheet" type="text/css" />
    <link href="css/localizedSettings.css" rel="stylesheet" type="text/css" />

    <script src="js/localizedStrings.js" type="text/javascript" language="javascript"></script>

    <script src="js/library.js" type="text/javascript" language="javascript"></script>

    <script src="js/settings.js" type="text/javascript" language="javascript"></script>

</head>
<body onLoad="setup();">
    <object id="factory" classid="clsid:9DCC3CC8-8609-4863-BAD4-03601F4C65E8" width="0"
        height="0" border="0" type="application/x-oleobject">
    </object>
    <script language="javascript" for="factory">
        function factory::StatusChanged( status )
        {
            System.Debug.outputString("Received Status Change Event");
            System.Debug.outputString("Status: " + status);
            MicrosoftGadget.onAPIStatusChange( status );
        }
    </script>
    <span id='PleaseWaitLoadingSpinner'></span>
    <div id="PlaceTitle" class="SettingsTitle">
    </div>
    <div id="PlaceCurrent" class="SettingsTitle">
    </div>
    <div>
        <div id="LabelSelectLocation" class="SettingsTitle">
        </div>
        <input id="radioManually" type="radio" name="radioAutomaticallySelected" value="F"
            checked="checked" onFocus="reConfigManual()" />
	<label id="radioManuallyAccName" style="display:none" for="radioManually"></label>
        <div id="textBoxBackground">
        </div>
        <input type="text" id="txtInputPlace" class="TextInputInactiveDefaultText" onKeyDown="return textBoxSearch();"
            onmousedown="doBeginInput()" onBlur="doBlurInputBox();" onFocus="doFocusInputBox()"
            onmouseover="doSetHelperText()" />
	<label id="txtInputPlaceAccName" style="display:none" for="txtInputPlace"></label>
        <a href="javascript:doMouseUpSearchButton();" id="btnSearchForPlace" class="btnSearch"
            onmousedown="doMouseDownSearchButton();" onMouseUp="" onMouseOver="doMouseOverSearchButton();"
            onmouseout="doMouseOutSearchButton();" onKeyDown="if ( event.keyCode == 13 || event.keyCode == 32 ) { return textBoxSearch(); }">
        </a>
        <input id="radioAutomatically" type="radio" name="radioAutomaticallySelected" value="T" onFocus="reConfigAuto()" />
        <label id="LabelAutomatically" class="radioAutomaticallySelected" for="radioAutomatically"></label>
        <div id="PlacePossibilities">
        </div>
    </div>
    <div id="privacyLinkDiv">
        <a id="privacyArticleLink" href="#" target="_blank"></a>
    </div>
    <input type="hidden" id="WeatherLocationCode" />
    <input type="hidden" id="WeatherLocation" />
    <div id="DisplayDegreesRadioSetDiv">
        <table id="DegreesRadioSet" cellpadding="0" cellspacing="0">
            <tr>
                <td colspan="2">
                    <span id="lgdDisplayTemperatureIn" class="SettingsTitle"></span>
                </td>
            </tr>
            <tr>
                <td>
                    <input id="radioFahrenheit" type="radio" name="radioDegrees" value="F" /><label id="lblFahrenheit"
                        class="RadioDegree" for="radioFahrenheit"></label>
                </td>
            </tr>
            <tr>
                <td>
                    <input id="radioCelsius" type="radio" name="radioDegrees" value="C" /><label id="lblCelsius"
                        class="RadioDegree" for="radioCelsius"></label>
                </td>
            </tr>
        </table>
        <div id="txtSearchedLocationFoundOnDialogDismiss">
        </div>
    </div>
</body>
</html> 
  #7 (permalink)  
Antiguo 09/11/2009, 19:00
 
Fecha de Ingreso: julio-2008
Ubicación: Santa Fe
Mensajes: 66
Antigüedad: 15 años, 9 meses
Puntos: 0
Respuesta: Gadgets en C#

Alguna idea?
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 07:37.