Esempio n. 1
0
        static void Main()
        {
            StringDisperser stringDisperser = new StringDisperser("a", "b", "c", "d", "e", "building");

            foreach (var chr in stringDisperser)
            {
                Console.Write(chr + " ");
            }
        }
Esempio n. 2
0
        public int CompareTo(StringDisperser other)
        {
            int compareResult = string.Compare(this.chars, other.chars);

            if (compareResult != 0)
            {
                return(compareResult);
            }

            return(0);
        }
Esempio n. 3
0
        public override bool Equals(object obj)
        {
            StringDisperser stringDisperser = obj as StringDisperser;

            if (stringDisperser == null)
            {
                return(false);
            }

            if (!Object.Equals(this.chars, stringDisperser.chars))
            {
                return(false);
            }

            return(true);
        }
Esempio n. 4
0
 public static bool operator !=(StringDisperser stringDisperser, StringDisperser otherString)
 {
     return(!StringDisperser.Equals(stringDisperser, otherString));
 }