コード例 #1
0
 public void AddMicrophone(Microphone m)
 {
     microphones.Add(m);
     if (string.IsNullOrWhiteSpace(m.Name))
         m.Name = "Microphone " + microphones.Count;
     OnMicrophoneAdded(new DistanceDocumentEventArgs(m));
     OnChanged(EventArgs.Empty);
 }
コード例 #2
0
        public MicrophoneIcon(Microphone mic)
        {
            this.mic = mic;

            icon = new Image();
            icon.Source = new BitmapImage(new Uri(BaseUriHelper.GetBaseUri(Application.Current.MainWindow), "Images/microphone.png"));

            // Register for updates on the mouse down event so that we may start a drag'n'drop operation.
            this.icon.MouseDown += icon_MouseDown;
        }
コード例 #3
0
        public MicrophoneIcon(Microphone mic)
        {
            this.mic = mic;
            this.icon = new PictureBox();
            Icon.SizeMode = PictureBoxSizeMode.AutoSize;

            Bitmap b = new Bitmap(@"C:\Users\Henrik\Documents\visual studio 2013\Projects\Distance\Distance\microphone.png");
            b.MakeTransparent();
            Icon.Image = b;
            
            // Place the image so that the center of it is where the document mic coordinates are.
            Icon.Location = new Point(mic.X - Icon.Image.Width / 2, mic.Y - Icon.Image.Height / 2);

            // Register for updates on the mouse down event so that we may start a drag'n'drop operation.
            this.icon.MouseDown += icon_MouseDown;
        }
コード例 #4
0
 public DistanceDocumentEventArgs(ReferencePoint rp)
 {
     this.mic = null;
     this.rp = rp;
 }
コード例 #5
0
 public DistanceDocumentEventArgs(Microphone mic)
 {
     this.mic = mic;
     this.rp = null;
 }
コード例 #6
0
 public DistanceDocumentEventArgs(Microphone mic, ReferencePoint rp)
 {
     this.mic = mic;
     this.rp = rp;
 }
コード例 #7
0
 public DistanceDocumentEventArgs(ReferencePoint rp)
 {
     this.mic = null;
     this.rp  = rp;
 }
コード例 #8
0
 public DistanceDocumentEventArgs(Microphone mic)
 {
     this.mic = mic;
     this.rp  = null;
 }
コード例 #9
0
 public DistanceDocumentEventArgs(Microphone mic, ReferencePoint rp)
 {
     this.mic = mic;
     this.rp  = rp;
 }