Beispiel #1
0
        public bool Find(string find, int findType)
        {
            if (find == "" || find == String.Empty || find == null)
            {
                return(true);
            }
            switch (findType)
            {
            case 0:
                if (Subject.IndexOf(find) > -1)
                {
                    return(true);
                }
                break;

            case 1:
                if (BodyText.IndexOf(find) > -1)
                {
                    return(true);
                }
                break;

            case 2:
                if (CreateTime.ToString().IndexOf(find) > -1)
                {
                    return(true);
                }
                break;

            case 3:
                if (RunningTime.ToString().IndexOf(find) > -1)
                {
                    return(true);
                }
                break;

            case 4:
                if (Subject.IndexOf(find) > -1)
                {
                    return(true);
                }
                if (BodyText.IndexOf(find) > -1)
                {
                    return(true);
                }
                if (CreateTime.ToString().IndexOf(find) > -1)
                {
                    return(true);
                }
                if (RunningTime.ToString().IndexOf(find) > -1)
                {
                    return(true);
                }
                break;
            }
            return(false);
        }
        public string ToString(bool includeBody)
        {
            StringBuilder sb = new StringBuilder(100);

            string accessorName = AccessorType == AccessorTypes.Get ? "get" : "set";

            sb.Append(Controller.Indent);

            if (!string.IsNullOrEmpty(Modifier))
            {
                sb.Append(Modifier + " ");
            }
            sb.Append(accessorName);

            if (includeBody)
            {
                if (string.IsNullOrEmpty(BodyText))
                {
                    BodyText = ";";
                }

                BodyText = Helper.RemoveTrailingLineBreaks(BodyText);
                BodyText = Helper.StandardizeLineBreaks(BodyText, Helper.LineBreaks.Unix);

                if (BodyText.IndexOf("\n") >= 0)
                {
                    //Controller.IndentLevel--;
                    BodyText = ArchAngel.Providers.CodeProvider.CSharp.Utility.ResetIndents(BodyText, Controller.Indent);
                    //Controller.IndentLevel++;
                }
                else
                {
                    int tabIndex = 0;

                    while (BodyText[tabIndex] == '\t')
                    {
                        tabIndex++;
                    }
                    BodyText = BodyText.Substring(tabIndex);
                }

                sb.AppendLine(BodyText);
            }
            return(sb.ToString());
        }