Exemplo n.º 1
0
            public static object GetPanel(Guid panelId, uint documentSerialNumber)
            {
                // This won't be necessary Mac Rhino is ported to use the generic panel
                // interfaces
                var value = PanelSystem.Instance(panelId, documentSerialNumber, Guid.Empty);

                return(value?.PanelObject);
            }
Exemplo n.º 2
0
            /// <summary>
            /// Gets the panels.
            /// </summary>
            /// <returns>The panels.</returns>
            /// <param name="panelId">Panel identifier.</param>
            /// <param name="doc">Document.</param>
            /// <since>6.3</since>
            public static object [] GetPanels(Guid panelId, RhinoDoc doc)
            {
                if (doc == null)
                {
                    return(new object [0]);
                }
                var def       = PanelSystem.Definition(panelId);
                var container = def?.Containers(doc.RuntimeSerialNumber);

                if (container == null)
                {
                    return(new object[0]);
                }
                var list = new System.Collections.Generic.List <object>();

                foreach (var instance in container.Instances)
                {
                    list.Add(instance.PanelObject);
                }
                return(list.ToArray());
            }
Exemplo n.º 3
0
 /// <summary>
 /// Update the icon used for a panel tab.
 /// </summary>
 /// <param name="panelType"></param>
 /// <param name="icon">New icon to use</param>
 /// <since>6.0</since>
 public static void ChangePanelIcon(Type panelType, System.Drawing.Icon icon)
 {
     PanelSystem.ChangePanelIcon(panelType, icon);
 }
Exemplo n.º 4
0
            public static object GetPanel(Guid panelId)
            {
                var doc = RhinoDoc.ActiveDoc;

                return(doc == null ? null : PanelSystem.Instance(panelId, doc.RuntimeSerialNumber, Guid.Empty)?.PanelObject);
            }
Exemplo n.º 5
0
 /// <summary>
 /// Call once to register a panel type which will get dynamically created
 /// and embedded in a Rhino docking/floating location.
 /// </summary>
 /// <param name="plugIn">
 /// Plug-in restringing the panel
 /// </param>
 /// <param name="type">
 /// Type of the control object to be displayed in the panel
 /// </param>
 /// <param name="caption">
 /// Panel caption also used as a tool-tip.  On Windows the panel may be
 /// displayed using the icon, caption or both.  On Mac the icon will be
 /// used and the caption will be the tool-tip.
 /// </param>
 /// <param name="icon">
 /// The panel icon.  On Windows the panel may be displayed using the icon,
 /// caption or both.  On Mac the icon will be used and the caption will be
 /// the tool-tip.
 /// </param>
 /// <param name="panelType">
 /// See <see cref="PanelType"/>
 /// </param>
 /// <since>6.1</since>
 public static void RegisterPanel(PlugIns.PlugIn plugIn, Type type, string caption, System.Drawing.Icon icon, PanelType panelType)
 {
     PanelSystem.Register(plugIn, type, caption, icon, panelType);
 }