Example #1
0
 void LookupItem()
 {
     if (_self.txtID.Text == _lookupKey)
     {
         return;
     }
     _lookupKey = _self.txtID.Text;
     _self.panelPropertyControl.Controls.Clear();
     try {
         var obj = _storage[int.Parse(_self.txtID.Text)];
         _self.txtValue.Text = obj.ToString();
         foreach (var key in CoreUT.SortInheritanceDAG(obj.GetType()))
         {
             var control = PropertyControlFactory.NewInstance(key);
             if (control != null)
             {
                 control.TargetObject = obj;
                 control.Dock         = DockStyle.Fill;
                 _self.panelPropertyControl.Controls.Add(control);
             }
         }
     }
     catch (Exception) {
         _self.txtID.Focus();
         _self.txtID.SelectAll();
         _self.txtValue.Text = "(none)";
     }
 }
Example #2
0
        Hisui.Geom.Point3d[] GetQuadPoints()
        {
            var radius = _docviews.WorldDocumentScene.BoundingSphere.Radius;
            var points = CoreUT.MakeArray(
                GeomUT.P(radius, radius),
                GeomUT.P(-radius, radius),
                GeomUT.P(-radius, -radius),
                GeomUT.P(radius, -radius));

            return(CoreUT.MakeArray(4, i => _clip.CodSys.Globalize(points[i])));
        }
 public static void RegisterToPluginLoader()
 {
     Core.PluginLoader.TypeLoadEvent += type =>
     {
         var atr = CoreUT.GetPluginAttribute <PropertyControlAttribute>(type);
         if (atr != null)
         {
             Register(atr.SourceType, type);
         }
     };
 }
        public static PropertyControl NewInstance(object target)
        {
            if (target == null)
            {
                return(null);
            }
            var control = CoreUT.SortInheritanceDAG(target.GetType())
                          .Select(type => PropertyControlFactory.NewInstance(type))
                          .WhereNotNull()
                          .FirstOrDefault();

            if (control != null)
            {
                control.TargetObject = target;
            }
            return(control);
        }
Example #5
0
 ViewSetting(Graphics.DocumentViews docviews)
 {
     _docviews = docviews;
     _lights   = CoreUT.MakeArray(4, i => new LightSetting(Graphics.Light.Lights[i]));
 }