Пример #1
0
            public Entry(INodeMask mask, IGraphPresentation presentation)
            {
                Contract.RequiresNotNull(mask, "mask");
                Contract.RequiresNotNull(presentation, "presentation");

                Mask           = mask;
                myPresentation = presentation;

                SetToolTip(mask);
            }
            public Entry( INodeMask mask, IGraphPresentation presentation )
            {
                Contract.RequiresNotNull( mask, "mask" );
                Contract.RequiresNotNull( presentation, "presentation" );

                Mask = mask;
                myPresentation = presentation;

                SetToolTip( mask );
            }
            private void SetToolTip( INodeMask mask )
            {
                var nodeMask = mask as NodeMask;
                if ( nodeMask == null )
                {
                    return;
                }

                var captionModule = myPresentation.GetPropertySetFor<Caption>();

                var nodeLabels = nodeMask.Values
                    .Select( nodeId => captionModule.Get( nodeId ).DisplayText )
                    .OrderBy( l => l )
                    .ToList();

                ToolTip = string.Join( Environment.NewLine, nodeLabels );
            }
Пример #4
0
            private void SetToolTip(INodeMask mask)
            {
                var nodeMask = mask as NodeMask;

                if (nodeMask == null)
                {
                    return;
                }

                var captionModule = myPresentation.GetPropertySetFor <Caption>();

                var nodeLabels = nodeMask.Values
                                 .Select(nodeId => captionModule.Get(nodeId).DisplayText)
                                 .OrderBy(l => l)
                                 .ToList();

                ToolTip = string.Join(Environment.NewLine, nodeLabels);
            }
Пример #5
0
        private void WriteNodeMask(INodeMask mask)
        {
            myWriter.Write(mask.Label ?? string.Empty);
            myWriter.Write(mask.IsApplied);
            myWriter.Write(mask.IsShowMask);

            if (mask is NodeMask nodeMask)
            {
                myWriter.Write("NodeMask");
                myWriter.Write(nodeMask.Values.Count());
                foreach (var value in nodeMask.Values)
                {
                    myWriter.Write(value);
                }
            }
            else
            {
                throw new NotSupportedException("Unknown mask type: " + mask.GetType());
            }
        }