Esempio n. 1
0
        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
            }
        }
Esempio n. 2
0
        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);
            }
        }
Esempio n. 3
0
        //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);
            }
        }
Esempio n. 5
0
        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;
                }
            }
        }
Esempio n. 6
0
        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;
                }
            }
        }
Esempio n. 7
0
 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();
            }
        }
Esempio n. 9
0
        private void ResetScene(IntPtr objPtr, INotifyInfo infoPtr)
        {
            List <IIContainerObject> sceneContainers = Tools.GetAllContainers();

            foreach (var container in sceneContainers)
            {
                if (!container.IsUnique)
                {
                    bool n = container.UnloadContainer;
                }
            }
        }
Esempio n. 10
0
        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();
        }
Esempio n. 11
0
        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
            }
        }
Esempio n. 12
0
        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
            }
        }
Esempio n. 13
0
        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
            }
        }
Esempio n. 14
0
 private void OnFilePostOpen(IntPtr param0, INotifyInfo param1)
 {
     LoadOptions();
 }
Esempio n. 15
0
 private void InitializeBabylonGuids(IntPtr objPtr, INotifyInfo infoPtr)
 {
     Tools.guids = new Dictionary <Guid, IAnimatable>();
 }
Esempio n. 16
0
 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);
 }
Esempio n. 19
0
 public void NotifyTo(INotifyInfo notify, string group = null)
 {
 }