/// <summary> /// Performs a callback. Null action and/or result are permitted. /// </summary> /// <param name="action">The optional callback action.</param> /// <param name="result">The result to pass back.</param> protected static void Callback(Action<ServiceResult> action, ServiceResult result) { if (action != null) { action(result); } }
/// <summary> /// Read the run parameters. /// </summary> /// <param name="result">The service result.</param> private void ReadRunParameters(ServiceResult result) { XElement xe = result.TryGetElement(); if (xe != null) { Dictionary<string, string> settings = xe.Descendants("option").ToTransformedDictionary((option) => option.Attribute("name").Value, (option) => option.Attribute("value").Value); foreach (string key in settings.Keys) { Settings[key] = settings[key]; } } // Clear the loading message SetPageTitle(string.Empty); // Allow the other services to initialize base.Initialize(); }
/// <summary> /// Retrieve an environment variable from the system. /// </summary> /// <param name="name">The variable name.</param> /// <param name="callback">The callback action.</param> public virtual void GetEnvironmentVariable(string name, Action <ServiceResult> callback) { Callback(callback, ServiceResult.CreateExceptionalResult(new NotSupportedException("Environment is not yet implemented."))); }