ArticleHasAMinorChange() private méthode

private ArticleHasAMinorChange ( ) : void
Résultat void
        /// <summary>
        /// Checks for the existence of a parameter and adds it if missing/optionally changes it
        /// </summary>
        /// <returns>True if made a change</returns>
        internal bool NewOrReplaceTemplateParm(string ParameterName, string ParameterValue, Article TheArticle, bool LogItAndUpdateEditSummary, bool ParamHasAlternativeName, bool DontChangeIfSet = false, string ParamAlternativeName = "", string PluginName = "", bool MinorEditOnlyIfAdding = false)
        {
            bool res;

            if (Parameters.ContainsKey(ParameterName))
            {
                res = ReplaceTemplateParm(ParameterName, ParameterValue, TheArticle, LogItAndUpdateEditSummary, DontChangeIfSet, PluginName);
            }
            else if (ParamHasAlternativeName && Parameters.ContainsKey(ParamAlternativeName))
            {
                res = ReplaceTemplateParm(ParamAlternativeName, ParameterValue, TheArticle, LogItAndUpdateEditSummary, DontChangeIfSet, PluginName);
                // Doesn't contain parameter
            }
            else
            {
                NewTemplateParm(ParameterName, ParameterValue, LogItAndUpdateEditSummary, TheArticle, PluginName, MinorEditOnlyIfAdding);

                if (MinorEditOnlyIfAdding)
                {
                    TheArticle.ArticleHasAMinorChange();
                }
                else
                {
                    TheArticle.ArticleHasAMajorChange();
                }
                return(true);
            }

            if (res)
            {
                TheArticle.ArticleHasAMajorChange();
            }
            return(res);
        }
Exemple #2
0
 protected void ReplaceATemplateWithAYesParameter(Regex r, string paramName, string templateCall,
                                                  bool replace = true)
 {
     if ((r.Matches(TheArticle.AlteredArticleText).Count > 0))
     {
         if (replace)
         {
             TheArticle.AlteredArticleText = r.Replace(TheArticle.AlteredArticleText, "");
         }
         TheArticle.DoneReplacement(templateCall, paramName + "=yes");
         Template.NewOrReplaceTemplateParm(paramName, "yes", TheArticle, false, false);
         TheArticle.ArticleHasAMinorChange();
     }
 }
        /// <summary>
        /// Checks for the existence of a parameter and adds it if missing/optionally changes it
        /// </summary>
        /// <returns>True if made a change</returns>
        internal bool NewOrReplaceTemplateParm(string parameterName, string parameterValue, Article theArticle,
                                               bool logItAndUpdateEditSummary, bool paramHasAlternativeName, bool dontChangeIfSet = false,
                                               string paramAlternativeName = "", string pluginName = "", bool minorEditOnlyIfAdding = false)
        {
            bool res;

            if (Parameters.ContainsKey(parameterName))
            {
                res = ReplaceTemplateParm(parameterName, parameterValue, theArticle, logItAndUpdateEditSummary,
                                          dontChangeIfSet);
            }
            else if (paramHasAlternativeName && Parameters.ContainsKey(paramAlternativeName))
            {
                res = ReplaceTemplateParm(paramAlternativeName, parameterValue, theArticle, logItAndUpdateEditSummary,
                                          dontChangeIfSet);
                // Doesn't contain parameter
            }
            else
            {
                NewTemplateParm(parameterName, parameterValue, logItAndUpdateEditSummary, theArticle, pluginName,
                                minorEditOnlyIfAdding);

                if (minorEditOnlyIfAdding)
                {
                    theArticle.ArticleHasAMinorChange();
                }
                else
                {
                    theArticle.ArticleHasAMajorChange();
                }
                return(true);
            }

            if (res)
            {
                theArticle.ArticleHasAMajorChange();
            }
            return(res);
        }
		/// <summary>
		/// Checks for the existence of a parameter and adds it if missing/optionally changes it
		/// </summary>
		/// <returns>True if made a change</returns>
		internal bool NewOrReplaceTemplateParm(string ParameterName, string ParameterValue, Article TheArticle, bool LogItAndUpdateEditSummary, bool ParamHasAlternativeName, bool DontChangeIfSet = false, string ParamAlternativeName = "", string PluginName = "", bool MinorEditOnlyIfAdding = false)
		{
			bool res;

			if (Parameters.ContainsKey(ParameterName)) {
				res = ReplaceTemplateParm(ParameterName, ParameterValue, TheArticle, LogItAndUpdateEditSummary, DontChangeIfSet, PluginName);
			} else if (ParamHasAlternativeName && Parameters.ContainsKey(ParamAlternativeName)) {
				res = ReplaceTemplateParm(ParamAlternativeName, ParameterValue, TheArticle, LogItAndUpdateEditSummary, DontChangeIfSet, PluginName);
			// Doesn't contain parameter
			} else {
				NewTemplateParm(ParameterName, ParameterValue, LogItAndUpdateEditSummary, TheArticle, PluginName, MinorEditOnlyIfAdding);

				if (MinorEditOnlyIfAdding)
					TheArticle.ArticleHasAMinorChange();
				else
					TheArticle.ArticleHasAMajorChange();
				return true;
			}

			if (res)
				TheArticle.ArticleHasAMajorChange();
			return res;
		}
Exemple #5
0
        /// <summary>
        /// Checks for the existence of a parameter and adds it if missing/optionally changes it
        /// </summary>
        /// <returns>True if made a change</returns>
        internal bool NewOrReplaceTemplateParm(string parameterName, string parameterValue, Article theArticle,
            bool logItAndUpdateEditSummary, bool paramHasAlternativeName, bool dontChangeIfSet = false,
            string paramAlternativeName = "", bool minorEditOnlyIfAdding = false)
        {
            bool res;

            if (Parameters.ContainsKey(parameterName))
            {
                res = ReplaceTemplateParm(parameterName, parameterValue, theArticle, logItAndUpdateEditSummary,
                    dontChangeIfSet);
            }
            else if (paramHasAlternativeName && Parameters.ContainsKey(paramAlternativeName))
            {
                res = ReplaceTemplateParm(paramAlternativeName, parameterValue, theArticle, logItAndUpdateEditSummary,
                    dontChangeIfSet);
                // Doesn't contain parameter
            }
            else
            {
                NewTemplateParm(parameterName, parameterValue, logItAndUpdateEditSummary, theArticle, minorEditOnlyIfAdding);

                if (minorEditOnlyIfAdding)
                    theArticle.ArticleHasAMinorChange();
                else
                    theArticle.ArticleHasAMajorChange();
                return true;
            }

            if (res)
                theArticle.ArticleHasAMajorChange();
            return res;
        }