private void Maps_PlotMap_Executed(object sender, SLExtensions.Input.ExecutedEventArgs e)
        {
            var mapData = e.Parameter as MapData;

            if (mapData != null)
            {
                SetBitmapData(mapData);
                UpdateImages(); // why is this called separately?
            }
        }
 private void Maps_ExportDataToText_Executed(object sender, SLExtensions.Input.ExecutedEventArgs e)
 {
     if (_mapData != null && _mapData.RawData != null && _mapData.XValues != null && _mapData.YValues != null)
     {
         using (var stream = StreamFinder.GetLocalFilestreamFromSaveFileDialog("txt"))
         {
             if (stream != null)
             {
                 using (StreamWriter sw = new StreamWriter(stream))
                 {
                     sw.Write("% X Values:\t");
                     _mapData.XValues.ForEach(x => sw.Write(x + "\t"));
                     sw.WriteLine();
                     sw.Write("% Y Values:\t");
                     _mapData.YValues.ForEach(y => sw.Write(y + "\t"));
                     sw.WriteLine();
                     sw.Write("% Map Values:\t");
                     _mapData.RawData.ForEach(val => sw.Write(val + "\t"));
                     sw.WriteLine();
                 }
             }
         }
     }
 }
Пример #3
0
 /// <summary>
 /// Executes the command
 /// </summary>
 /// <param name="parameter">The parameter.</param>
 public virtual void Execute(object parameter)
 {
     if (this.Executed != null)
     {
         ExecutedEventArgs e = new ExecutedEventArgs(this, parameter);
         this.Executed(this, e);
     }
 }
Пример #4
0
 void setAudioTrack_Executed(object sender, ExecutedEventArgs e)
 {
     AudioTrack track = e.Parameter as AudioTrack;
     if (track != null && track.Index >= 0 && track.Index < VideoAdapter.AudioStreamCount)
     {
         VideoAdapter.AudioStreamIndex = track.Index;
     }
     else if (e.Parameter is int)
     {
         int trackIndex = (int)e.Parameter;
         if (trackIndex >= 0 && trackIndex < VideoAdapter.AudioStreamCount)
         {
             VideoAdapter.AudioStreamIndex = trackIndex;
         }
     }
 }
Пример #5
0
        void OpenCommand_Executed(object sender, ExecutedEventArgs e)
        {
            OpenFileDialogInfo info = e.Parameter as OpenFileDialogInfo;
            if (info != null)
            {
                OpenFileDialog ofd = new OpenFileDialog();
                ofd.Multiselect = info.EnableMultipleSelection;
                ofd.Filter = info.Filter;
                ofd.ShowDialog();

            }
        }
 void _addItemCommand_Executed(object sender, ExecutedEventArgs e)
 {
     _itemsSource.Add(string.Format("Item {0}", _itemsSource.Count));
 }
Пример #7
0
 private void ToggleChild_Executed(object sender, ExecutedEventArgs e)
 {
     IsVisible = !IsVisible;
 }