(_ => "Nya!"));
+ var a = c.Resolve(); // where A accepts string parameter in constructor
+ Assert.AreEqual("Nya!", a.Message)
+ ]]>
();
+ handler.Handle(data);
+ }
+ ]]>
Expression.Constant("blah", typeof(string))
.
+ If unable to convert should return null. new Car(Arg.Of()) { Color = Arg.Of("CarColor") }]]>
+ or static method call Car.Create(Arg.Of())]]>
+ (optional) Primitive custom values for dependencies.
+ (Registrator.Interfaces)]]>
(r => new Car(r.Resolve()))]]>
(Made.Of(() => new Car(Arg.Of())))]]>
.
+ (r => new Car(r.Resolve()))]]>
(Made.Of(() => new Car(Arg.Of())))]]>
+ ();
+ var services = container.Resolve(typeof(IEnumerable
();
+ var services = container.Resolve>(typeof(IService));
+ ]]>
();
+ var services = container.Resolve, IService>();
+ ]]>
();
+ var services = container.Resolve(typeof(Lazy
>(); // for dynamic result - default behavior
+ container.Resolve(); // for fixed array
+ container.Resolve>(); // same as fixed array
+ ]]>
+
.
+
+ NOTE: It is trying hard but the Parameter expression are not consolidated into one. Hopefully R# will help you to re-factor them into a single variable.
+
.
+ Check `IssueTests.Issue179_Add_something_like_LambdaExpression_CompileToMethod.cs` for example.
+
+
+
+ [JsonContainer(ItemConverterType = typeof(MyContainerConverter), ItemConverterParameters = new object[] { 123, "Four" })]
+
+
+ [JsonContainer(NamingStrategyType = typeof(MyNamingStrategy), NamingStrategyParameters = new object[] { 123, "Four" })]
+
+
+
+ [JsonProperty(ItemConverterType = typeof(MyContainerConverter), ItemConverterParameters = new object[] { 123, "Four" })]
+
+
+ [JsonProperty(NamingStrategyType = typeof(MyNamingStrategy), NamingStrategyParameters = new object[] { 123, "Four" })]
+
+
+
+
+
+
+
+
+
+
+
+
+
+ public MyClass()
+ {
+ this.submitCommand = new DelegateCommand<int?>(this.Submit, this.CanSubmit);
+ }
+
+ private bool CanSubmit(int? customerId)
+ {
+ return (customerId.HasValue && customers.Contains(customerId.Value));
+ }
+
+
+
+
+ RadOutlookBar outlookBar = new RadOutlookBar();
+ outlookBar.ItemsSource = new string[] { "Item Header 1", "Item Header 2", "Item Header 3" };
+ outlookBar[1].IsSelected = true;
+
+
+ void Page_Load(object sender, EventArgs e)
+ {
+ RadPanelBar myPanelBar = new RadPanelBar();
+ }
+
+
+ <telerikPrimitives:RadRadialMenu.Resources>
+ <Style TargetType="telerikPrimitivesMenu:VisualStatesItemPresenter">
+ <Setter Property="ThicknessFactor" Value="0.3"/>
+ </Style>
+ </telerikPrimitives:RadRadialMenu.Resources>
+
+
+ <telerikPrimitives:RadRadialMenu.Resources>
+ <Style TargetType="telerikPrimitivesMenu:VisualStatesItemPresenter">
+ <Setter Property="ArrowThicknessFactor" Value="0.3"/>
+ </Style>
+ </telerikPrimitives:RadRadialMenu.Resources>
+
+
+ <telerikPrimitives:RadialMenuItem ToolTipContent="Home"/>
+
+
+ <telerikPrimitives:RadialMenuItem x:Name="menuItem"/>
+
+
+ var parent = this.menuItem;
+
+
+ <telerikPrimitives:RadialMenuItem Header="Item" IconContent="" IsSelected="True"/>
+
+
+ <telerikPrimitives:RadRadialMenu>
+ <telerikPrimitives:RadialMenuItem GroupName="first" Header="first 1"/>
+ <telerikPrimitives:RadialMenuItem GroupName="first" Header="first 2"/>
+ <telerikPrimitives:RadialMenuItem GroupName="first" Header="first 3"/>
+ <telerikPrimitives:RadialMenuItem GroupName="second" Header="second 1"/>
+ <telerikPrimitives:RadialMenuItem GroupName="second" Header="second 2"/>
+ <telerikPrimitives:RadialMenuItem GroupName="second" Header="second 3"/>
+ </telerikPrimitives:RadRadialMenu>
+
+
+ <telerikPrimitives:RadialMenuItem Header="Item" IconContent=""/>
+
+
+ <telerikPrimitives:RadialMenuItem Header="Item" IconContent=""/>
+
+
+ <telerikPrimitives:RadialMenuItem ContentSectorBackground="Violet"/>
+
+
+ <telerikPrimitives:RadRadialMenu x:Name="radialMenu">
+ <telerikPrimitives:RadialMenuItem Header="Item" IconContent="" x:Name="menuItem">
+ <telerikPrimitives:RadialMenuItem Header="SubItem 1" IconContent=""/>
+ <telerikPrimitives:RadialMenuItem Header="SubItem 2" IconContent=""/>
+ </telerikPrimitives:RadialMenuItem>
+ </telerikPrimitives:RadRadialMenu>
+
+
+ var item = this.radialMenu.Items[0];
+ var children = item.ChildItems;
+
+
+ <telerikPrimitives:RadRadialMenu ShowToolTip="True"/>
+
+
+ <telerikPrimitives:RadRadialMenu IsOpen="True"/>
+
+
+ <telerikPrimitives:RadRadialMenu StartAngle="45"/>
+
+
+ <telerikPrimitives:RadRadialMenu InnerNavigationRadiusFactor="0.3"/>
+
+
+ <telerikPrimitives:RadRadialMenu InnerRadiusFactor="0.3"/>
+
+
+ <telerikPrimitives:RadRadialMenu OuterRadiusFactor="0.9"/>
+
+
+ <telerikPrimitives:RadRadialMenu>
+ <telerikPrimitives:RadRadialMenu.ContentMenuBackgroundStyle>
+ <Style TargetType="Rectangle">
+ <Setter Property="Fill" Value="LightGreen"/>
+ </Style>
+ </telerikPrimitives:RadRadialMenu.ContentMenuBackgroundStyle>
+ </telerikPrimitives:RadRadialMenu>
+
+
+ <telerikPrimitives:RadRadialMenu>
+ <telerikPrimitives:RadRadialMenu.NavigationMenuBackgroundStyle>
+ <Style TargetType="Rectangle">
+ <Setter Property="Fill" Value="LightGreen"/>
+ </Style>
+ </telerikPrimitives:RadRadialMenu.NavigationMenuBackgroundStyle>
+ </telerikPrimitives:RadRadialMenu>
+
+
+ <telerikPrimitives:RadRadialMenu x:Name="radialMenu">
+ <telerikPrimitives:RadialMenuItem Header="Item 1"/>
+ <telerikPrimitives:RadialMenuItem Header="Item 2"/>
+ <telerikPrimitives:RadialMenuItem Header="Item 3"/>
+ </telerikPrimitives:RadRadialMenu>
+
+
+ var items = this.radialMenu.Items;
+
+
+ <TextBlock Text="Some Text">
+ <telerikPrimitives:RadRadialContextMenu.Menu>
+ <telerikPrimitives:RadRadialMenu x:Name="radialMenu"/>
+ </telerikPrimitives:RadRadialContextMenu.Menu>
+ </TextBlock>
+
+
+ var textBlock = this.radialMenu.TargetElement;
+
+
+
+
+ ]]>
+
+
+
+
+
+ ]]>
+
+
+
+
+
+
+ ]]>
+
+
+
+
+
+
+ ]]>
+
+
+
+
+
+
+ ]]>
+
+
+
+
+
+
+ ]]>
+
+
+
+
+
+
+ ]]>
+
+
+
+
+
+
+ ]]>
+
+
+
+
+
+
+ ]]>
+
+
+
+
+
+
+ ]]>
+
+
+
+
+
+
+ ]]>
+
+
+
+
+
+
+ ]]>
+
+
+
+
+
+
+ ]]>
+
+
+
+
+
+
+ ]]>
+
+
+
+
+
+
+ ]]>
+
+
+
+
+
+
+ ]]>
+
+
+
+
+
+
+ ]]>
+
+
+
+
+
+
+ ]]>
+
+
+ draggedItems = e.DraggedItems;
+ }
+ ]]>
+
+
+
+ ]]>
+
+
+ draggedItems = e.DraggedItems;
+ }
+ ]]>
+
+
+
+ ]]>
+
+
+ draggedItems = e.DraggedItems;
+
+ // if the action should be canceled set Handled property to true
+ e.Handled = true;
+ }
+ ]]>
+
+
+
+ ]]>
+
+
+ draggedItems = e.DraggedItems;
+ }
+ ]]>
+
+
+
+ ]]>
+
+
+
+
+
+
+ ]]>
+
+
+
+ ]]>
+
+
+ RadWindow window = new RadWindow();
+
+
+ Dim window As RadWindow = New RadWindow
+
+
+ RadWindow window = new RadWindow();
+ window.Height = 100;
+ window.Width = 100;
+ window.Header = "RadWindow";
+ window.Content = "This is your content";
+ window.Show();
+
+
+ Dim window As RadWindow = New RadWindow
+ window.Height = 100
+ window.Width = 100
+ window.Header = "RadWindow"
+ window.Content = "This is your content"
+ window.Show()
+
+
+ RadWindow window = new RadWindow();
+ window.Height = 100;
+ window.Width = 100;
+ window.Header = "RadWindow";
+ window.Content = "This is your content";
+ window.ShowDialog();
+
+
+ Dim window As RadWindow = New RadWindow
+ window.Height = 100
+ window.Width = 100
+ window.Header = "RadWindow"
+ window.Content = "This is your content"
+ window.ShowDialog()
+
+
+ WindowBase window = new WindowBase();
+ window.Height = 100;
+ window.Width = 100;
+ window.Header = "WindowBase";
+ window.Content = "This is your content";
+ window.Show();
+ window.Close();
+
+
+ Dim window As WindowBase = New WindowBase
+ window.Height = 100
+ window.Width = 100
+ window.Header = "WindowBase"
+ window.Content = "This is your content"
+ window.Show()
+ window.Close()
+
+
+ void Page_Load(object sender, EventArgs e)
+ {
+ RadProgressBar myProgressBar = new RadProgressBar();
+ myProgressBar.Orientation = Orientation.Vertical;
+ }
+
+
+
+ ]]>
+
+
+
+
+
+
+ ]]>
+
+
+
+
+
+
+ ]]>
+
+
+
+
+
+
+ ]]>
+
+
+
+
+
+
+ ]]>
+
+
+
+
+
+ (this);
+ _weakEventListener.OnEventAction = (instance, source, eventArgs) =>
+ instance.OnCollectionChanged(source, eventArgs);
+ _weakEventListener.OnDetachAction = (weakEventListener) =>
+ newNotifyCollectionChanged.CollectionChanged -= weakEventListener.OnEvent;
+ newNotifyCollectionChanged.CollectionChanged += _weakEventListener.OnEvent;
+ ]]>
+
+
+ create table dbo.Log
+ (
+ Id bigint identity (1, 1) not null,
+ LogDate datetime not null,
+ Thread nvarchar(255) not null,
+ LogLevel nvarchar(50) not null,
+ Logger nvarchar(255) not null,
+ LogMessage nvarchar(2000) not null,
+ Exception nvarchar(2000) null,
+ constraint Log_PKEY primary key (Id)
+ ) with (data_compression = page)
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ "DSN=MS Access Database;UID=admin;PWD=;SystemDB=C:\data\System.mdw;SafeTransactions = 0;FIL=MS Access;DriverID = 25;DBQ=C:\data\train33.mdb"
+ "Driver={Microsoft Access Driver (*.mdb)};DBQ=C:\Work\cvs_root\log4net-1.2\access.mdb;UID=;PWD=;"
+ "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Work\cvs_root\log4net-1.2\access.mdb;User Id=;Password=;"
+ System.Data.OleDb.OleDbConnection, System.Data, Version=1.0.3300.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+ System.Data.SqlClient.SqlConnection, System.Data, Version=1.0.3300.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+ Microsoft.Data.Odbc.OdbcConnection,Microsoft.Data.Odbc,version=1.0.3300.0,publicKeyToken=b77a5c561934e089,culture=neutral
+ This is an optional package that you can download from
+ http://msdn.microsoft.com/downloads
+ search for ODBC .NET Data Provider.
+ System.Data.OracleClient.OracleConnection, System.Data.OracleClient, Version=1.0.3300.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+ This is an optional package that you can download from
+ http://msdn.microsoft.com/downloads
+ search for .NET Managed Provider for Oracle.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <mapping>
+ <level value="ERROR" />
+ <eventLogEntryType value="Error" />
+ </mapping>
+ <mapping>
+ <level value="DEBUG" />
+ <eventLogEntryType value="Information" />
+ </mapping>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ IPEndPoint remoteEndPoint = new IPEndPoint(IPAddress.Any, 0);
+ UdpClient udpClient;
+ byte[] buffer;
+ string loggingEvent;
+
+ try
+ {
+ udpClient = new UdpClient(8080);
+
+ while(true)
+ {
+ buffer = udpClient.Receive(ref remoteEndPoint);
+ loggingEvent = System.Text.Encoding.Unicode.GetString(buffer);
+ Console.WriteLine(loggingEvent);
+ }
+ }
+ catch(Exception e)
+ {
+ Console.WriteLine(e.ToString());
+ }
+
+
+ Dim remoteEndPoint as IPEndPoint
+ Dim udpClient as UdpClient
+ Dim buffer as Byte()
+ Dim loggingEvent as String
+
+ Try
+ remoteEndPoint = new IPEndPoint(IPAddress.Any, 0)
+ udpClient = new UdpClient(8080)
+
+ While True
+ buffer = udpClient.Receive(ByRef remoteEndPoint)
+ loggingEvent = System.Text.Encoding.Unicode.GetString(buffer)
+ Console.WriteLine(loggingEvent)
+ Wend
+ Catch e As Exception
+ Console.WriteLine(e.ToString())
+ End Try
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ log4net configuration XML goes here
+
+
+
+
+
+
+
+
+
+ using log4net.Config;
+ using System.IO;
+ using System.Configuration;
+
+ ...
+
+ XmlConfigurator.Configure(new FileInfo(ConfigurationSettings.AppSettings["log4net-config-file"]));
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ using log4net.Config;
+ using System.IO;
+ using System.Configuration;
+
+ ...
+
+ XmlConfigurator.Configure(new FileInfo(ConfigurationSettings.AppSettings["log4net-config-file"]));
+
+
+
+
+
+
+
+
+
+ log.Debug("This is entry number: " + i );
+
+
+ if (log.IsDebugEnabled())
+ {
+ log.Debug("This is entry number: " + i );
+ }
+
+
+ GlobalContext.Properties["hostname"] = Environment.MachineName;
+
+
+ ILog log = LogManager.GetLogger("application-log");
+
+ log.Info("Application Start");
+ log.Debug("This is a debug message");
+
+ if (log.IsDebugEnabled)
+ {
+ log.Debug("This is another debug message");
+ }
+
+
+ log.Debug("This is entry number: " + i );
+
+
+ if (log.IsDebugEnabled)
+ {
+ log.Debug("This is entry number: " + i );
+ }
+
+
+ private static readonly bool isDebugEnabled = log.IsDebugEnabled;
+
+
+ if (isDebugEnabled)
+ {
+ log.Debug("This is entry number: " + i );
+ }
+
+
+ StringWriter writer = new StringWriter();
+ Layout.Format(writer, loggingEvent);
+ string formattedEvent = writer.ToString();
+
+
+ ILog log = LogManager.GetLogger(typeof(TestApp));
+ log.Debug("Message 1");
+ log.Warn("Message 2");
+
+
+ DEBUG [main]: Message 1
+ WARN [main]: Message 2
+
+ Format modifier | +left justify | +minimum width | +maximum width | +comment | +
---|---|---|---|---|
%20logger | +false | +20 | +none | +
+ |
+
%-20logger | +true | +20 | +none | +
+ |
+
%.30logger | +NA | +none | +30 | +
+ |
+
false | +20 | +30 | +
+ |
+ |
%-20.30logger | +true | +20 | +30 | +
+ |
+
%timestamp [%thread] %level %logger %ndc - %message%newline
+ %-6timestamp [%15.15thread] %-5level %30.30logger %ndc - %message%newline
+
+ DEBUG - Hello world
+
+
+ <?xml version="1.0" ?>
+
+ <!DOCTYPE log4net:events SYSTEM "log4net-events.dtd" [<!ENTITY data SYSTEM "abc">]>
+
+ <log4net:events version="1.2" xmlns:log4net="http://logging.apache.org/log4net/schemas/log4net-events-1.2>
+ &data;
+ </log4net:events>
+
+
+ LogicalThreadContext.Properties["user"] = userName;
+ log.Info("This log message has a LogicalThreadContext Property called 'user'");
+
+
+ using(LogicalThreadContext.Stacks["LDC"].Push("my context message"))
+ {
+ log.Info("This log message has a LogicalThreadContext Stack message that includes 'my context message'");
+
+ } // at the end of the using block the message is automatically popped
+
+
+ ILog log = LogManager.GetLogger("application-log");
+
+ log.Info("Application Start");
+ log.Debug("This is a debug message");
+
+ if (log.IsDebugEnabled)
+ {
+ log.Debug("This is another debug message");
+ }
+
+
+ using (NDC.Push("my context message"))
+ {
+ ... all log calls will have 'my context message' included ...
+
+ } // at the end of the using block the message is automatically removed
+
+
+ using(log4net.NDC.Push("NDC_Message"))
+ {
+ log.Warn("This should have an NDC message");
+ }
+
+
+ var someValue = "ExampleContext"
+ using(log4net.NDC.PushFormat("NDC_Message {0}", someValue))
+ {
+ log.Warn("This should have an NDC message");
+ }
+
+
+ ThreadContext.Properties["user"] = userName;
+ log.Info("This log message has a ThreadContext Property called 'user'");
+
+
+ using(ThreadContext.Stacks["NDC"].Push("my context message"))
+ {
+ log.Info("This log message has a ThreadContext Stack message that includes 'my context message'");
+
+ } // at the end of the using block the message is automatically popped
+
+
+ using log4net.Util;
+
+ ILog log = LogManager.GetLogger("application-log");
+
+ log.InfoExt("Application Start");
+ log.DebugExt("This is a debug message");
+
+
+ using(log4net.LogicalThreadContext.Stacks["NDC"].Push("Stack_Message"))
+ {
+ log.Warn("This should have an ThreadContext Stack message");
+ }
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ string s = OptionConverter.SubstituteVariables("Value of key is ${key}.");
+
+
+ string s = OptionConverter.SubstituteVariables("Value of nonExistentKey is [${nonExistentKey}]");
+
+
+ {key1=value1, key2=value2, key3=value3}
+
+
+ {key1=value1, key2=value2, key3=value3}
+
+
+ using(log4net.ThreadContext.Stacks["NDC"].Push("Stack_Message"))
+ {
+ log.Warn("This should have an ThreadContext Stack message");
+ }
+
+