private void OnNodeAdded(IntPtr param0, IntPtr param1) { try { INotifyInfo obj = Loader.Global.NotifyInfo.Marshal(param1); IINode n = (IINode)obj.CallParam; //todo replace this with something like isXREFNODE //to have a distinction between added xref node and max node string guid = n.GetStringProperty("babylonjs_GUID", string.Empty); if (string.IsNullOrEmpty(guid)) { n.GetGuid(); // force to assigne a new guid if not exist yet for this node } IIContainerObject contaner = Loader.Global.ContainerManagerInterface.IsContainerNode(n); if (contaner != null) { // a generic operation on a container is done (open/inherit) contaner.ResolveContainer(); } } catch { // Fails silently } }
private void OnNodeDeleted(IntPtr Obj, IntPtr Info) { // marshal the info ptr to notify info INotifyInfo notifyInfo = AssemblyFunctions.GlobalInterface.NotifyInfo.Marshal(Info); if (notifyInfo == null) { return; } // check if the params are a list of nodes // ITab is the list handling inside max sdk ITab <IINode> nodes = notifyInfo.CallParam as ITab <IINode>; if (nodes != null) { NodeManager.SceneNodesDeleted(nodes); return; } // check if the params are one iinode IINode node = notifyInfo.CallParam as IINode; if (node != null) { NodeManager.SceneNodeDeleted(node); } }
//internal static Func<Expression<Func<T, bool>>, int, int, List<T>> GetNofityListByGroupFunc = null; ///// <summary> ///// 获取通知列表 ///// </summary> ///// <param name="wherePredicate"></param> ///// <param name="pageIndex"></param> ///// <param name="pageSize"></param> ///// <returns></returns> //public List<T> GetNofityList(Expression<Func<T, bool>> wherePredicate = null, int pageIndex = 0, int pageSize = 10) //{ // if (GetNofityListByGroupFunc == null) // { // throw new NotImplementedException("GetNofityListByGroup尚未实现,请使用NotifyBuilder.WithGetNofityListByGroupFunc实现!"); // } // return GetNofityListByGroupFunc(wherePredicate, pageIndex, pageSize); //} /// <summary> /// 通知 /// </summary> /// <param name="notify"></param> /// <param name="group"></param> public void NotifyTo(INotifyInfo notify, string group = null) { if (group == null) { _context.Clients.All.Notify(notify); } else { _context.Clients.Group(group).Notify(notify); } }
private static void MenuPreSaveHandler(IntPtr objPtr, INotifyInfo infoPtr) { Log.Instance.Debug("*** MenuPreSaveHandler ***"); var menu = GlobalInterface.Instance.COREInterface13.MenuManager.FindMenu(MainMenuName); if (menu != null) { GlobalInterface.Instance.COREInterface13.MenuManager.UnRegisterMenu(menu); GlobalInterface.Instance.ReleaseIMenu(menu); } }
private void PostSceneSave(IntPtr objPtr, INotifyInfo infoPtr) { List <IIContainerObject> sceneContainers = Tools.GetAllContainers(); foreach (var container in sceneContainers) { if (container.IsOpen == false && !container.IsUnique) { bool n = container.LoadContainer; } } }
private void FilePostOpen(IntPtr objPtr, INotifyInfo infoPtr) { List <IIContainerObject> sceneContainers = Tools.GetAllContainers(); foreach (var container in sceneContainers) { if (container.IsUnloaded == true && !container.IsUnique) { bool n = container.LoadContainer; } } }
private void OnNodeDeleted(IntPtr objPtr, INotifyInfo infoPtr) { try { IINode n = (IINode)infoPtr.CallParam; Tools.guids.Remove(n.GetGuid()); } catch { // Fails silently } }
private static void MenuPostSaveHandler(IntPtr objPtr, INotifyInfo infoPtr) { var global = GlobalInterface.Instance; var ip = global.COREInterface13; IIMenuManager manager = ip.MenuManager; IIMenu menu = manager.FindMenu(menuName); if (menu == null) { InstallMenu(); } }
private void ResetScene(IntPtr objPtr, INotifyInfo infoPtr) { List <IIContainerObject> sceneContainers = Tools.GetAllContainers(); foreach (var container in sceneContainers) { if (!container.IsUnique) { bool n = container.UnloadContainer; } } }
private void SystemNotification(IntPtr Obj, IntPtr info) { Timer.Stop(); INotifyInfo notifyInfo = GlobalInterface.Instance.NotifyInfo.Marshal(info); IAnimatable anim = notifyInfo.CallParam as IAnimatable; UIntPtr handle = MaxAnimatable.GetHandleByAnim(anim); if (handle != null) { Handles.Add(handle); } Timer.Start(); }
private void OnNodeDeleted(IntPtr objPtr, IntPtr param1) { try { INotifyInfo obj = Loader.Global.NotifyInfo.Marshal(param1); IINode n = (IINode)obj.CallParam; Tools.guids.Remove(n.GetGuid()); } catch { // Fails silently } }
private void OnNodeAdded(IntPtr objPtr, INotifyInfo infoPtr) { try { IINode n = (IINode)infoPtr.CallParam; n.GetGuid(); // force to assigne a new guid if not exist yet for this node IIContainerObject contaner = Loader.Global.ContainerManagerInterface.IsContainerNode(n); if (contaner != null) { // a generic operation on a container is done (open/inherit) contaner.ResolveContainer(); } } catch { // Fails silently } }
private void OnNodeAdded(IntPtr param0, IntPtr param1) { try { INotifyInfo obj = Loader.Global.NotifyInfo.Marshal(param1); IINode n = (IINode)obj.CallParam; n.GetGuid(); // force to assigne a new guid if not exist yet for this node IIContainerObject contaner = Loader.Global.ContainerManagerInterface.IsContainerNode(n); if (contaner != null) { // a generic operation on a container is done (open/inherit) Tools.guids = new Dictionary <Guid, IAnimatable>(); } } catch { // Fails silently } }
private void OnFilePostOpen(IntPtr param0, INotifyInfo param1) { LoadOptions(); }
private void InitializeBabylonGuids(IntPtr objPtr, INotifyInfo infoPtr) { Tools.guids = new Dictionary <Guid, IAnimatable>(); }
private void MenuSystemStartupHandler(IntPtr objPtr, INotifyInfo infoPtr) { InstallMenus(); AddCallbacks(); }
private void SystemNotification(IntPtr Obj, IntPtr info) { INotifyInfo notifyInfo = GlobalInterface.Instance.NotifyInfo.Marshal(info); this.NotificationRaised(this, new SystemNotificationObjectEventArgs(notifyInfo.CallParam)); }
private static void MenuSystemStartupHandler(IntPtr objPtr, INotifyInfo infoPtr) { Log.Instance.Debug("*** MenuSystemStartupHandler ***"); InstallMenu(MainMenuName); }
public void NotifyTo(INotifyInfo notify, string group = null) { }