public FormatRange MergeFormats(int x, int y)
		{
			FormatRange fr = null;
			foreach (FormatRange frang in this)
			{
				if (frang.Contains(x, y) != 0)
					continue;

				if (frang.BackColor != Color.Empty)
				{
					if (fr == null)
						fr = new FormatRange();

					fr.BackColor = frang.BackColor;
				}

				if (frang.ForeColor != Color.Empty)
				{
					if (fr == null)
						fr = new FormatRange();

					fr.ForeColor = frang.ForeColor;
				}

				if (frang.WaveColor != Color.Empty)
				{
					if (fr == null)
						fr = new FormatRange();

					fr.WaveColor = frang.WaveColor;
				}

				if (frang.InfoTip.Length > 0)
				{
					if (fr == null)
						fr = new FormatRange();

					if (fr.InfoTip.Length > 0)
					{
						fr.InfoTip += Environment.NewLine + Environment.NewLine + frang.InfoTip;
					}
					else
					{
						fr.InfoTip = frang.InfoTip;
					}
				}
			}

			return fr;
		}
Example #2
0
 public int Add(FormatRange item)
 {
     item.Document = this.Document;
     item.Apply();
     return this.List.Add(item);
 }
Example #3
0
 public void Remove(FormatRange item)
 {
     this.List.Remove(item);
 }
        public FormatRange MergeFormats(int x, int y)
        {
            FormatRange fr = null;

            foreach (FormatRange frang in this)
            {
                if (frang.Contains(x, y) != 0)
                {
                    continue;
                }

                if (frang.BackColor != Color.Empty)
                {
                    if (fr == null)
                    {
                        fr = new FormatRange();
                    }

                    fr.BackColor = frang.BackColor;
                }

                if (frang.ForeColor != Color.Empty)
                {
                    if (fr == null)
                    {
                        fr = new FormatRange();
                    }

                    fr.ForeColor = frang.ForeColor;
                }

                if (frang.WaveColor != Color.Empty)
                {
                    if (fr == null)
                    {
                        fr = new FormatRange();
                    }

                    fr.WaveColor = frang.WaveColor;
                }

                if (frang.InfoTip.Length > 0)
                {
                    if (fr == null)
                    {
                        fr = new FormatRange();
                    }

                    if (fr.InfoTip.Length > 0)
                    {
                        fr.InfoTip += Environment.NewLine + Environment.NewLine + frang.InfoTip;
                    }
                    else
                    {
                        fr.InfoTip = frang.InfoTip;
                    }
                }
            }

            return(fr);
        }
 public void Remove(FormatRange item)
 {
     this.List.Remove(item);
 }
 public int Add(FormatRange item)
 {
     item.Document = this.Document;
     item.Apply();
     return(this.List.Add(item));
 }