本文整理汇总了C#中System.Collections.ObjectModel.ObservableCollection.Insert方法的典型用法代码示例。如果您正苦于以下问题:C# System.Collections.ObjectModel.ObservableCollection.Insert方法的具体用法?C# System.Collections.ObjectModel.ObservableCollection.Insert怎么用?C# System.Collections.ObjectModel.ObservableCollection.Insert使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Collections.ObjectModel.ObservableCollection
的用法示例。
在下文中一共展示了System.Collections.ObjectModel.ObservableCollection.Insert方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GroupEditorDialog
public GroupEditorDialog(Common.SignalGroup group)
{
InitializeComponent();
RadioLog.WPFCommon.BrushSelectionHolder[] colors = RadioLog.WPFCommon.ColorHelper.GetBrushSelectionItems();
System.Collections.ObjectModel.ObservableCollection<RadioLog.WPFCommon.BrushSelectionHolder> colorList = new System.Collections.ObjectModel.ObservableCollection<WPFCommon.BrushSelectionHolder>(colors);
colorList.Insert(0, new WPFCommon.BrushSelectionHolder("Default", null));
cbGroupColor.ItemsSource = colorList;
_group = group;
SetupForCurrentGroup();
}
示例2: StreamSourceEditorDialog
public StreamSourceEditorDialog(RadioLog.Common.SignalSource src)
{
if (src == null)
throw new ArgumentNullException();
InitializeComponent();
_src = src;
RadioLog.WPFCommon.BrushSelectionHolder[] colors = RadioLog.WPFCommon.ColorHelper.GetBrushSelectionItems();
System.Collections.ObjectModel.ObservableCollection<RadioLog.WPFCommon.BrushSelectionHolder> colorList = new System.Collections.ObjectModel.ObservableCollection<WPFCommon.BrushSelectionHolder>(colors);
colorList.Insert(0, new WPFCommon.BrushSelectionHolder("Default", null));
cbSourceColor.ItemsSource = colorList;
if (string.IsNullOrEmpty(_src.SourceColor))
cbSourceColor.SelectedIndex = 0;
else
cbSourceColor.SelectedValue = _src.SourceColor;
tbSourceName.Text = _src.SourceName;
tbStreamURL.Text = _src.SourceLocation;
sRecordingKickTime.Value = _src.RecordingKickTime;
tsRecordingEnabled.IsChecked = _src.RecordAudio;
tsPriority.IsChecked = _src.IsPriority;
cbDecodeMDC1200.IsChecked = _src.DecodeMDC1200;
cbDecodeGEStar.IsChecked = _src.DecodeGEStar;
cbDecodeFleetSync.IsChecked = _src.DecodeFleetSync;
cbRemoveNoise.IsChecked = _src.RemoveNoise;
sDisplayOrder.Value = _src.DisplayOrder;
LoadDeviceLists();
cbNoiseFloor.ItemsSource = _noiseFloorList;
cbNoiseFloor.SelectedValue = _src.NoiseFloor;
sCustomNoiseFloor.Value = _src.CustomNoiseFloor;
cbWaveOutDev.ItemsSource = _waveOutList;
if (_waveOutList.Count > 0 && !string.IsNullOrWhiteSpace(_src.WaveOutDeviceName))
{
cbWaveOutDev.SelectedItem = (_waveOutList.FirstOrDefault(l => l.DeviceName == _src.WaveOutDeviceName));
}
if (string.IsNullOrWhiteSpace(_src.WaveOutDeviceName) || cbWaveOutDev.SelectedIndex < 0)
{
cbWaveOutDev.SelectedIndex = 0;
}
switch (_src.RecordingType)
{
case Common.SignalRecordingType.Fixed: cbRecordingStyle.SelectedIndex = 1; break;
default: cbRecordingStyle.SelectedIndex = 0; break;
}
UpdateForSelectedRecordingStyle();
DisplayQRCode(_src.SourceLocation);
}
示例3: NewSourceDialog
public NewSourceDialog()
{
InitializeComponent();
LoadDeviceLists();
cbMultiLineIn.ItemsSource = _channelList;
cbGroup.ItemsSource = GetMainViewModel().SignalGroups;
cbGroup.SelectedValue = Guid.Empty;
cbGroup.IsEnabled = Common.AppSettings.Instance.UseGroups;
_initDone = true;
if (_channelList.Count > 0)
{
cbMultiLineIn.SelectedIndex = 0;
rbLineIn.IsEnabled = true;
}
else
{
rbLineIn.IsEnabled = false;
}
RadioLog.WPFCommon.BrushSelectionHolder[] colors = RadioLog.WPFCommon.ColorHelper.GetBrushSelectionItems();
System.Collections.ObjectModel.ObservableCollection<RadioLog.WPFCommon.BrushSelectionHolder> colorList = new System.Collections.ObjectModel.ObservableCollection<WPFCommon.BrushSelectionHolder>(colors);
colorList.Insert(0, new WPFCommon.BrushSelectionHolder("Default", null));
cbSourceColor.ItemsSource = colorList;
cbSourceColor.SelectedIndex = 0;
sDisplayOrder.Value = 10;
SelectedSourceType = Common.SignalingSourceType.Streaming;
if (Clipboard.ContainsText(TextDataFormat.Html))
{
string strUrl = Clipboard.GetText(TextDataFormat.Html);
if (!string.IsNullOrWhiteSpace(strUrl))
{
strUrl = strUrl.Trim();
if (strUrl.EndsWith(".m3u", StringComparison.InvariantCultureIgnoreCase))
{
tbStreamURL.Text = strUrl;
}
}
}
}
示例4: AddColorSelectionCombo
protected void AddColorSelectionCombo(string itemKey, string itemTitle)
{
RadioLog.WPFCommon.BrushSelectionHolder[] colors = RadioLog.WPFCommon.ColorHelper.GetBrushSelectionItems();
System.Collections.ObjectModel.ObservableCollection<RadioLog.WPFCommon.BrushSelectionHolder> colorList = new System.Collections.ObjectModel.ObservableCollection<WPFCommon.BrushSelectionHolder>(colors);
colorList.Insert(0, new WPFCommon.BrushSelectionHolder("Default", null));
ResponderApps.EditorDisplay.ComboBoxEditorItem cbColor = new ResponderApps.EditorDisplay.ComboBoxEditorItem(itemKey, itemTitle);
cbColor.ItemsSource = colorList;
cbColor.DisplayMemberPath = "BrushName";
cbColor.SelectedValuePath = "BrushKey";
cbColor.SelectedIndex = 0;
this.editControl.AddEditorItem(cbColor);
}