当前位置: 首页>>代码示例>>C#>>正文


C# Generator.CreateShared方法代码示例

本文整理汇总了C#中Generator.CreateShared方法的典型用法代码示例。如果您正苦于以下问题:C# Generator.CreateShared方法的具体用法?C# Generator.CreateShared怎么用?C# Generator.CreateShared使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Generator的用法示例。


在下文中一共展示了Generator.CreateShared方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Instantiator

		/// <summary>
		/// Gets a delegate to instantiate objects of this type with minimal overhead
		/// </summary>
		/// <param name="generator">Generator to create the solid brushes</param>
		public static Func<Color, SolidBrush> Instantiator (Generator generator = null)
		{
			var sharedHandler = generator.CreateShared<ISolidBrush> ();
			return color => {
				var control = sharedHandler.Create (color);
				return new SolidBrush (sharedHandler, control);
			};
		}
开发者ID:Exe0,项目名称:Eto,代码行数:12,代码来源:SolidBrush.cs

示例2: DisplayBounds

		public static RectangleF DisplayBounds (Generator generator = null)
		{
			var handler = generator.CreateShared <IScreens> ();
			var bounds = RectangleF.Empty;
			foreach (var screen in handler.Screens) {
				bounds.Union (screen.Bounds);
			}
			return bounds;
		}
开发者ID:JohnACarruthers,项目名称:Eto,代码行数:9,代码来源:Screen.cs

示例3: LinearGradientBrush

		#pragma warning disable 612,618

		/// <summary>
		/// Initializes a new instance of the <see cref="Eto.Drawing.LinearGradientBrush"/> class between two points
		/// </summary>
		/// <param name="startColor">Start color for the gradient</param>
		/// <param name="endColor">End color for the gradient</param>
		/// <param name="startPoint">Start point for the gradient</param>
		/// <param name="endPoint">End point for the gradient</param>
		/// <param name="generator">Generator to create the brush, or null to use the current generator</param>
		public LinearGradientBrush(Color startColor, Color endColor, PointF startPoint, PointF endPoint, Generator generator)
		{
			handler = generator.CreateShared<IHandler>();
			ControlObject = handler.Create(startColor, endColor, startPoint, endPoint);
		}
开发者ID:gene-l-thomas,项目名称:Eto,代码行数:15,代码来源:LinearGradientBrush.cs

示例4: Instantiator

		/// <summary>
		/// Gets a delegate to instantiate <see cref="LinearGradientBrush"/> objects
		/// </summary>
		/// <remarks>
		/// Use this to instantiate many objects of this type
		/// </remarks>
		/// <param name="generator">Generator to create the objects with</param>
		public static Func<Color, Color, PointF, PointF, LinearGradientBrush> Instantiator (Generator generator = null)
		{
			var handler = generator.CreateShared<ILinearGradientBrush>();
			return (startColor, endColor, startPoint, endPoint) => {
				var control = handler.Create (startColor, endColor, startPoint, endPoint);
				return new LinearGradientBrush (handler, control);
			};
		}
开发者ID:alexandrebaker,项目名称:Eto,代码行数:15,代码来源:LinearGradientBrush.cs

示例5: Pen

		public Pen(Color color, float thickness, Generator generator)
		{
			handler = generator.CreateShared<IHandler>();
			ControlObject = handler.Create(color, thickness);
		}
开发者ID:gene-l-thomas,项目名称:Eto,代码行数:5,代码来源:Pen.cs

示例6: Handler

		static IMouse Handler (Generator generator)
		{
			return generator.CreateShared<IMouse> ();
		}
开发者ID:JohnACarruthers,项目名称:Eto,代码行数:4,代码来源:Mouse.cs

示例7: Instantiator

		/// <summary>
		/// Gets an instantiator for the texture brush to create instances
		/// </summary>
		/// <remarks>
		/// This can be used to instantiate texture brushes when creating many brushes to minimize overhead
		/// </remarks>
		/// <param name="generator">Generator to create the brush</param>
		public Func<Image, float, TextureBrush> Instantiator (Generator generator = null)
		{
			var handler = generator.CreateShared<ITextureBrush> ();
			return (image, opacity) => {
				return new TextureBrush (handler, image, opacity);
			};
		}
