コード例 #1
0
        public void EhView_PredefinedStyleSelected(int selectedindex)
        {
            if (selectedindex == 0)
            {
                return;
            }

            G2DPlotStyleCollection template = G2DPlotStyleCollectionTemplates.GetTemplate(selectedindex - 1);

            _tempdoc.Clear();
            for (int i = 0; i < template.Count; i++)
            {
                _tempdoc.Add(template[i]);
            }

            UpdateStyleList(new int[0]);
            OnCollectionChangeCommit();
        }
コード例 #2
0
        public void EhView_PredefinedStyleSelected()
        {
            var sel = _predefinedStyleSetsAvailable.FirstSelectedNode;

            if (null == sel)
            {
                return;
            }

            G2DPlotStyleCollection template = G2DPlotStyleCollectionTemplates.GetTemplate((int)sel.Tag, _doc.GetPropertyContext());

            _currentItems.Clear(() => _doc.Clear());
            for (int i = 0; i < template.Count; i++)
            {
                var listNode = new SelectableListNode(Current.Gui.GetUserFriendlyClassName(template[i].GetType()), template[i], false);
                _currentItems.Add <IG2DPlotStyle>(listNode, (docNode) => _doc.Add(docNode));
            }

            OnCollectionChangeCommit();
        }