本文整理汇总了C#中Status.ToList方法的典型用法代码示例。如果您正苦于以下问题:C# Status.ToList方法的具体用法?C# Status.ToList怎么用?C# Status.ToList使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Status
的用法示例。
在下文中一共展示了Status.ToList方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Window_Loaded
private void Window_Loaded(object sender, RoutedEventArgs e)
{
this.Cursor = Cursors.Wait;
this.imageAvatar.Source = MyImageConverter.FromBitmap(Properties.Resources.avatar_48);
this.labelFreeText.Content = this.configurationService.Get(Configuration.ConfFolder.RCS, Configuration.ConfEntry.FREE_TEXT, Configuration.DEFAULT_RCS_FREE_TEXT);
this.labelDisplayName.Content = this.configurationService.Get(Configuration.ConfFolder.IDENTITY, Configuration.ConfEntry.DISPLAY_NAME, Configuration.DEFAULT_IDENTITY_DISPLAY_NAME);
if (System.IO.File.Exists(MainWindow.AVATAR_PATH))
{
this.imageAvatar.Source = new ImageSourceConverter().ConvertFromInvariantString(MainWindow.AVATAR_PATH) as ImageSource;
}
Status[] statues = new Status[]
{
new Status("Online", PresenceStatus.Online,"/BogheApp;component/embedded/16/user_16.png"),
new Status("Busy", PresenceStatus.Busy,"/BogheApp;component/embedded/16/user_busy_16.png"),
new Status("Be Right Back", PresenceStatus.BeRightBack,"/BogheApp;component/embedded/16/user_back16.png"),
new Status("Away", PresenceStatus.Away,"/BogheApp;component/embedded/16/user_time_16.png"),
new Status("On The Phone", PresenceStatus.OnThePhone,"/BogheApp;component/embedded/16/user_onthephone_16.png"),
new Status("HyperAvailable", PresenceStatus.HyperAvailable,"/BogheApp;component/embedded/16/user_hyper_avail_16.png"),
new Status("Offline", PresenceStatus.Offline,"/BogheApp;component/embedded/16/user_offline_16.png")
};
PresenceStatus status = (PresenceStatus)Enum.Parse(typeof(PresenceStatus),
this.configurationService.Get(Configuration.ConfFolder.RCS, Configuration.ConfEntry.STATUS, Configuration.DEFAULT_RCS_STATUS.ToString()));
int statusIndex = statues.ToList().FindIndex(x => x.Value == status);
this.comboBoxStatus.ItemsSource = statues;
this.comboBoxStatus.SelectedIndex = statusIndex >= 0 ? statusIndex : 6;
this.registrations.CollectionChanged += (_sender, _e) =>
{
this.MenuItemFile_Registrations.Header = String.Format("Registrations ({0})", this.registrations.Count);
};
this.watchers.CollectionChanged += (_sender, _e) =>
{
this.MenuItemEAB_Authorizations.Header = String.Format("Authorizations ({0})", this.watchers.Count);
};
this.Cursor = Cursors.Arrow;
}