Example #1
0
 void RefreshDistances()
 {   // wird aufgerufen, wenn sich die Anzahl geändert hat
     // alle Längen werden gleich vorbesetzt.
     if (sections.Count < number)
     {   // nur verlängern, nicht kürzen
         for (int i = sections.Count; i < number; ++i)
         {
             sections.Add(0.0);
         }
     }
     for (int i = 0; i < sections.Count; ++i)
     {
         sections[i] = 1.0 / (double)number;
     }
     // die Untereinträge mit den Längen werden erzeugt
     DoubleProperty[] doubleproperties = new DoubleProperty[number];
     for (int i = 0; i < number; ++i)
     {
         DoubleProperty doubleProperty = new DoubleProperty("Constr.SplitCurve.Distance", Frame);
         doubleProperty.LabelText = StringTable.GetFormattedString("Constr.SplitCurve.Distance" + ".Label", i + 1);
         doubleProperty.UserData.Add("Index", i);
         doubleProperty.GetDoubleEvent += new DoubleProperty.GetDoubleDelegate(OnGetDistance);
         doubleProperty.SetDoubleEvent += new DoubleProperty.SetDoubleDelegate(OnSetDistance);
         doubleproperties[i]            = doubleProperty;
     }
     distances.SetShowProperties(doubleproperties);
     for (int i = 0; i < number; ++i)
     {
         DoubleProperty doubleProperty = doubleproperties[i] as DoubleProperty;
         doubleProperty.Refresh();
     }
 }
Example #2
0
 /// <summary>
 /// Displays a massage telling the user that the item is still in use
 /// and asks the user whether the item should be removed anyway.
 /// </summary>
 public virtual void ItemIsUsed()
 {
     if (DialogResult.No == FrameImpl.MainFrame.UIService.ShowMessageBox(StringTable.GetFormattedString(ResourceID + ".ItemIsUsed", Name), StringTable.GetString(ResourceID + ".Label"), MessageBoxButtons.YesNo))
     {
         Refuse = true;
     }
 }
Example #3
0
        public void Connect(Layout layout, Project project, LayoutView layoutView)
        {   // das kommt dran, sobald der layoutview in der Liste im Treeview steht
            this.layout     = layout;
            this.project    = project;
            this.layoutView = layoutView;
            if (name == null)
            {
                int  j           = 1;
                bool invalidName = true;
                while (invalidName)
                {
                    invalidName = false;
                    string newname = StringTable.GetFormattedString("Layout.Patch.Label", j);
                    for (int i = 0; i < layout.Patches.Length; ++i)
                    {
                        if (layout.Patches[i].name == newname)
                        {
                            invalidName = true;
                            ++j;
                        }
                    }
                    name = newname;
                }
            }
            base.LabelText = name;
            if (Area == null)
            {
                section = new BoundingRect(0.0, 0.0, layout.PaperWidth, layout.PaperHeight);
                Area    = Border.MakeRectangle(section);
            }
            else
            {
                section = Area.Extent;
            }
            base.resourceId = "Layout.Patch";
            project.LayerList.DidModifyEvent += new DidModifyDelegate(OnLayerListModifed);

            model.GeoObjectAddedEvent         += new Model.GeoObjectAdded(OnModelChanged);
            model.GeoObjectRemovedEvent       += new Model.GeoObjectRemoved(OnModelChanged);
            model.GeoObjectDidChangeEvent     += new CADability.GeoObject.ChangeDelegate(OnModelChanged);
            Projection.ProjectionChangedEvent += new Projection.ProjectionChangedDelegate(OnProjectionChanged);
        }
Example #4
0
        private void AddModel()
        {
            Model  m    = new Model();
            int    ind  = 1;
            string name = StringTable.GetFormattedString("Model.Default.Name", ind);

            while (project.FindModel(name) != null)
            {
                ++ind;
                name = StringTable.GetFormattedString("Model.Default.Name", ind);
            }
            m.Name = name;
            project.AddModel(m);
            subEntries = null;
            if (propertyTreeView != null)
            {
                propertyTreeView.Refresh(this);
                propertyTreeView.OpenSubEntries(this, true);
            }
        }