public static AppenderConsulter GetAppender(string AppenderName)
        {
            AppenderConsulter oConsulter = new AppenderConsulter();

            oConsulter.InitConsulter(AppenderName);
            return(oConsulter);
        }
Ejemplo n.º 2
0
 private void ddlAppenderClasses_SelectedIndexChanged(object sender, EventArgs e)
 {
     if (bSkipScrollChangeEvent)
     {
         bSkipScrollChangeEvent = false;
     }
     else
     {
         moConsulter = null;
         InitGroupArgument();
     }
 }
Ejemplo n.º 3
0
 private void InitGroupArgument()
 {
     if (moConsulter == null)
     {
         try
         {
             moConsulter = AppenderConsulter.GetAppender(ddlAppenderClasses.Text);
         }
         catch (InvalidCastException)
         {
             moConsulter = null;
         }
     }
     argPanel.Controls.Clear();
     vSrlBar4grp.Value = 0;
     if (moConsulter == null)
     {
         txtDesc.Text    = "Default basic consulter can't work.";
         btnSave.Enabled = false;
     }
     else
     {
         txtDesc.Text = moConsulter.GetAppenderDesc();
     }
     btnSave.Enabled = true;
     ArgumentStruct[] structArray1 = moConsulter.Arguments;
     if (structArray1 != null)
     {
         foreach (ArgumentStruct struct1 in structArray1)
         {
             RecursiveGenerateControls(struct1);
         }
     }
     if (Constants.msCONST_NOLAYOUT_APPENDER.ToLower() != ddlAppenderClasses.Text.ToLower())
     {
         argPanel.Controls.Add(gbLayoutGroupBox);
     }
     ArrangeControls();
 }
Ejemplo n.º 4
0
        public void EditExistedAppender(string sAlias)
        {
            XmlNode node1 = null;

            msAliasName = sAlias;
            foreach (XmlNode node2 in moXmlDoc.SelectNodes("//appender"))
            {
                if (node2.Attributes["name"].Value == msAliasName)
                {
                    node1 = node2;
                    break;
                }
            }
            if (node1 == null)
            {
                throw new ApplicationException("This Appender named '" + msAliasName + "' is not existed in this log4net config file.");
            }
            txtAlias.Text     = msAliasName;
            txtAlias.ReadOnly = true;
            try
            {
                string[] textArray1 = node1.Attributes["type"].Value.Split(new char[] { '.' });
                bSkipScrollChangeEvent  = true;
                ddlAppenderClasses.Text = textArray1[textArray1.Length - 1];
                moConsulter             = AppenderConsulter.GetAppender(textArray1[textArray1.Length - 1]);
                if (null == moConsulter)
                {
                    moConsulter = AppenderConsulter.GetAppender(msCONST_DefaultAppender);
                }
                moConsulter.RestoreArgsFromXml(node1);
            }
            catch (InvalidCastException)
            {
                moConsulter = null;
            }
            InitGroupArgument();
        }
Ejemplo n.º 5
0
 public void EditExistedAppender(string sAlias)
 {
     XmlNode node1 = null;
     msAliasName = sAlias;
     foreach (XmlNode node2 in moXmlDoc.SelectNodes("//appender"))
     {
         if (node2.Attributes["name"].Value == msAliasName)
         {
             node1 = node2;
             break;
         }
     }
     if (node1 == null)
     {
         throw new ApplicationException("This Appender named '" + msAliasName + "' is not existed in this log4net config file.");
     }
     txtAlias.Text = msAliasName;
     txtAlias.ReadOnly = true;
     try
     {
         string[] textArray1 = node1.Attributes["type"].Value.Split(new char[] { '.' });
         bSkipScrollChangeEvent = true;
         ddlAppenderClasses.Text = textArray1[textArray1.Length - 1];
         moConsulter = AppenderConsulter.GetAppender(textArray1[textArray1.Length - 1]);
         if (null == moConsulter)
         {
             moConsulter = AppenderConsulter.GetAppender(msCONST_DefaultAppender);
         }
         moConsulter.RestoreArgsFromXml(node1);
     }
     catch (InvalidCastException)
     {
         moConsulter = null;
     }
     InitGroupArgument();
 }
Ejemplo n.º 6
0
 private void InitGroupArgument()
 {
     if (moConsulter == null)
     {
         try
         {
             moConsulter = AppenderConsulter.GetAppender(ddlAppenderClasses.Text);
         }
         catch (InvalidCastException)
         {
             moConsulter = null;
         }
     }
     argPanel.Controls.Clear();
     vSrlBar4grp.Value = 0;
     if (moConsulter == null)
     {
         txtDesc.Text = "Default basic consulter can't work.";
         btnSave.Enabled = false;
     }
     else
     {
         txtDesc.Text = moConsulter.GetAppenderDesc();
     }
     btnSave.Enabled = true;
     ArgumentStruct[] structArray1 = moConsulter.Arguments;
     if (structArray1 != null)
     {
         foreach (ArgumentStruct struct1 in structArray1)
         {
             RecursiveGenerateControls(struct1);
         }
     }
     if (Constants.msCONST_NOLAYOUT_APPENDER.ToLower() != ddlAppenderClasses.Text.ToLower())
     {
         argPanel.Controls.Add(gbLayoutGroupBox);
     }
     ArrangeControls();
 }
Ejemplo n.º 7
0
 private void ddlAppenderClasses_SelectedIndexChanged(object sender, EventArgs e)
 {
     if (bSkipScrollChangeEvent)
     {
         bSkipScrollChangeEvent = false;
     }
     else
     {
         moConsulter = null;
         InitGroupArgument();
     }
 }
 public static AppenderConsulter GetAppender(string AppenderName)
 {
     AppenderConsulter oConsulter = new AppenderConsulter();
     oConsulter.InitConsulter(AppenderName);
     return oConsulter;
 }