示例#1
0
 /// <summary>
 /// Custom page to add
 /// </summary>
 /// <param name="page"></param>
 /// <since>7.0</since>
 public void Add(ObjectPropertiesPage page)
 {
     if (page == null)
     {
         throw new ArgumentNullException(nameof(page));
     }
     Pages.Add(page);
 }
        public static IntPtr NewIRhinoPropertiesPanelPagePointer(ObjectPropertiesPage page, uint rhinoDocRuntimeSn)
        {
            SetIRhinoPropertiesPanelHooks();
            var id      = Guid.Empty;
            var pointer = UnsafeNativeMethods.IRhinoPropertiesPanelPage_New(rhinoDocRuntimeSn, page?.GetType().FullName, ref id);

            if (pointer != IntPtr.Zero)
            {
                g_irhino_page_dictionary.Add(id, new RhinoPageInsnce(page, pointer, null, rhinoDocRuntimeSn));
            }
            return(pointer);
        }
        public static void ObjectPropertiesModifyPage(ObjectPropertiesPage page, Action <ObjectPropertiesPageEventArgs> callbackAction)
        {
            var pointer = UnmanagedIRhinoPagePointerFromPage(page);

            if (pointer == IntPtr.Zero)
            {
                return;
            }
            g_modify_properties_page_action[page] = callbackAction;
            UnsafeNativeMethods.IRhinoPropertiesPanelPageHost_ModifyPage(pointer);
            g_modify_properties_page_action.Remove(page);
        }
 public static IntPtr UnmanagedIRhinoPagePointerFromPage(ObjectPropertiesPage page)
 {
     return(page == null ? IntPtr.Zero : (from item in g_irhino_page_dictionary where item.Value.PageObject == page select item.Value.IRhinoPagePointer).FirstOrDefault());
 }
        internal static IntPtr AddNewIPropertiesPanelPageToCollection(IntPtr collection, uint documentRuntimeSerialNumber, ObjectPropertiesPage page)
        {
            var pointer = NewIRhinoPropertiesPanelPagePointer(page, documentRuntimeSerialNumber);

            if (pointer != IntPtr.Zero)
            {
                UnsafeNativeMethods.CRhinoPropertiesPanelPageCollection_Add(collection, pointer);
            }
            return(pointer);
        }
 public static IntPtr NewPropertiesPanelPagePointer(ObjectPropertiesPage page, uint rhinoDocRuntimeSn) => RhinoPageHooks.NewIRhinoPropertiesPanelPagePointer(page, rhinoDocRuntimeSn);
示例#7
0
 /// <summary>
 /// Used by <see cref="ObjectPropertiesPage"/> to notify the page when
 /// updating, modifying or determining if the page should be included
 /// in the navigation bar
 /// </summary>
 /// <param name="page">
 /// Page sending the message
 /// </param>
 /// <since>6.0</since>
 public ObjectPropertiesPageEventArgs(ObjectPropertiesPage page)
 {
     Page = page;
 }