コード例 #1
0
		public void SetProperty(LayoutPartPropertyName property, object value)
		{
			switch (property)
			{
				case LayoutPartPropertyName.Title:
					Title = value.ToString();
					break;
				case LayoutPartPropertyName.BackgroundColor:
					BackgroundColor = Utils.Cast<Color>(value);
					break;
				case LayoutPartPropertyName.BorderColor:
					BorderColor = Utils.Cast<Color>(value);
					break;
				case LayoutPartPropertyName.BorderThickness:
					BorderThickness = Utils.Cast<int>(value);
					break;
				case LayoutPartPropertyName.Margin:
					Margin = Utils.Cast<int>(value);
					break;
				default:
					if (Content is ILayoutPartControl)
						((ILayoutPartControl)Content).SetProperty(property, value);
					break;
			}
		}
コード例 #2
0
		public object GetProperty(LayoutPartPropertyName property)
		{
			switch (property)
			{
				case LayoutPartPropertyName.Title:
					return Title;
				case LayoutPartPropertyName.BackgroundColor:
					return BackgroundColor;
				case LayoutPartPropertyName.BorderColor:
					return BorderColor;
				case LayoutPartPropertyName.BorderThickness:
					return BorderThickness;
				case LayoutPartPropertyName.Margin:
					return Margin;
				default:
					return Content is ILayoutPartControl ? ((ILayoutPartControl)Content).GetProperty(property) : null;
			}
		}
コード例 #3
0
		public object GetProperty(LayoutPartPropertyName property)
		{
			return property == LayoutPartPropertyName.Text ? Text : null;
		}
コード例 #4
0
		public void SetProperty(LayoutPartPropertyName property, object value)
		{
			if (property == LayoutPartPropertyName.Text)
				Text = value.ToString();
		}
コード例 #5
0
ファイル: LayoutPartProperty.cs プロジェクト: xbadcode/Rubezh
		public LayoutPartProperty(LayoutPartPropertyAccess access, Type type, LayoutPartPropertyName name)
		{
			Access = access;
			Type = type;
			Name = name;
		}