开发者ID:JohnACarruthers,项目名称:Eto,代码行数:14,代码来源:TextureBrush.cs

示例8: TextureBrush

		/// <summary>
		/// Initializes a new instance of the <see cref="Eto.Drawing.TextureBrush"/> class.
		/// </summary>
		/// <param name="image">Image for the brush</param>
		/// <param name="opacity">Opacity of the texture to apply to the brush when painting</param>
		/// <param name="generator">Generator to create the brush</param>
		public TextureBrush (Image image, float opacity = 1f, Generator generator = null)
		{
			this.Image = image;
			handler = generator.CreateShared<ITextureBrush> ();
			ControlObject = handler.Create (image, opacity);
		}
开发者ID:JohnACarruthers,项目名称:Eto,代码行数:12,代码来源:TextureBrush.cs

示例9: AvailableFontFamilies

		/// <summary>
		/// Gets an enumeration of available font families in the current system
		/// </summary>
		/// <param name="generator">Generator to get the font families for</param>
		/// <returns>An enumeration of font family objects that this system supports</returns>
		public static IEnumerable<FontFamily> AvailableFontFamilies (Generator generator = null)
		{
			var fonts = generator.CreateShared<IFonts>();
			return fonts.AvailableFontFamilies;
		}
开发者ID:JohnACarruthers,项目名称:Eto,代码行数:10,代码来源:Fonts.cs

示例10: GetFolderPath

		/// <summary>
		/// Gets the folder path for the specified special folder
		/// </summary>
		/// <param name="folder">Special folder to retrieve the path for</param>
		/// <param name="generator">Generator to get the folder path with</param>
		/// <returns>Path of the specified folder</returns>
		public static string GetFolderPath (EtoSpecialFolder folder, Generator generator = null)
		{
			var handler = generator.CreateShared<IEtoEnvironment> ();
			return handler.GetFolderPath (folder);
		}
开发者ID:Exe0,项目名称:Eto,代码行数:11,代码来源:EtoEnvironment.cs

示例11: SolidBrush

		public SolidBrush(Color color, Generator generator = null)
		{
			handler = generator.CreateShared <IHandler>();
			ControlObject = handler.Create(color);
		}
开发者ID:gene-l-thomas,项目名称:Eto,代码行数:5,代码来源:SolidBrush.cs

示例12: Pen

		/// <summary>
		/// Creates a new pen with the specified <paramref name="color"/> and <paramref name="thickness"/>
		/// </summary>
		/// <param name="color">Color for the new pen</param>
		/// <param name="thickness">Thickness of the new pen</param>
		/// <param name="generator">Generator to create the pen for</param>
		public Pen (Color color, float thickness = 1f, Generator generator = null)
		{
			handler = generator.CreateShared<IPen> ();
			ControlObject = handler.Create (color, thickness);
		}
开发者ID:JohnACarruthers,项目名称:Eto,代码行数:11,代码来源:Pen.cs

示例13: Instantiator

		/// <summary>
		/// Gets a delegate that can be used to create instances of the Pen with low overhead
		/// </summary>
		/// <param name="generator">Generator to create the pens</param>
		public Func<Color, float, Pen> Instantiator (Generator generator = null)
		{
			var handler = generator.CreateShared<IPen> ();
			return (color, thickness) => {
				var control = handler.Create (color, thickness);
				return new Pen (handler, control);
			};
		}
开发者ID:JohnACarruthers,项目名称:Eto,代码行数:12,代码来源:Pen.cs

示例14: PrimaryScreen

		public static Screen PrimaryScreen (Generator generator = null)
		{
			var handler = generator.CreateShared <IScreens>();
			return handler.PrimaryScreen;
		}
开发者ID:JohnACarruthers,项目名称:Eto,代码行数:5,代码来源:Screen.cs

示例15: Screens

		public static IEnumerable<Screen> Screens (Generator generator = null)
		{
			var handler = generator.CreateShared <IScreens>();
			return handler.Screens;
		}
开发者ID:JohnACarruthers,项目名称:Eto,代码行数:5,代码来源:Screen.cs


注:本文中的Generator.CreateShared方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。