Нашла сервис для создания инстакартинок из кода.
http://instacod.es/
Continue Reading →
Category Archives: C#
Настройка AutoMapper для субклассов
Mapper.CreateMap() .Include() .Include() .Include(); Mapper.CreateMap(); Mapper.CreateMap(); Mapper.CreateMap(); var items = Repo.GetAll(); Mapper.Map(items, new List());
http://stackoverflow.com/questions/4513302/how-do-i-use-automapper-to-map-multiple-subclasses-into-one-class
System.Web.Optimization
Install-Package Microsoft.AspNet.Web.Optimization
C#-MongoDB Polymorphic Classes
Появилась задача хранить документы с разной структурой в одной коллекции.
Вопрос на СО
http://stackoverflow.com/questions/13956413/mongodb-embedded-polymorphic-objects
Документация
http://docs.mongodb.org/ecosystem/tutorial/serialize-documents-with-the-csharp-driver/#polymorphic-classes-and-discriminators
Мои примеры.
Continue Reading →
C# получение пути к AppData
Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData)
Пример:
var fileName = Path.Combine(Environment.GetFolderPath( Environment.SpecialFolder.ApplicationData), "DateLinks.xml")
Windows:
cmd C:\>set
Получаем примерно такое:
APPDATA=C:\Documents and Settings\slowpoke_xp_user\Application Data
WPF News Ticker
RSS и бегущая строка, красиво
WPF Бегущая строка
Вариант раз
Canvas x:Name="Canvas" Background="Transparent" Height="25" VerticalAlignment="Top">
http://axedeos.blogspot.ru/2012/11/wpf.html
Вариант два, с заданием в коде и с паузой
public partial class StopAnimationWindow : System.Windows.Window { AnimationClock clock; public StopAnimationWindow() { InitializeComponent(); } private void StartAnimation(Object sender, RoutedEventArgs e) { DoubleAnimation animation = new DoubleAnimation(); animation.Duration = new Duration(TimeSpan.FromSeconds(5)); animation.To = 500d; animation.From = 0d; clock = animation.CreateClock(); rect.ApplyAnimationClock(Rectangle.WidthProperty, clock); } private void PauseAnimation(Object sender, RoutedEventArgs e) { clock.Controller.Pause(); } private void ResumeAnimation(Object sender, RoutedEventArgs e) { clock.Controller.Resume(); } private void StopAnimation(Object sender, RoutedEventArgs e) { clock.Controller.Stop(); } }
http://social.msdn.microsoft.com/Forums/vstudio/en-US/5eb35986-4666-43f4-9e88-e940bf464ff5/how-to-pause-animation
WPF set Margin
Thickness margin = MyControl.Margin; margin.Left = 10; MyControl.Margin = margin;
http://stackoverflow.com/questions/1003772/setting-margin-properties-in-code
WPF версия программы
System.Reflection.Assembly assembly = System.Reflection.Assembly.GetExecutingAssembly(); Version version = assembly.GetName().Version;
hgignore
Для .Net
syntax: glob bin/** *.suo obj/** *.orig *.user *.rej Bin/**