当前位置: 首页>>代码示例>>C#>>正文


C# Scenes.UndoState类代码示例

本文整理汇总了C#中OpenSim.Region.Framework.Scenes.UndoState的典型用法代码示例。如果您正苦于以下问题:C# UndoState类的具体用法?C# UndoState怎么用?C# UndoState使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


UndoState类属于OpenSim.Region.Framework.Scenes命名空间,在下文中一共展示了UndoState类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: StoreUndoState

        public void StoreUndoState(bool forGroup)
        {
            if (!Undoing)
            {
                if (!IgnoreUndoUpdate)
                {
                    if (ParentGroup != null)
                    {
                        lock (m_undo)
                        {
                            if (m_undo.Count > 0)
                            {
                                UndoState last = m_undo.Peek();
                                if (last != null)
                                {
                                    // TODO: May need to fix for group comparison
                                    if (last.Compare(this))
                                    {
    //                                        m_log.DebugFormat(
    //                                            "[SCENE OBJECT PART]: Not storing undo for {0} {1} since current state is same as last undo state, initial stack size {2}",
    //                                            Name, LocalId, m_undo.Count);
    
                                        return;
                                    }
                                }
                            }
    
    //                            m_log.DebugFormat(
    //                                "[SCENE OBJECT PART]: Storing undo state for {0} {1}, forGroup {2}, initial stack size {3}",
    //                                Name, LocalId, forGroup, m_undo.Count);
    
                            if (ParentGroup.GetSceneMaxUndo() > 0)
                            {
                                UndoState nUndo = new UndoState(this, forGroup);
    
                                m_undo.Push(nUndo);
    
                                if (m_redo.Count > 0)
                                    m_redo.Clear();
    
    //                                m_log.DebugFormat(
    //                                    "[SCENE OBJECT PART]: Stored undo state for {0} {1}, forGroup {2}, stack size now {3}",
    //                                    Name, LocalId, forGroup, m_undo.Count);
                            }
                        }
                    }
                }
//                else
//                {
//                    m_log.DebugFormat("[SCENE OBJECT PART]: Ignoring undo store for {0} {1}", Name, LocalId);
//                }
            }
//            else
//            {
//                m_log.DebugFormat(
//                    "[SCENE OBJECT PART]: Ignoring undo store for {0} {1} since already undoing", Name, LocalId);
//            }
        }
开发者ID:justasabc,项目名称:opensim,代码行数:58,代码来源:SceneObjectPart.cs

示例2: Redo

        public void Redo()
        {
            lock (m_undo)
            {
//                m_log.DebugFormat(
//                    "[SCENE OBJECT PART]: Handling redo request for {0} {1}, stack size {2}",
//                    Name, LocalId, m_redo.Count);

                if (m_redo.Count > 0)
                {
                    UndoState gofwd = m_redo.Pop();
    
                    if (gofwd != null)
                    {
                        if (ParentGroup.GetSceneMaxUndo() > 0)
                        {
                            UndoState nUndo = new UndoState(this, gofwd.ForGroup);
    
                            m_undo.Push(nUndo);
                        }
    
                        gofwd.PlayfwdState(this);
                    }

//                m_log.DebugFormat(
//                    "[SCENE OBJECT PART]: Handled redo request for {0} {1}, stack size now {2}",
//                    Name, LocalId, m_redo.Count);
                }
            }
        }
开发者ID:justasabc,项目名称:opensim,代码行数:30,代码来源:SceneObjectPart.cs

示例3: Redo

        public void Redo()
        {
            lock (m_redo)
            {
                if (m_redo.Count > 0)
                {
                    UndoState nUndo = new UndoState(this);
                    m_undo.Push(nUndo);

                    UndoState gofwd = m_redo.Pop();
                    if (gofwd != null)
                        gofwd.PlayfwdState(this);
                }
            }
        }
开发者ID:KristenMynx,项目名称:Aurora-Sim,代码行数:15,代码来源:SceneObjectPart.cs

