Archives

Archives / 2006 / July
  • ASP.NET Podcast Show #59 - Julie Lerman

    Subscribe – Everybody is doing it

    ASP.NET Podcast url (for a direct download):
    Show Notes:
    • Star Trek/2.0 on G4.  Has the world gone "2.0 Mad"?
    • Book industry
      • Java is down and .NET is up.
      • AJAX has gone from nowhere to somewhere.
    • Jason Gaylord interviews Julie Lerman
    • Databinding.
      • Datalist.  Some interesting things that I found.
      • Editable Gridview.  Does this look right or should I be doing something different.  Please send me your feedback.

    Read more...

  • Reflecting over the Page from an ASP.NET Server control at design time and some debugging pain

    I am working on an ASP.NET server control, and one of the properties of that control will typically contain a name of a boolean property that the Page exposes. At runtime this boolean property is called/examined and some action is taken as a result, however at design time, I wanted my ASP.NET control to be able to reflect over the page it is hosted on, and present a dropdown list of properties to select from, based on what the page has exposed.

    Read more...

  • Updating Component properties in the designer

    I have been working on a set of custom ASP.NET controls that offer specific design time experience for a client. Part of that is to make some existing controls very designer friendly. Apart from some custom rendering, I have been adding SmartTag support to the control to enhance the design time experience. For those unaware, a good example of a SmartTag (or ActionList in coding terms) is shown below:

    Read more...

  • ASP.NET Podcast Show #57 - Wally on Interfaces

    Wally pumps out another podcast.

    Subscribe.  You KNOW you want it.

     

    Download.  Kinda like your father’s Oldsmobile.

     

    URL: http://aspnetpodcast.com/CS11/blogs/asp.net_podcast/archive/2006/06/29/340.aspx

     

    Show Notes:

    namespace CallingInterface

    {

          /// <summary>

          /// Summary description for Class1.

          /// </summary>

          public interface ICalling

          {

                bool GetConfig();

                bool Start();

                bool Stop();

                string Test();

                string ConfigFileLocation

                {

                      set;

                      get;

                }

          }

    }

    Dynamic Loading & Calling a mehod
          string strConfigFile;

          string strType = String.Empty;

          ArrayList aryListClassInfo;

          cLoader objLoad = new cLoader();

          AssemblyTypeClassInfo atci;

          strConfigFile = objLoad.GetConfigFile();

          Assembly assembly;

          aryListClassInfo = objLoad.LoadAssemblyInfoConfigFile(strConfigFile);

          aryListClassInfo = objLoad.LoadAssemblyInfoConfigFile(strConfigFile);

          foreach(Object obj in aryListClassInfo)

          {

                atci = (AssemblyTypeClassInfo)obj;

                assembly = Assembly.LoadFile(System.Windows.Forms.Application.StartupPath + @"\" + atci.AssemblyLocation);

                if (null != assembly)

                {

                      foreach(Type typDyn in assembly.GetTypes())

                      {

                            if ((typDyn.FullName == atci.ClassName) && (typDyn.IsClass == true))

                            {

                                  try

                                  {

                                        object objClass = Activator.CreateInstance(typDyn);

                                        if ( objClass is CallingInterface.ICalling  )

                                        {

                                              atci.TypeOfObject = typDyn;

                                              atci.objRef = objClass;

                                              typDyn.InvokeMember("ConfigFileLocation", BindingFlags.SetProperty | BindingFlags.Default, null, objClass, new Object[] {strConfigFile}); // Set a property

                                              object Result = typDyn.InvokeMember("GetConfig", BindingFlags.Default | BindingFlags.InvokeMethod, null, objClass, null);  // Call a method.

                                              Result = typDyn.InvokeMember("Start", BindingFlags.Default | BindingFlags.InvokeMethod, null, objClass, null);  // Call another method.

                                        }

                                  }

                                  catch(Exception exc)

                                  {

                                        Console.WriteLine("Exception: " + exc.Message);

                                  }

                                  finally

                                  {

                                  }

                            }

                      }

                }

          }

    Read more...