SetElementColor() public method

Sets the element color and color string
public SetElementColor ( Color zColor ) : void
zColor Color The color to pull the values from
return void
Esempio n. 1
0
 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);
     }
 }
Esempio n. 2
0
        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);
            }
        }