Пример #1
0
        void doc_MicrophoneAdded(object sender, DistanceDocumentEventArgs e)
        {
            // A new microphone was added to the document. Create a new icon for it
            // and place it on the plan.
            var mi = new MicrophoneIcon(e.Microphone);

            pMainArea.Controls.Add(mi.Icon);
        }
Пример #2
0
        void pMainArea_DragEnter(object sender, DragEventArgs e)
        {
            MicrophoneIcon mi = (MicrophoneIcon)e.Data.GetData(typeof(MicrophoneIcon));

            if (mi != null)
            {
                mi.Icon.Location = new Point(e.X, e.Y);
            }
        }
Пример #3
0
        void doc_MicrophoneAdded(object sender, DistanceDocumentEventArgs e)
        {
            // A new microphone was added to the document. Create a new icon for it
            // and place it on the plan.
            var mi = new MicrophoneIcon(e.Microphone);

            mainCanvas.Children.Add(mi.Icon);
            // Center the icon on the coordinates from the document.
            Canvas.SetLeft(mi.Icon, e.Microphone.X - mi.Icon.Source.Width / 2);
            Canvas.SetTop(mi.Icon, e.Microphone.Y - mi.Icon.Source.Height / 2);
        }