Example #1
0
        internal void SetSecurityACLs()
        {
            bool LogEnabled;

            try
            {
                GetProfileMutex("SetSecurityACLs", "");
                sw.Reset(); sw.Start(); // Start timing this call
                TL.LogMessage("SetSecurityACLs", "");

                // Force logging to be enabled for this...
                LogEnabled = TL.Enabled; // Save logging state
                TL.Enabled = true;
                RunningVersions(TL);     // Capture date in case logging wasn't initially enabled

                // Set security ACLs on profile root directory
                TL.LogMessage("SetSecurityACLs", "Setting security ACLs on ASCOM root directory ");
                FileStore.SetSecurityACLs(TL);
                sw.Stop(); TL.LogMessage("  ElapsedTime", "  " + sw.ElapsedMilliseconds + " milliseconds");
                TL.Enabled = LogEnabled; // Restore logging state
            }
            catch (Exception ex)
            {
                TL.LogMessageCrLf("SetSecurityACLs", "Exception: " + ex.ToString());
                throw;
            }
        }