示例4: StoreUndoState

        public void StoreUndoState()
        {
            if (!Undoing)
            {
                if (m_parentGroup != null)
                {
                    lock (m_undo)
                    {
                        if (m_undo.Count > 0)
                        {
                            UndoState last = m_undo.Peek();
                            if (last != null)
                            {
                                if (last.Compare(this))
                                    return;
                            }
                        }

                        if (m_parentGroup.GetSceneMaxUndo() > 0)
                        {
                            UndoState nUndo = new UndoState(this);

                            m_undo.Push(nUndo);
                        }

                    }
                }
            }
        }
开发者ID:intari,项目名称:OpenSimMirror,代码行数:29,代码来源:SceneObjectPart.cs

示例5: Redo

        public void Redo()
        {
            lock (m_undo)
            {
//                m_log.DebugFormat(
//                    "[SCENE OBJECT PART]: Handling redo request for {0} {1}, stack size {2}",
//                    Name, LocalId, m_redo.Count);

                if (m_redo.Count > 0)
                {
                    UndoState gofwd = m_redo[m_redo.Count - 1];
                    m_redo.RemoveAt(m_redo.Count - 1);

                    if (ParentGroup.Scene.MaxUndoCount > 0)
                    {
                        UndoState nUndo = new UndoState(this, gofwd.ForGroup);

                        m_undo.Add(nUndo);

                        if (m_undo.Count > ParentGroup.Scene.MaxUndoCount)
                            m_undo.RemoveAt(0);
                    }

                    gofwd.PlayfwdState(this);

//                m_log.DebugFormat(
//                    "[SCENE OBJECT PART]: Handled redo request for {0} {1}, stack size now {2}",
//                    Name, LocalId, m_redo.Count);
                }
            }
        }
开发者ID:VirTecIO,项目名称:opensim,代码行数:31,代码来源:SceneObjectPart.cs

示例6: StoreUndoState

        public void StoreUndoState()
        {
            if (!Undoing)
            {
                if (!IgnoreUndoUpdate)
                {
                    IBackupModule backup = null;
                    if(ParentGroup != null && 
                        ParentGroup.Scene != null)
                        backup = ParentGroup.Scene.RequestModuleInterface<IBackupModule>();

                    if (m_parentGroup != null && 
                        ParentGroup.Scene != null &&
                        (backup == null || (backup != null && !backup.LoadingPrims)))
                    {
                        lock (m_undo)
                        {
                            if (m_undo.Count > 0)
                            {
                                UndoState last = m_undo.Peek();
                                if (last != null)
                                {
                                    if (last.Compare(this))
                                        return;
                                }
                            }

                            UndoState nUndo = new UndoState(this);
                            m_undo.Push(nUndo);
                        }
                    }
                }
            }
        }
开发者ID:KristenMynx,项目名称:Aurora-Sim,代码行数:34,代码来源:SceneObjectPart.cs

示例7: Undo

        public void Undo()
        {
            lock (m_undo)
            {
//                m_log.DebugFormat(
//                    "[SCENE OBJECT PART]: Handling undo request for {0} {1}, stack size {2}",
//                    Name, LocalId, m_undo.Count);

                if (m_undo.Count > 0)
                {
                    UndoState goback = m_undo.Pop();

                    if (goback != null)
                    {
                        UndoState nUndo = null;
        
                        if (m_parentGroup.GetSceneMaxUndo() > 0)
                        {
                            nUndo = new UndoState(this, goback.ForGroup);
                        }

                        goback.PlaybackState(this);

                        if (nUndo != null)
                            m_redo.Push(nUndo);
                    }
                }

//                m_log.DebugFormat(
//                    "[SCENE OBJECT PART]: Handled undo request for {0} {1}, stack size now {2}",
//                    Name, LocalId, m_undo.Count);
            }
        }
开发者ID:HGExchange,项目名称:opensim,代码行数:33,代码来源:SceneObjectPart.cs

