本文整理汇总了C#中CardMaker.XML.ProjectLayoutElement.SetElementColor方法的典型用法代码示例。如果您正苦于以下问题:C# ProjectLayoutElement.SetElementColor方法的具体用法?C# ProjectLayoutElement.SetElementColor怎么用?C# ProjectLayoutElement.SetElementColor使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CardMaker.XML.ProjectLayoutElement
的用法示例。
在下文中一共展示了ProjectLayoutElement.SetElementColor方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: SetColorValue
private void SetColorValue(Button btnClicked, Color color, ProjectLayoutElement zElement)
{
if (btnClicked == btnElementBorderColor)
{
zElement.SetElementBorderColor(color);
}
else if (btnClicked == btnElementOutlineColor)
{
zElement.SetElementOutlineColor(color);
}
else if (btnClicked == btnElementFontColor || btnClicked == btnElementShapeColor)
{
zElement.SetElementColor(color);
}
}
示例2: AddElements
private void AddElements(IEnumerable<string> collectionNames, ProjectLayoutElement zBaseElement)
{
// construct a new list of elements
var listElements = new List<ProjectLayoutElement>();
if (null != LayoutManager.Instance.ActiveLayout.Element)
{
listElements.AddRange(LayoutManager.Instance.ActiveLayout.Element);
}
foreach (string sName in collectionNames)
{
string sTrimmed = sName.Trim();
if (m_dictionaryItems.ContainsKey(sTrimmed)) // no duplicates!
{
continue;
}
var zCardElement = new ProjectLayoutElement(sTrimmed);
if (null != zBaseElement)
{
zCardElement.DeepCopy(zBaseElement, true);
}
else
{
zCardElement.lineheight = 14;
zCardElement.SetElementColor(Color.Black);
zCardElement.SetElementFont(new Font("Arial", 12));
}
listElements.Add(zCardElement);
ListViewItem zLvi = CreateListViewItem(zCardElement);
listViewElements.Items.Add(zLvi);
}
var zLayout = LayoutManager.Instance.ActiveLayout;
if (null == zLayout.Element ||
// it is possible nothing was added if all names were duplicates (skip in that case)
zLayout.Element.Length < listElements.Count)
{
// UserAction
SetupLayoutUndo(listElements);
// assign the new list to the actual project layout
LayoutManager.Instance.ActiveLayout.Element = listElements.ToArray();
LayoutManager.Instance.FireLayoutUpdatedEvent(true);
}
}