Exemplo n.º 1
0
        private void DeletePoint(TaskContentBase content)
        {
            int index = content.Points.IndexOf(this);

            for (int i = 0; i < content.Depends.Count; i++)
            {
                if (content.Depends[i].OriginalPoint == index || content.Depends[i].DependPoint == index)
                {
                    content.Depends.RemoveAt(i);
                    i -= 1;
                }
                else
                {
                    if (content.Depends[i].OriginalPoint > index)
                    {
                        content.Depends[i].OriginalPoint -= 1;
                    }
                    if (content.Depends[i].DependPoint > index)
                    {
                        content.Depends[i].DependPoint -= 1;
                    }
                }
            }

            TaskContentBase.DestroySerializeSubObject(this, content);
            content.Points.Remove(this);
        }
Exemplo n.º 2
0
        /// <summary>
        /// 删除任务内容
        /// </summary>
        private void DeleteContent(int taskIndex)
        {
            for (int i = 0; i < _asset.Content[taskIndex].Points.Count; i++)
            {
                TaskContentBase.DestroySerializeSubObject(_asset.Content[taskIndex].Points[i], _asset);
            }
            TaskContentBase.DestroySerializeSubObject(_asset.Content[taskIndex], _asset);

            _asset.Content[taskIndex].Depends.Clear();
            _asset.Content[taskIndex].Points.Clear();
            _asset.Content.RemoveAt(taskIndex);
            _taskContentList.index = -1;
            _currentContent        = null;
        }