示例8: StoreUndoState

        public void StoreUndoState(bool forGroup)
        {
            if (ParentGroup == null || ParentGroup.Scene == null)
                return;

            if (Undoing)
            {
//                m_log.DebugFormat(
//                    "[SCENE OBJECT PART]: Ignoring undo store for {0} {1} since already undoing", Name, LocalId);
                return;
            }

            if (IgnoreUndoUpdate)
            {
//                    m_log.DebugFormat("[SCENE OBJECT PART]: Ignoring undo store for {0} {1}", Name, LocalId);
                return;
            }

            lock (m_undo)
            {
                if (m_undo.Count > 0)
                {
                    UndoState last = m_undo[m_undo.Count - 1];
                    if (last != null)
                    {
                        // TODO: May need to fix for group comparison
                        if (last.Compare(this))
                        {
//                                        m_log.DebugFormat(
//                                            "[SCENE OBJECT PART]: Not storing undo for {0} {1} since current state is same as last undo state, initial stack size {2}",
//                                            Name, LocalId, m_undo.Count);

                            return;
                        }
                    }
                }

//                                m_log.DebugFormat(
//                                    "[SCENE OBJECT PART]: Storing undo state for {0} {1}, forGroup {2}, initial stack size {3}",
//                                    Name, LocalId, forGroup, m_undo.Count);

                if (ParentGroup.Scene.MaxUndoCount > 0)
                {
                    UndoState nUndo = new UndoState(this, forGroup);

                    m_undo.Add(nUndo);

                    if (m_undo.Count > ParentGroup.Scene.MaxUndoCount)
                        m_undo.RemoveAt(0);

                    if (m_redo.Count > 0)
                        m_redo.Clear();

//                                    m_log.DebugFormat(
//                                        "[SCENE OBJECT PART]: Stored undo state for {0} {1}, forGroup {2}, stack size now {3}",
//                                        Name, LocalId, forGroup, m_undo.Count);
                }
            }
        }
开发者ID:VirTecIO,项目名称:opensim,代码行数:59,代码来源:SceneObjectPart.cs

示例9: Undo

 public void Undo()
 {
     lock (m_undo)
     {
         if (m_undo.Count > 0)
         {
             UndoState nUndo = null;
             if (m_parentGroup.GetSceneMaxUndo() > 0)
             {
                 nUndo = new UndoState(this);
             }
             UndoState goback = m_undo.Pop();
             if (goback != null)
             {
                 goback.PlaybackState(this);
                 if (nUndo != null)
                     m_redo.Push(nUndo);
             }
         }
     }
 }
开发者ID:BackupTheBerlios,项目名称:seleon,代码行数:21,代码来源:SceneObjectPart.cs

示例10: Redo

        public void Redo()
        {
            lock (m_redo)
            {
                if (m_parentGroup.GetSceneMaxUndo() > 0)
                {
                    UndoState nUndo = new UndoState(this);

                    m_undo.Push(nUndo);
                }
                UndoState gofwd = m_redo.Pop();
                if (gofwd != null)
                    gofwd.PlayfwdState(this);
            }
        }
开发者ID:BackupTheBerlios,项目名称:seleon,代码行数:15,代码来源:SceneObjectPart.cs

示例11: Redo

        /// <summary>
        /// executes last state redo to part or its group
        /// current state is pushed into undo
        /// </summary>
        /// <param name="part"></param>

        public void Redo(SceneObjectPart part)
        {
            lock (m_undo)
            {
                UndoState nUndo;

                // expire undo
                if (m_undo.Count > 0)
                {
                    nUndo = m_undo.First.Value;
                    if (nUndo != null && nUndo.checkExpire())
                        m_undo.Clear();
                }

                if (m_redo.Count > 0)
                {
                    UndoState gofwd = m_redo.First.Value;
                    // check expired
                    if (gofwd != null && gofwd.checkExpire())
                    {
                        m_redo.Clear();
                        return;
                    }

                    if (gofwd != null)
                    {
                        m_redo.RemoveFirst();

                        // limite undo size
                        while (m_undo.Count >= size)
                            m_undo.RemoveLast();

                        nUndo = new UndoState(part, gofwd.data.change);   // new value in part should it be full gofwd copy?
                        m_undo.AddFirst(nUndo);

                        gofwd.PlayState(part);
                    }
                }
            }
        }
