public override IChoProfile ConstructProfile(IChoProfile outerProfile)
        {
            lock (_padLock)
            {
                string fileName  = ChoPropertyManager.Translate(FileName);
                string directory = ChoPropertyManager.Translate(Directory);
                string message   = ChoPropertyManager.Translate(Message);

                ChoBufferProfile bufferProfile = null;
                if (String.IsNullOrEmpty(fileName))
                {
                    bufferProfile = new ChoBufferProfile(Condition, (StreamWriter)null, message, outerProfile, false);
                }
                else
                {
                    bufferProfile = new ChoBufferProfile(Condition, ChoFileProfileSettings.GetFullPath(directory, fileName), Mode, message, outerProfile, false);
                }

                return(DelayedAutoStart ? ChoBufferProfile.DelayedAutoStart(bufferProfile) : bufferProfile);
            }
        }
Exemplo n.º 2
0
        private static void iniDocument_IgnoredEntry(object sender, ChoIniDocumentEventArgs e)
        {
            if (e == null || e.IniDocumentStates == null)
            {
                return;
            }

            foreach (ChoIniDocumentState iniDocumentState in e.IniDocumentStates)
            {
                ChoProfile.RegisterIfNotExists(iniDocumentState.IniFilePath, new ChoBufferProfileEx(ChoFileProfileSettings.GetFullPath(ChoReservedDirectoryName.Others,
                                                                                                                                       ChoPath.AddExtension(Path.GetFileName(iniDocumentState.IniFilePath), ChoReservedFileExt.Ignore)),
                                                                                                    "Entries Ignored are..."));
                ChoProfile.GetContext(iniDocumentState.IniFilePath).AppendLine(iniDocumentState.ToString());
            }
        }