예제 #1
0
        private void protectionCheckBox_CheckStateChanged(object sender, EventArgs e)
        {
            if (EventsHandlingPaused)
            {
                return;
            }

            // get the selected element
            NDiagramElement element = (view.Selection.AnchorNode as NDiagramElement);

            if (element == null)
            {
                return;
            }

            PauseEventsHandling();

            // update the element protection
            NAbilities protection = element.Protection;

            protection.Copy   = copyCheckBox.Checked;
            protection.Delete = deleteCheckBox.Checked;
            protection.Select = selectCheckBox.Checked;

            element.Protection = protection;

            document.SmartRefreshAllViews();
            ResumeEventsHandling();
        }
예제 #2
0
            public override bool OnPolygonCreated(NDiagramElement element, NMapFeature mapFeature)
            {
                NShape shape = element as NShape;

                if (shape != null)
                {
                    NInteractivityStyle iStyle = new NInteractivityStyle(true, null, mapFeature.GetAttributeValue(m_sTooltipColumnName).ToString());
                    NStyle.SetInteractivityStyle(shape, iStyle);
                }

                return(base.OnPolygonCreated(element, mapFeature));
            }
예제 #3
0
        private void UpdateFromSelectedNode()
        {
            // get the selected element
            NDiagramElement element = (view.Selection.AnchorNode as NDiagramElement);

            if (element == null)
            {
                return;
            }

            // update the protection checks
            NAbilities protection = element.Protection;

            copyCheckBox.Checked   = protection.Copy;
            deleteCheckBox.Checked = protection.Delete;
            selectCheckBox.Checked = protection.Select;
        }
예제 #4
0
            public override bool OnPolygonCreated(NDiagramElement element, NMapFeature mapFeature)
            {
                NShape shape = element as NShape;

                if (shape == null)
                {
                    return(true);
                }

                string name = mapFeature.GetAttributeValue("CNTRY_NAME").ToString();

                decimal             sales = (decimal)mapFeature.GetAttributeValue("Sales");
                NInteractivityStyle interactivityStyle = new NInteractivityStyle(String.Format("Sales value in {0}: {1:N0} million dollars", name, sales));

                shape.Style.InteractivityStyle = interactivityStyle;

                return(true);
            }
예제 #5
0
            public override bool OnPolygonCreated(NDiagramElement element, NMapFeature mapFeature)
            {
                NShape shape = element as NShape;

                if (shape == null)
                {
                    return(true);
                }

                string name       = mapFeature.GetAttributeValue("CNTRY_NAME").ToString();
                int    population = Int32.Parse(mapFeature.GetAttributeValue("POP_CNTRY").ToString());

                NInteractivityStyle interactivityStyle = new NInteractivityStyle(String.Format("{0}'{1} population: {2:N0}", name,
                                                                                               name.EndsWith("s") ? String.Empty : "s", population));

                NStyle.SetInteractivityStyle(shape, interactivityStyle);

                return(true);
            }
예제 #6
0
            public override bool OnPolygonCreated(NDiagramElement element, NMapFeature mapFeature)
            {
                NShape shape = element as NShape;

                if (shape == null)
                {
                    return(true);
                }

                string name       = mapFeature.GetAttributeValue("CNTRY_NAME").ToString();
                float  population = Single.Parse(mapFeature.GetAttributeValue("POP_CNTRY").ToString());
                float  landArea   = Single.Parse(mapFeature.GetAttributeValue("SQKM").ToString());

                // add a tooltip to the shape
                NInteractivityStyle interactivityStyle = new NInteractivityStyle(
                    string.Format("{1}{0}======================{0}Land Area: {2:N} km2{0}Population: {3:N0} people{0}Pop. Density: {4:N} people/km2",
                                  Environment.NewLine, name, landArea, population, population / landArea));

                shape.Style.InteractivityStyle = interactivityStyle;
                return(true);
            }
예제 #7
0
 public override bool OnMultiPolygonCreated(NDiagramElement element, NMapFeature mapFeature)
 {
     return(OnPolygonCreated(element, mapFeature));
 }