ParameterAdded() private method

private ParameterAdded ( string paramName, string paramValue, bool minorEdit = false ) : void
paramName string
paramValue string
minorEdit bool
return void
        private bool ReplaceTemplateParm(string parameterName, string parameterValue, Article theArticle,
                                         bool logItAndUpdateEditSummary, bool dontChangeIfSet)
        {
            string existingValue = WikiRegexes.Comments.Replace(Parameters[parameterName].Value, "").Trim();

            // trim still needed because altho main regex shouldn't give us spaces at the end of vals any more, the .Replace here might

            // Contains parameter with a different value
            if (existingValue != parameterValue)
            {
                // Contains parameter with a different value, and _
                if (string.IsNullOrEmpty(existingValue) || !dontChangeIfSet)
                {
                    // we want to change it; or contains an empty parameter
                    Parameters[parameterName].Value = parameterValue;
                    theArticle.ArticleHasAMajorChange();
                    if (logItAndUpdateEditSummary)
                    {
                        if (string.IsNullOrEmpty(existingValue))
                        {
                            theArticle.ParameterAdded(parameterName, parameterValue);
                        }
                        else
                        {
                            theArticle.DoneReplacement(parameterName + "=" + existingValue, parameterValue);
                        }
                    }
                    return(true);
                    // Contains param with a different value, and we don't want to change it
                }
            }
            // Else: Already contains parameter and correct value; no need to change
            return(false);
        }
 internal void NewTemplateParm(string ParameterName, string ParameterValue, bool LogItAndUpdateEditSummary, Article TheArticle, string PluginName, bool MinorEdit = false)
 {
     NewTemplateParm(ParameterName, ParameterValue);
     if (LogItAndUpdateEditSummary)
     {
         TheArticle.ParameterAdded(ParameterName, ParameterValue, PluginName, MinorEdit);
     }
 }
 internal void NewTemplateParm(string parameterName, string parameterValue, bool logItAndUpdateEditSummary,
                               Article theArticle, string pluginName, bool minorEdit = false)
 {
     NewTemplateParm(parameterName, parameterValue);
     if (logItAndUpdateEditSummary)
     {
         theArticle.ParameterAdded(parameterName, parameterValue, minorEdit);
     }
 }
Example #4
0
		private bool ReplaceTemplateParm(string ParameterName, string ParameterValue, Article TheArticle, bool LogItAndUpdateEditSummary, bool DontChangeIfSet, string PluginName)
		{
			string ExistingValue = WikiRegexes.Comments.Replace(Parameters[ParameterName].Value, "").Trim();
			// trim still needed because altho main regex shouldn't give us spaces at the end of vals any more, the .Replace here might

			// Contains parameter with a different value
			if (ExistingValue != ParameterValue)
			{
			    // Contains parameter with a different value, and _
				if (string.IsNullOrEmpty(ExistingValue) || !DontChangeIfSet) {
					// we want to change it; or contains an empty parameter
					Parameters[ParameterName].Value = ParameterValue;
					TheArticle.ArticleHasAMajorChange();
					if (LogItAndUpdateEditSummary) {
						if (string.IsNullOrEmpty(ExistingValue)) {
							TheArticle.ParameterAdded(ParameterName, ParameterValue, PluginName);
						} else {
							TheArticle.DoneReplacement(ParameterName + "=" + ExistingValue, ParameterValue, true, PluginName);
						}
					}
					return true;
				// Contains param with a different value, and we don't want to change it
				}
			}
		    // Else: Already contains parameter and correct value; no need to change
			return false;
		}
Example #5
0
		internal void NewTemplateParm(string ParameterName, string ParameterValue, bool LogItAndUpdateEditSummary, Article TheArticle, string PluginName, bool MinorEdit = false)
		{
			NewTemplateParm(ParameterName, ParameterValue);
			if (LogItAndUpdateEditSummary)
				TheArticle.ParameterAdded(ParameterName, ParameterValue, PluginName, MinorEdit);
		}
Example #6
0
 internal void NewTemplateParm(string parameterName, string parameterValue, bool logItAndUpdateEditSummary,
     Article theArticle, bool minorEdit = false)
 {
     NewTemplateParm(parameterName, parameterValue);
     if (logItAndUpdateEditSummary)
         theArticle.ParameterAdded(parameterName, parameterValue, minorEdit);
 }