Exemplo n.º 1
0
        /// <summary>
        /// Dispose method.  Inheritors should override this method to do any additional cleanup.
        /// </summary>
        protected override void Dispose(bool disposing)
        {
            base.Dispose(disposing);

            if (disposing)
            {
                if (_pen != null)
                {
                    _pen.Dispose();
                    _pen = null;
                }

                if (_brush != null)
                {
                    _brush.Dispose();
                    _brush = null;
                }

                if (_gdiObjectFactory != null)
                {
                    _gdiObjectFactory.Dispose();
                    _gdiObjectFactory = null;
                }
            }
        }
Exemplo n.º 2
0
        /// <summary>
        /// Default constructor.
        /// </summary>
        public GdiRenderer()
        {
            _pen   = new Pen(Color.White);
            _brush = new SolidBrush(Color.Black);

            _gdiObjectFactory = new UnifiedFactory(new GdiObjectFactory());
        }
        /// <summary>
        ///   指定した要素列を格納する要素集合を作成します.
        /// </summary>
        /// <returns> 生成した要素集合 </returns>
        public static TSelf Create(IEnumerable <TElement> elements)
        {
            var ret = UnifiedFactory <TSelf> .Create();

            if (elements != null)
            {
                ret.AddRange(elements);
            }
            return(ret);
        }
Exemplo n.º 4
0
        public static TSelf Create(
            UnifiedBlock body = null,
            UnifiedSet <UnifiedAnnotation> annotations             = null,
            UnifiedSet <UnifiedModifier> modifiers                 = null,
            UnifiedSet <UnifiedParameter> parameters               = null,
            UnifiedSet <UnifiedGenericParameter> genericParameters = null,
            UnifiedSet <UnifiedType> throws = null)
        {
            var ret = UnifiedFactory <TSelf> .Create();

            ret.Body              = body;
            ret.Annotations       = annotations;
            ret.Modifiers         = modifiers;
            ret.Parameters        = parameters;
            ret.GenericParameters = genericParameters;
            ret.Throws            = throws;
            return(ret);
        }
Exemplo n.º 5
0
        public static T Create(
            UnifiedSet <UnifiedAnnotation> annotations = null,
            UnifiedSet <UnifiedModifier> modifiers     = null,
            UnifiedExpression name = null,
            UnifiedSet <UnifiedGenericParameter> genericParameters = null,
            UnifiedSet <UnifiedTypeConstrain> constrains           = null,
            UnifiedBlock body = null)
        {
            var ret = UnifiedFactory <T> .Create();

            ret.Annotations       = annotations;
            ret.Modifiers         = modifiers;
            ret.Name              = name;
            ret.GenericParameters = genericParameters;
            ret.Constrains        = constrains;
            ret.Body              = body;
            return(ret);
        }
Exemplo n.º 6
0
		/// <summary>
		/// Dispose method.  Inheritors should override this method to do any additional cleanup.
		/// </summary>
		protected override void Dispose(bool disposing)
		{
			base.Dispose(disposing);

			if (disposing)
			{
				if (_pen != null)
				{
					_pen.Dispose();
					_pen = null;
				}

                if (_brush != null)
                {
                    _brush.Dispose();
                    _brush = null;
                }

				if (_gdiObjectFactory != null)
				{
                    _gdiObjectFactory.Dispose();
                    _gdiObjectFactory = null;
				}
			}
		}
Exemplo n.º 7
0
		/// <summary>
		/// Default constructor.
		/// </summary>
		public GdiRenderer()
		{
			_pen = new Pen(Color.White);
            _brush = new SolidBrush(Color.Black);

		    _gdiObjectFactory = new UnifiedFactory(new GdiObjectFactory());
		}
 /// <summary>
 ///   空の要素集合を生成します.
 /// </summary>
 /// <returns> 生成した要素集合 </returns>
 public static TSelf Create()
 {
     return(UnifiedFactory <TSelf> .Create());
 }