本文整理汇总了C#中System.Windows.Documents.List.Insert方法的典型用法代码示例。如果您正苦于以下问题:C# List.Insert方法的具体用法?C# List.Insert怎么用?C# List.Insert使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Windows.Documents.List
的用法示例。
在下文中一共展示了List.Insert方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Decorate
/// <summary>
/// Transform collection of inlines
/// </summary>
public List<Inline> Decorate(IConferenceMessage msg, List<Inline> inlines)
{
const string pattern = @"((https?|ftp|dchub|magnet|mailto|gopher|telnet|file|notes|ms-help):((//)|(\\\\))+[\w\d:#@%/;$()~_?\+-=\\\.&]*)";
for (int i = 0; i < inlines.Count; i++)
{
// splite one Inline element (text (Run)) into several inlines (Runs and Hyperlinks)
var inline = inlines[i] as Run;
if (inline == null)
continue;
var matches = Regex.Matches(inline.Text, pattern).OfType<Match>().Select(item => item.Value).ToArray();
if (matches.Length < 1)
continue;
inlines.RemoveAt(i);
var parts = inline.Text.SplitAndIncludeDelimiters(matches).ToArray();
for (int j = i; j < parts.Length + i; j++)
{
var part = parts[j];
if (matches.Contains(part))
inlines.Insert(j, DecorateAsHyperlink(part));
else
inlines.Insert(j, CommonMessageDecorator.Decorate(msg, part));
}
}
return inlines;
}
示例2: MultimediaReportOptions
public MultimediaReportOptions()
{
InitializeComponent();
var user = PluginManager.Instance.User;
var service = new SupportService(user);
_extensions = service.GetMultimediaExtensions();
var types = service.GetMultimediaTypes();
_extensions.Insert(0, "(All)");
_multimediaTypes = new List<string>();
_multimediaTypes.Add("(All)");
foreach (MultimediaType type in types) {
if (!string.IsNullOrWhiteSpace(type.Name)) {
_multimediaTypes.Add(type.Name);
}
}
cmbExtension.ItemsSource = _extensions;
cmbExtension.SelectedIndex = 0;
cmbType.ItemsSource = _multimediaTypes;
cmbType.SelectedIndex = 0;
}
示例3: UserSettings
public UserSettings(FacebookUserSetting setting)
{
_setting = setting;
//get user
InitializeComponent();
var fb = new FacebookClient(setting.AccessToken);
var picSettings = new List<FacebookPictureSetting>();
dynamic friends = fb.Get("/me/friends");
foreach (var friend in friends.data)
{
picSettings.Add(new FacebookPictureSetting(new FacebookUser(friend.name, friend.id), false));
}
picSettings.Sort((x, y) => string.Compare(x.User.Name, y.User.Name));
picSettings.Insert(0, new FacebookPictureSetting(new FacebookUser(setting.User.Name, setting.User.Id), false));
var selectedPics = picSettings.Where(x => setting.PictureSettings.Any(y => y.User.Id == x.User.Id));
foreach (var sp in selectedPics)
{
sp.Selected = true;
}
lsUsers.ItemsSource = picSettings;
}
示例4: BookmarkEditor
public BookmarkEditor(Comisor.MainWindow mainWindow, string strName, string strPath, string strCurrentPath = "")
{
InitializeComponent();
this.main = mainWindow;
this.Title = Comisor.Resource.Bookmark_Editor;
lbName.Content = Comisor.Resource.Bookmark_Name + ":";
lbPath.Content = Comisor.Resource.Bookmark_FilePath + ":";
List<string> nameOption = new List<string>();
nameOption.AddRange(strPath.Split(new char[] { '\\' }, StringSplitOptions.RemoveEmptyEntries));
nameOption.Reverse();
nameOption.Insert(0, strName);
ys.DataProcessor.RemoveSame(ref nameOption);
cbName.ItemsSource = nameOption;
cbName.SelectedIndex = 0;
List<string> pathOption = new List<string>();
pathOption.Add(strPath);
if (strCurrentPath != "") pathOption.Add(strCurrentPath);
ys.DataProcessor.RemoveSame(ref pathOption);
cbPath.Focus();
cbPath.ItemsSource = pathOption;
cbPath.SelectedIndex = 0;
ckbShortcut.Content = Comisor.Resource.Bookmark_CreatShortcut;
btnOK.Content = mainWindow.resource.imgOK;
btnCancel.Content = mainWindow.resource.imgCancel;
this.PreviewKeyDown += new KeyEventHandler(InputBox_PreviewKeyDown);
}
示例5: GotoSummaryItem
internal void GotoSummaryItem(int changeNum)
{
SummaryNode rootNode = DataContext as SummaryNode;
if (rootNode != null)
{
Stack<SummaryNode> changeLocation = rootNode.FindPathToChangeNumber(changeNum);
if (changeLocation != null)
{
SummaryNode snChange = changeLocation.Peek();
Debug.Assert(snChange.SummaryItem.FirstChangeNumber == changeNum || snChange.SummaryItem.LastChangeNumber == changeNum);
List<object> locationList = new List<object>();
foreach (SummaryNode sn in changeLocation)
{
locationList.Insert(0,sn);
}
locationList.RemoveAt(0);
TreeViewItem tvi = theTreeView.ContainerFromItem(locationList);
snChange.Selected = true;
Debug.Assert(tvi != null);
if (tvi != null)
{
SelectAndShow(tvi);
}
}
}
}
示例6: EditarEmpleadoView
public EditarEmpleadoView()
{
InitializeComponent();
grid = new List<Empleado>();
grid = DataObjects.RRHH.EmpleadoSQL.BuscarEmpleado("", "",RRHH.MantenerEmpleadoView.INDICEMP, "", "", "");
TxtCodEmp.Text = grid[0].CodEmpleado;
TxtDni.Text = grid[0].Dni;
TxtNomb.Text = grid[0].Nombre;
TxtApePat.Text = grid[0].ApePaterno;
TxtApeMat.Text = grid[0].ApeMaterno;
TxtFechNac.Text = grid[0].FechNacimiento.ToString();
if (grid[0].Sexo == "M") RdbMasc.IsChecked = true; else RdbFem.IsChecked = true;
TxtDir.Text = grid[0].Direccion;
TxtRef.Text = grid[0].Referecia;
TxtTelef.Text = grid[0].Telefono;
TxtCel.Text = grid[0].Celular;
TxtEmail.Text = grid[0].EmailEmpleado;
CmbPuesto.Text = grid[0].Puesto;
CmbArea.Text = grid[0].Area;
TxtEmailEmpresa.Text = grid[0].EmailEmpresa;
TxtSalario.Text = grid[0].Sueldo + "";
TxtBanco.Text = grid[0].Banco;
TxtCuentaBancaria.Text = grid[0].CuentaBancaria;
List<string> tiendas = new List<string>();
tiendas = DataObjects.RRHH.EmpleadoSQL.Tiendas();
string almCentral = "ALMACEN CENTRAL";
tiendas.Insert(0, almCentral);
CmbTienda.ItemsSource = tiendas;
CmbTienda.Text = grid[0].Tienda;
}
示例7: GetPrioritiesForCalcs
/// <summary>
/// Gets a modified version of the user's spell priorities, for internal
/// purposes.
/// </summary>
/// <param name="spellPriority"></param>
/// <returns></returns>
public List<string> GetPrioritiesForCalcs(WarlockTalents talents, bool execute)
{
List<string> forCalcs = new List<string>(SpellPriority);
if (talents.Backdraft > 0 && !SpellPriority.Contains("Incinerate (Under Backdraft)"))
{
forCalcs.Insert(forCalcs.Count, "Incinerate (Under Backdraft)");
}
if (!execute
&& Filler.Equals("Shadow Bolt")
&& !forCalcs.Contains("Shadow Bolt (Instant)")
&& ShadowBolt_Instant.IsCastable(talents, forCalcs))
{
forCalcs.Insert(forCalcs.Count, "Shadow Bolt (Instant)");
}
return forCalcs;
}
示例8: SetComponentLinks
internal void SetComponentLinks(IEnumerable<AbstractEndpoint.IAbstractComponentLink> componentLinks)
{
var links = new List<ComponentsOrderingViewModel>();
var setOrder = new Action(() =>
{
var worker = new BackgroundWorker();
worker.DoWork += (e, s) =>
{
foreach (var cl in links.AsEnumerable().Reverse())
{
cl.Link.Order = links.IndexOf(cl) + 1;
}
};
worker.RunWorkerAsync();
});
foreach (var cl in componentLinks.OrderBy(x => x.Order))
{
var vm = new ComponentsOrderingViewModel { Link = cl };
links.Add(vm);
vm.UpCommand = new RelayCommand(
() =>
{
var prevIndex = links.IndexOf(vm);
links.Remove(vm);
links.Insert(prevIndex - 1, vm);
this.ComponentList.ItemsSource = null;
this.ComponentList.ItemsSource = links;
this.ComponentList.SelectedItem = vm;
setOrder();
}, () => links.IndexOf(vm) > 0);
vm.DownCommand = new RelayCommand(
() =>
{
var prevIndex = links.IndexOf(vm);
links.Remove(vm);
links.Insert(prevIndex + 1, vm);
this.ComponentList.ItemsSource = null;
this.ComponentList.ItemsSource = links;
this.ComponentList.SelectedItem = vm;
setOrder();
}, () => links.IndexOf(vm) < links.Count - 1);
}
this.ComponentList.ItemsSource = links;
}
示例9: GetListCutomizeYear
public static List<CustomizeYear> GetListCutomizeYear()
{
List<CustomizeYear> result = new List<CustomizeYear>();
for (int i = 2007; i < DateTime.Now.Year; i++)
{
result.Insert(0, new CustomizeYear { ID = i, Name = i.ToString() + " - " + (i + 1).ToString() });
}
return result;
}
示例10: Decorate
/// <summary>
/// Transform collection of inlines
/// </summary>
public List<Inline> Decorate(IConferenceMessage msg, List<Inline> inlines)
{
string style = "timestampStyle";
var timestampInline = new Run(msg.Timestamp.ToString("[hh:mm:ss] "));
timestampInline.SetResourceReference(FrameworkContentElement.StyleProperty, style);
inlines.Insert(0, timestampInline);
return inlines;
}
示例11: AddToSearchHistory
private void AddToSearchHistory(ref List<string> history, string newSearch)
{
if (history.Contains(newSearch))
history.Remove(newSearch);
if (history.Count == 100)
history.RemoveAt(99);
history.Insert(0, newSearch);
}
示例12: ZaladujDane1
//Dane String i Int (Odpowiadajace wartościom CHART w XAML
// IndependentValueBinding="{Binding Path=Key}"
// DependentValueBinding="{Binding Path=Value}">
private void ZaladujDane1()
{
((PieSeries)mcChart.Series[0]).ItemsSource = dict;
List<KeyValuePair<string, string>> kvpList = new List<KeyValuePair<string, string>>();
int j = 0;
foreach (var i in dict)
{
kvpList.Insert(j, new KeyValuePair<string, string>(i.Key.ToString(),i.Value.ToString()));
j++;
}
}
示例13: MaterialByUserWindow
public MaterialByUserWindow(Action<List<LabelSetItem>> successAction = null)
{
InitializeComponent();
this.SuccessAction = successAction;
var service = new SupportService(User);
var list = service.GetUsers();
var model = new List<string>(list.Select((user) => {
return user.Username;
}));
model.Insert(0, "<All Users>");
cmbUser.ItemsSource = model;
Loaded += new RoutedEventHandler(MaterialByUserWindow_Loaded);
}
示例14: RegistrarEmpleadoView
public RegistrarEmpleadoView()
{
InitializeComponent();
TxtFechNac.Text = DateTime.Today.Day.ToString() + "/" + DateTime.Today.Month.ToString() + "/" + DateTime.Today.Year.ToString();
grid = new List<Empleado>();
grid = DataObjects.RRHH.EmpleadoSQL.BuscarEmpleado("", "", "", "", "", "");
TxtCodEmp.Text = TxtCodEmp.Text = "EMP-" + grid.Count;
List<string> tiendas = new List<string>();
tiendas = DataObjects.RRHH.EmpleadoSQL.Tiendas();
string almCentral = "ALMACEN CENTRAL";
tiendas.Insert(0,almCentral);
CmbTienda.ItemsSource = tiendas;
}
示例15: MantenerEmpleadoView
public MantenerEmpleadoView()
{
InitializeComponent();
grid = new List<Empleado>();
grid = DataObjects.RRHH.EmpleadoSQL.BuscarEmpleado("","","","","","");
List<string> tiendas = new List<string>();
tiendas = DataObjects.RRHH.EmpleadoSQL.Tiendas();
string almCentral = "ALMACEN CENTRAL";
tiendas.Insert(0, almCentral);
CmbTienda.ItemsSource = tiendas;
Lista.ItemsSource = grid;
Lista.Items.Refresh();
}