Beispiel #1
0
        /// <summary>
        /// insert the snippet into the current template, into the given codelet.
        /// add new text in front of the text that has already been added to the codelet
        /// </summary>
        /// <param name="ACodeletName"></param>
        /// <param name="ASnippet"></param>
        public void InsertSnippetPrepend(string ACodeletName, ProcessTemplate ASnippet)
        {
            ASnippet.ReplaceCodelets();

            if (FCodelets.ContainsKey(ACodeletName))
            {
                AddToCodeletPrepend(ACodeletName, ASnippet.FTemplateCode.ToString() + Environment.NewLine);
            }
            else
            {
                AddToCodeletPrepend(ACodeletName, ASnippet.FTemplateCode.ToString());
            }
        }
Beispiel #2
0
        /// <summary>
        /// insert the snippet into the current template, into the given codelet.
        /// use separator to separate from previous items inserted into that codelet
        /// </summary>
        /// <param name="ACodeletName"></param>
        /// <param name="ASnippet"></param>
        /// <param name="ASeparator"></param>
        public void InsertSnippet(string ACodeletName, ProcessTemplate ASnippet, string ASeparator)
        {
            ASnippet.ReplaceCodelets();
            ASnippet.ProcessIFDEFs(ref ASnippet.FTemplateCode);
            ASnippet.ProcessIFNDEFs(ref ASnippet.FTemplateCode);

            if (FCodelets.ContainsKey(ACodeletName) &&
                (FCodelets[ACodeletName].Length > 0))
            {
                AddSeparatorToCodelet(ACodeletName, ASeparator);
            }

            AddToCodelet(ACodeletName, ASnippet.FTemplateCode.ToString());
        }
Beispiel #3
0
        /// <summary>
        /// insert the snippet into the current template, into the given codelet
        /// </summary>
        /// <param name="ACodeletName"></param>
        /// <param name="ASnippet"></param>
        public void InsertSnippet(string ACodeletName, ProcessTemplate ASnippet)
        {
            ASnippet.ReplaceCodelets();
            ASnippet.ProcessIFDEFs(ref ASnippet.FTemplateCode);
            ASnippet.ProcessIFNDEFs(ref ASnippet.FTemplateCode);

            if (FCodelets.ContainsKey(ACodeletName) &&
                !FCodelets[ACodeletName].ToString().EndsWith(Environment.NewLine) &&
                (FCodelets[ACodeletName].Length > 0))
            {
                AddToCodelet(ACodeletName, Environment.NewLine);
            }

            AddToCodelet(ACodeletName, ASnippet.FTemplateCode.ToString());
        }
Beispiel #4
0
        /// <summary>
        /// insert the snippet into the current template, into the given codelet.
        /// add new text in front of the text that has already been added to the codelet
        /// </summary>
        /// <param name="ACodeletName"></param>
        /// <param name="ASnippet"></param>
        public void InsertSnippetPrepend(string ACodeletName, ProcessTemplate ASnippet)
        {
            ASnippet.ReplaceCodelets();

            if (FCodelets.ContainsKey(ACodeletName))
            {
                AddToCodeletPrepend(ACodeletName, ASnippet.FTemplateCode.ToString() + Environment.NewLine);
            }
            else
            {
                AddToCodeletPrepend(ACodeletName, ASnippet.FTemplateCode.ToString());
            }
        }
Beispiel #5
0
        /// <summary>
        /// insert the snippet into the current template, into the given codelet.
        /// use separator to separate from previous items inserted into that codelet
        /// </summary>
        /// <param name="ACodeletName"></param>
        /// <param name="ASnippet"></param>
        /// <param name="ASeparator"></param>
        public void InsertSnippet(string ACodeletName, ProcessTemplate ASnippet, string ASeparator)
        {
            ASnippet.ReplaceCodelets();
            ASnippet.ProcessIFDEFs(ref ASnippet.FTemplateCode);
            ASnippet.ProcessIFNDEFs(ref ASnippet.FTemplateCode);

            if (FCodelets.ContainsKey(ACodeletName)
                && (FCodelets[ACodeletName].Length > 0))
            {
                AddSeparatorToCodelet(ACodeletName, ASeparator);
            }

            AddToCodelet(ACodeletName, ASnippet.FTemplateCode.ToString());
        }
Beispiel #6
0
        /// <summary>
        /// insert the snippet into the current template, into the given codelet
        /// </summary>
        /// <param name="ACodeletName"></param>
        /// <param name="ASnippet"></param>
        public void InsertSnippet(string ACodeletName, ProcessTemplate ASnippet)
        {
            ASnippet.ReplaceCodelets();
            ASnippet.ProcessIFDEFs(ref ASnippet.FTemplateCode);
            ASnippet.ProcessIFNDEFs(ref ASnippet.FTemplateCode);

            if (FCodelets.ContainsKey(ACodeletName)
                && !FCodelets[ACodeletName].ToString().EndsWith(Environment.NewLine)
                && (FCodelets[ACodeletName].Length > 0))
            {
                AddToCodelet(ACodeletName, Environment.NewLine);
            }

            AddToCodelet(ACodeletName, ASnippet.FTemplateCode.ToString());
        }