开发者ID:CassieEllen,项目名称:opensim,代码行数:46,代码来源:UndoState.cs

示例12: StoreUndo

        /// <summary>
        /// adds a new state undo to part or its group, with changes indicated by what bits
        /// </summary>
        /// <param name="part"></param>
        /// <param name="change">bit field with what is changed</param>

        public void StoreUndo(SceneObjectPart part, ObjectChangeType change)
        {
            lock (m_undo)
            {
                UndoState last;

                if (m_redo.Count > 0) // last code seems to clear redo on every new undo
                {
                    m_redo.Clear();
                }

                if (m_undo.Count > 0)
                {
                    // check expired entry
                    last = m_undo.First.Value;
                    if (last != null && last.checkExpire())
                        m_undo.Clear();
                    else
                    {
                        // see if we actually have a change
                        if (last != null)
                        {
                            if (last.Compare(part, change))
                                return;
                        }
                    }
                }

                // limite size
                while (m_undo.Count >= size)
                    m_undo.RemoveLast();

                UndoState nUndo = new UndoState(part, change);
                m_undo.AddFirst(nUndo);
            }
        }
开发者ID:CassieEllen,项目名称:opensim,代码行数:42,代码来源:UndoState.cs

示例13: Redo

        public void Redo()
        {
//            m_log.DebugFormat("[SCENE OBJECT PART]: Handling redo request for {0} {1}", Name, LocalId);

            lock (m_redo)
            {
                if (m_parentGroup.GetSceneMaxUndo() > 0)
                {
                    UndoState nUndo = new UndoState(this);

                    m_undo.Push(nUndo);
                }

                UndoState gofwd = m_redo.Pop();

                if (gofwd != null)
                    gofwd.PlayfwdState(this);
            }
        }
开发者ID:caocao,项目名称:diva-distribution,代码行数:19,代码来源:SceneObjectPart.cs

示例14: StoreUndoState

        public void StoreUndoState()
        {
            if (!Undoing)
            {
                if (!IgnoreUndoUpdate)
                {
                    if (m_parentGroup != null)
                    {
//                        m_log.DebugFormat("[SCENE OBJECT PART]: Storing undo state for {0} {1}", Name, LocalId);

                        lock (m_undo)
                        {
                            if (m_undo.Count > 0)
                            {
                                UndoState last = m_undo.Peek();
                                if (last != null)
                                {
                                    if (last.Compare(this))
                                        return;
                                }
                            }

                            if (m_parentGroup.GetSceneMaxUndo() > 0)
                            {
                                UndoState nUndo = new UndoState(this);

                                m_undo.Push(nUndo);
                            }
                        }
                    }
                }
//                else
//                {
//                    m_log.DebugFormat("[SCENE OBJECT PART]: Ignoring undo store for {0} {1}", Name, LocalId);
//                }
            }
//            else
//            {
//                m_log.DebugFormat("[SCENE OBJECT PART]: Ignoring undo store for {0} {1} since already undoing", Name, LocalId);
//            }
        }
开发者ID:caocao,项目名称:diva-distribution,代码行数:41,代码来源:SceneObjectPart.cs

示例15: StoreUndoState

        public void StoreUndoState()
        {
            if (!Undoing)
            {
                if (!IgnoreUndoUpdate)
                {
                    if (m_parentGroup != null && 
                        ParentGroup.Scene != null &&
                        !ParentGroup.Scene.LoadingPrims)
                    {
                        lock (m_undo)
                        {
                            if (m_undo.Count > 0)
                            {
                                UndoState last = m_undo.Peek();
                                if (last != null)
                                {
                                    if (last.Compare(this))
                                        return;
                                }
                            }

                            UndoState nUndo = new UndoState(this);
                            m_undo.Push(nUndo);
                        }
                    }
                }
            }
        }
开发者ID:NickyPerian,项目名称:Aurora,代码行数:29,代码来源:SceneObjectPart.cs


注:本文中的OpenSim.Region.Framework.Scenes.UndoState类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。