<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="ru">
		<id>http://nfex.ru/index.php?action=history&amp;feed=atom&amp;title=Csharp%2FC_Sharp%2FClass_Interface%2FIFormattable</id>
		<title>Csharp/C Sharp/Class Interface/IFormattable - История изменений</title>
		<link rel="self" type="application/atom+xml" href="http://nfex.ru/index.php?action=history&amp;feed=atom&amp;title=Csharp%2FC_Sharp%2FClass_Interface%2FIFormattable"/>
		<link rel="alternate" type="text/html" href="http://nfex.ru/index.php?title=Csharp/C_Sharp/Class_Interface/IFormattable&amp;action=history"/>
		<updated>2026-04-29T21:21:08Z</updated>
		<subtitle>История изменений этой страницы в вики</subtitle>
		<generator>MediaWiki 1.30.0</generator>

	<entry>
		<id>http://nfex.ru/index.php?title=Csharp/C_Sharp/Class_Interface/IFormattable&amp;diff=564&amp;oldid=prev</id>
		<title> в 15:31, 26 мая 2010</title>
		<link rel="alternate" type="text/html" href="http://nfex.ru/index.php?title=Csharp/C_Sharp/Class_Interface/IFormattable&amp;diff=564&amp;oldid=prev"/>
				<updated>2010-05-26T15:31:18Z</updated>
		
		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left&quot; data-mw=&quot;interface&quot;&gt;
				&lt;tr style=&quot;vertical-align: top;&quot; lang=&quot;ru&quot;&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;← Предыдущая&lt;/td&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;Версия 15:31, 26 мая 2010&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; style=&quot;text-align: center;&quot; lang=&quot;ru&quot;&gt;&lt;div class=&quot;mw-diff-empty&quot;&gt;(нет различий)&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;</summary>
			</entry>

	<entry>
		<id>http://nfex.ru/index.php?title=Csharp/C_Sharp/Class_Interface/IFormattable&amp;diff=565&amp;oldid=prev</id>
		<title>Admin: 1 версия</title>
		<link rel="alternate" type="text/html" href="http://nfex.ru/index.php?title=Csharp/C_Sharp/Class_Interface/IFormattable&amp;diff=565&amp;oldid=prev"/>
				<updated>2010-05-26T11:38:55Z</updated>
		
		<summary type="html">&lt;p&gt;1 версия&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Новая страница&lt;/b&gt;&lt;/p&gt;&lt;div&gt;==Three dimensional Vector with IFormattable==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
