/// <summary>
 /// Custom page to add
 /// </summary>
 /// <param name="page"></param>
 public void Add(ObjectPropertiesPage page)
 {
     if (page == null)
     {
         throw new ArgumentNullException(nameof(page));
     }
     Pages.Add(page);
 }
示例#2
0
        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);
        }
示例#3
0
        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);
        }
示例#4
0
 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());
 }
示例#5
0
        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);
        }
示例#6
0
 public static IntPtr NewPropertiesPanelPagePointer(ObjectPropertiesPage page, uint rhinoDocRuntimeSn) => RhinoPageHooks.NewIRhinoPropertiesPanelPagePointer(page, rhinoDocRuntimeSn);
 /// <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>
 public ObjectPropertiesPageEventArgs(ObjectPropertiesPage page)
 {
     Page = page;
 }