/// <summary>
        /// Updates the specified application including both, metadata information
        /// and fields.
        /// </summary>
        /// <param name="appConfig">Configuration information used to update the application.</param>
        /// <param name="recreate">Value indicating wheter to recreate the application.</param>
        public static void UpdateApplication(SSOAppConfig appConfig, bool recreate)
        {
            using (TransactionScope transactionScope = new TransactionScope())
            {
                // create SSO objects
                ISSOAdmin2      ssoAdmin       = new ISSOAdmin2();
                ISSOConfigStore ssoConfigStore = new ISSOConfigStore();

                // enlist them in the transaction
                SSOManager.Enlist(ssoAdmin as IPropertyBag, Transaction.Current);
                SSOManager.Enlist(ssoConfigStore as IPropertyBag, Transaction.Current);

                // check if the application needs to be recreated or just updated
                if (recreate == true)
                {
                    // delete and recreate
                    SSOManager.DeleteApplication(ssoAdmin, appConfig.AppInfo.Name);
                    SSOManager.CreateApplication(ssoAdmin, appConfig);
                }
                else
                {
                    // just update the application metadata
                    SSOManager.UpdateApplicationInfo(ssoAdmin, appConfig.AppInfo);
                }

                // update the application fields
                ssoConfigStore.SetConfigInfo(appConfig.AppInfo.Name, SSOManager.ConfigIdentifier, appConfig.AppFields);
                // commit the transaction
                transactionScope.Complete();
            }
        }
        /// <summary>
        /// Updates the application metadata information.
        /// </summary>
        /// <param name="appInfo">Application metadata information.</param>
        public static void UpdateApplicationInfo(SSOAppInfo appInfo)
        {
            ISSOAdmin2 ssoAdmin = new ISSOAdmin2();

            SSOManager.UpdateApplicationInfo(ssoAdmin, appInfo);
        }