/// <summary> /// Initializes a new instance of the Widget class /// </summary> /// <param name="generator">Generator the widget handler was created with</param> /// <param name="type">Type of widget handler to create from the generator for this widget</param> /// <param name="initialize">True to initialize the widget, false to defer that to the caller</param> protected Widget(Generator generator, Type type, bool initialize = true) { this.Generator = generator; this.Handler = generator.CreateHandler(type, this); if (initialize) { Initialize(); } }
/// <summary> /// Gets the folder path for the specified special folder /// </summary> /// <param name="g">Generator to use</param> /// <param name="folder">Special folder to retrieve the path for</param> /// <returns>Path of the specified folder</returns> public static string GetFolderPath(Generator g, EtoSpecialFolder folder) { var handler = g.CreateHandler <IEtoEnvironment>(); return(handler.GetFolderPath(folder)); }