&amp;lt;source lang=&amp;quot;csharp&amp;quot;&amp;gt; &lt;br /&gt;
using System;&lt;br /&gt;
using System.Collections;&lt;br /&gt;
using System.Text;&lt;br /&gt;
&lt;br /&gt;
class MainEntryPoint {&lt;br /&gt;
    static void Main(string[] args) {&lt;br /&gt;
        Vector Vect1 = new Vector(1.0, 2.0, 5.0);&lt;br /&gt;
        foreach (double Component in Vect1) {&lt;br /&gt;
            foreach (double Next in Vect1)&lt;br /&gt;
                Console.Write(&amp;quot;  &amp;quot; + Next);&lt;br /&gt;
            Console.WriteLine(Component);&lt;br /&gt;
        }&lt;br /&gt;
        Console.ReadLine();&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
struct Vector : IFormattable {&lt;br /&gt;
    public double x, y, z;&lt;br /&gt;
    public IEnumerator GetEnumerator() {&lt;br /&gt;
        return new VectorEnumerator(this);&lt;br /&gt;
    }&lt;br /&gt;
    public Vector(double x, double y, double z) {&lt;br /&gt;
        this.x = x;&lt;br /&gt;
        this.y = y;&lt;br /&gt;
        this.z = z;&lt;br /&gt;
    }&lt;br /&gt;
    public string ToString(string format, IFormatProvider formatProvider) {&lt;br /&gt;
        if (format == null)&lt;br /&gt;
            return ToString();&lt;br /&gt;
        string formatUpper = format.ToUpper();&lt;br /&gt;
        switch (formatUpper) {&lt;br /&gt;
            case &amp;quot;N&amp;quot;:&lt;br /&gt;
                return &amp;quot;|| &amp;quot; + Norm().ToString() + &amp;quot; ||&amp;quot;;&lt;br /&gt;
            case &amp;quot;VE&amp;quot;:&lt;br /&gt;
                return String.Format(&amp;quot;( {0:E}, {1:E}, {2:E} )&amp;quot;, x, y, z);&lt;br /&gt;
            case &amp;quot;IJK&amp;quot;:&lt;br /&gt;
                StringBuilder sb = new StringBuilder(x.ToString(), 30);&lt;br /&gt;
                sb.Append(&amp;quot; i + &amp;quot;);&lt;br /&gt;
                sb.Append(y.ToString());&lt;br /&gt;
                sb.Append(&amp;quot; j + &amp;quot;);&lt;br /&gt;
                sb.Append(z.ToString());&lt;br /&gt;
                sb.Append(&amp;quot; k&amp;quot;);&lt;br /&gt;
                return sb.ToString();&lt;br /&gt;
            default:&lt;br /&gt;
                return ToString();&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    public Vector(Vector rhs) {&lt;br /&gt;
        x = rhs.x;&lt;br /&gt;
        y = rhs.y;&lt;br /&gt;
        z = rhs.z;&lt;br /&gt;
    }&lt;br /&gt;
    public override string ToString() {&lt;br /&gt;
        return &amp;quot;( &amp;quot; + x + &amp;quot; , &amp;quot; + y + &amp;quot; , &amp;quot; + z + &amp;quot; )&amp;quot;;&lt;br /&gt;
    }&lt;br /&gt;
    public double this[uint i] {&lt;br /&gt;
        get {&lt;br /&gt;
            switch (i) {&lt;br /&gt;
                case 0:&lt;br /&gt;
                    return x;&lt;br /&gt;
                case 1:&lt;br /&gt;
                    return y;&lt;br /&gt;
                case 2:&lt;br /&gt;
                    return z;&lt;br /&gt;
                default:&lt;br /&gt;
                    throw new IndexOutOfRangeException(&lt;br /&gt;
                       &amp;quot;Attempt to retrieve Vector element&amp;quot; + i);&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
        set {&lt;br /&gt;
            switch (i) {&lt;br /&gt;
                case 0:&lt;br /&gt;
                    x = value;&lt;br /&gt;
                    break;&lt;br /&gt;
                case 1:&lt;br /&gt;
                    y = value;&lt;br /&gt;
                    break;&lt;br /&gt;
                case 2:&lt;br /&gt;
                    z = value;&lt;br /&gt;
                    break;&lt;br /&gt;
                default:&lt;br /&gt;
                    throw new IndexOutOfRangeException(&lt;br /&gt;
                       &amp;quot;Attempt to set Vector element&amp;quot; + i);&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    private const double Epsilon = 0.0000001;&lt;br /&gt;
    public static bool operator ==(Vector lhs, Vector rhs) {&lt;br /&gt;
        if (System.Math.Abs(lhs.x - rhs.x) &amp;lt; Epsilon &amp;amp;&amp;amp;&lt;br /&gt;
           System.Math.Abs(lhs.y - rhs.y) &amp;lt; Epsilon &amp;amp;&amp;amp;&lt;br /&gt;
           System.Math.Abs(lhs.z - rhs.z) &amp;lt; Epsilon)&lt;br /&gt;
            return true;&lt;br /&gt;
        else&lt;br /&gt;
            return false;&lt;br /&gt;
    }&lt;br /&gt;
    public static bool operator !=(Vector lhs, Vector rhs) {&lt;br /&gt;
        return !(lhs == rhs);&lt;br /&gt;
    }&lt;br /&gt;
    public static Vector operator +(Vector lhs, Vector rhs) {&lt;br /&gt;
        Vector Result = new Vector(lhs);&lt;br /&gt;
        Result.x += rhs.x;&lt;br /&gt;
        Result.y += rhs.y;&lt;br /&gt;
        Result.z += rhs.z;&lt;br /&gt;
        return Result;&lt;br /&gt;
    }&lt;br /&gt;
    public static Vector operator *(double lhs, Vector rhs) {&lt;br /&gt;
        return new Vector(lhs * rhs.x, lhs * rhs.y, lhs * rhs.z);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    public static Vector operator *(Vector lhs, double rhs) {&lt;br /&gt;
        return rhs * lhs;&lt;br /&gt;
    }&lt;br /&gt;
    public static double operator *(Vector lhs, Vector rhs) {&lt;br /&gt;
        return lhs.x * rhs.x + lhs.y + rhs.y + lhs.z * rhs.z;&lt;br /&gt;
    }&lt;br /&gt;
    public double Norm() {&lt;br /&gt;
        return x * x + y * y + z * z;&lt;br /&gt;
    }&lt;br /&gt;
    private class VectorEnumerator : IEnumerator {&lt;br /&gt;
        Vector theVector;&lt;br /&gt;
        int location;&lt;br /&gt;
        public VectorEnumerator(Vector theVector) {&lt;br /&gt;
            this.theVector = theVector;&lt;br /&gt;
            location = -1;&lt;br /&gt;
        }&lt;br /&gt;
        public bool MoveNext() {&lt;br /&gt;
            ++location;&lt;br /&gt;
            return (location &amp;gt; 2) ? false : true;&lt;br /&gt;
        }&lt;br /&gt;
        public object Current {&lt;br /&gt;
            get {&lt;br /&gt;
                if (location &amp;lt; 0 || location &amp;gt; 2)&lt;br /&gt;
                    throw new InvalidOperationException(&lt;br /&gt;
                       &amp;quot;The enumerator is either before the first element or &amp;quot; +&lt;br /&gt;
                       &amp;quot;after the last element of the Vector&amp;quot;);&lt;br /&gt;
                return theVector[(uint)location];&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
        public void Reset() {&lt;br /&gt;
            location = -1;&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
 &amp;lt;/source&amp;gt;&lt;/div&gt;</summary>
		<author><name>Admin</name></author>	</entry>

	</feed>