Вихідний текст програми
Файл Times.cs
using System;System.Collections.Generic;System.Linq;System.Text;System.Threading.Tasks;System.Drawing;Clock
{Time
{dt; coord; Time ()
{= new DateTime ();
} Point coordSec ()
{= DateTime.Now;=new Point (100+ (int) (100 * Math.Sin (2 * Math.PI/60 * dt.Second)), 100- (int) ( 100 * Math.Cos (2 * Math.PI/60 * dt.Second))); coord;
} Point coordMin ()
{= DateTime.Now;=new Point (100 + (int) (90 * Math.Sin (2 * Math.PI/60 * dt.Minute)), 100 - (int) ( 90 * Math.Cos (2 * Math.PI/60 * dt.Minute))); coord;
} Point coordHour ()
{= DateTime.Now; hour; (dt.Hour lt;=12)
{= dt.Hour;
}
{= dt.Hour - 12;
}=new Point (100 + (int) (80 * Math.Sin (2 * Math.PI/12 * hour + 2 * Math.PI/(12 * 60) * dt.Minute )), 100 - (int) (80 * Math.Cos (2 * Math.PI/12 * hour + 2 * Math.PI/(12 * 60) * dt.Minute))); coord;
}
}
}
Додаток Б
Файл Arrow.cs
Вихідний текст програми
Файл Arrow.cs
using System;System.Collections.Generic;System.Linq;System.Text;System.Threading.Tasks;System.Drawing;Clock
{Arrow
{begin=new Point (101, 101); Point end=new Point (); Pen p; Arrow (Color col, int w)
{= new Pen (col, w);
} void Show (Graphics graphics) .SmoothingMode=System.Drawing.Drawing2D.SmoothingMode.HighQuality; .DrawLine (p, begin, end);
}
}
}
Додаток B
Файл Form1.cs
Вихідний текст програми
Файл Form1.cs
using System;System.Collections.Generic;System.ComponentModel;System.Data;System.Drawing;System.Linq;System.Text;System.Threading.Tasks;System.Windows.Forms;Clock
{partial class Form1: Form
{Form1 ()
{();
} t=new Time (); hour=new Arrow (Color.Black, 3); minute=new Arrow (Color.Black, 2); second=new Arrow (Color.Black, 1 ); showSec=true; void secondsToolStripMenuItem_Click (object sender, EventArgs e)
{=! (showSec) ;. Checked =! (seconds.Checked);
} void offNumToolStripMenuItem_Click (object sender, EventArgs e)
{. BackgroundImage=Clock.Properties.Resources.Clock;
} void allToolStripMenuItem1_Click (object sender, EventArgs e)
{. BackgroundImage=Clock.Properties.Resources.Clock_A;
} void toolStripMenuItem3_Click (object sender, EventArgs e)
{. BackgroundImage=Clock.Properties.Resources.Clock_A_3;
} void allToolStripMenuItem2_Click (object sender, EventArgs e)
{. BackgroundImage=Clock.Properties.Resources.Clock_R;
} void toolStripMenuItem4_Click (object sender, EventArgs e)
{. BackgroundImage=Clock.Properties.Resources.Clock_R_3;
} void colorToolStripMenuItem_Click (object sender, EventArgs e)
{(colorDialog1.ShowDialog ()!=DialogResult.Cancel)
{. BackColor=colorDialog1.Color;
}
} void аналоговийToolStripMenuItem_Click (object sender, EventArgs e)
{. Visible=true; .BackgroundImage=Clock.Properties.Resources.Clock; _label.Visible=false; _label.Visible=false; .Enabled=true; .Enabled=true; .Enabled= true; .Enabled=true; .Enabled=true; .Enabled=true; .Enabled=false; (! (nameProg.Checked))
{. Height=268; .Width=324;
}
{. Height=306; .Width=340;
}
} void безДатиToolStripMenuItem_Click (object sender, EventArgs e)
{. Visible=false; .Enabled=true; .BackgroundImage=null; _label.Visible=true; _label.Visible=false; .Height=150; .Width=340; .Enabled=false ; .Enabled=false; .Enabled=false; .Enabled=false; .Enabled=false; .Enabled=true;
} void показатьДатуToolStripMenuItem_Click (object sender, EventArgs e)
{. Visible=false; .Bac...