/// <summary>
        /// Singleton instance
        /// </summary>
        public static BreakLineOsnapOverrule Instance()
        {
            if (_breakLineOsnapOverrule != null)
            {
                return(_breakLineOsnapOverrule);
            }

            _breakLineOsnapOverrule = new BreakLineOsnapOverrule();

            // Фильтр "отлова" примитива по расширенным данным. Работает лучше, чем проверка вручную!
            _breakLineOsnapOverrule.SetXDataFilter(BreakLine.GetDescriptor().Name);
            return(_breakLineOsnapOverrule);
        }
예제 #2
0
        /// <summary>
        /// Панель "Линии"
        /// </summary>
        private static void AddLinesPanel(RibbonTab ribbonTab)
        {
            // create the panel source
            var ribSourcePanel = new RibbonPanelSource {
                Title = Language.GetItem("tab1")
            };

            // now the panel
            var ribPanel = new RibbonPanel {
                Source = ribSourcePanel
            };

            ribbonTab.Panels.Add(ribPanel);

            var ribRowPanel = new RibbonRowPanel();

            // mpBreakLine
            ribRowPanel.Items.Add(GetBigSplitButton(BreakLine.GetDescriptor()));

            // mpWeldJoint
            ribRowPanel.Items.Add(GetBigSplitButton(WeldJoint.GetDescriptor()));

            if (ribRowPanel.Items.Any())
            {
                ribSourcePanel.Items.Add(ribRowPanel);
            }

            ribRowPanel = new RibbonRowPanel();

            // mpGroundLine
            ribRowPanel.Items.Add(GetSmallSplitButton(GroundLine.GetDescriptor()));

            ribRowPanel.Items.Add(new RibbonRowBreak());

            // mpWaterProofing
            ribRowPanel.Items.Add(GetSmallSplitButton(WaterProofing.GetDescriptor()));

            if (ribRowPanel.Items.Any())
            {
                ribSourcePanel.Items.Add(ribRowPanel);
            }
        }
 /// <inheritdoc />
 public override bool IsApplicable(RXObject overruledSubject)
 {
     return(ExtendedDataUtils.IsApplicable(overruledSubject, BreakLine.GetDescriptor().Name));
 }