/// <summary> /// Run /// </summary> public bool Run(ICommandProgram commandProgram, string[] args) { try { if (commandProgram != null) { if (!commandProgram.Setup(args)) { return(false); } if (!commandProgram.Initialize(args)) { return(false); } if (!commandProgram.Run(args)) { return(false); } } } catch (Exception fallBackException) { Energy.Core.Log.Default.Write(fallBackException); throw; } return(true); }
/// <summary> /// Constructor /// </summary> public Application(System.Type type) : base() { // create // if (type == null) { return; } if (null != Energy.Base.Class.GetClassInterface(type, typeof(Energy.Interface.ICommandProgram))) { Energy.Interface.ICommandProgram app = Activator.CreateInstance(type) as Energy.Interface.ICommandProgram; this._CommandProgram = app; } }