当前位置: 首页 > news >正文

怎么做优惠券网站/百度 营销中心

怎么做优惠券网站,百度 营销中心,岳阳设计网站推荐,中国菲律宾关系编程时遇到对象关联API的设计问题,感觉可能这种api的设计方案本身就有问题,所以目前还未有解决方案。 问题如下: using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace ConsoleApplication { …

编程时遇到对象关联API的设计问题,感觉可能这种api的设计方案本身就有问题,所以目前还未有解决方案。
问题如下:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ConsoleApplication
{
    /// <summary>
    /// 在NotImplement的方法/属性中填入相应内容,以保证程序不会抛出异常。
    /// (就是:Parent属性,AddChild方法,RemoveChild方法。)
    /// 
    /// 不能修改其它代码。
    /// </summary>
    class Program
    {
        static void Main(string[] args)
        {
            Parent parentA = new Parent();
            Parent parentB = new Parent();
            Child child = new Child();

            parentA.AddChild(child);

            child.Parent = parentB;
            Assert(parentA.Children.Count == 0, parentB.Children.Count == 1, child.Parent == parentB);

            parentA.AddChild(child);
            Assert(parentB.Children.Count == 0, parentA.Children.Count == 1, child.Parent == parentA);

            child.Parent = null;
            Assert(parentB.Children.Count == 0, parentA.Children.Count == 0, child.Parent == null);
        }

        static void Assert(params bool[] values)
        {
            foreach (var value in values)
            {
                if (value == false)
                {
                    throw new Exception();
                }
            }
        }
    }
    class Parent
    {
        private List<Child> _children;

        public Parent()
        {
            this._children = new List<Child>();
        }

        public IList<Child> Children
        {
            get
            {
                return new System.Collections.ObjectModel.ReadOnlyCollection<Child>(this._children);
            }
        }
        public void AddChild(Child child)
        {
            throw new NotImplementedException();
        }
        public void RemoveChild(Child child)
        {
            throw new NotImplementedException();
        }

    }
    class Child
    {
        private Parent _parent;

        public Parent Parent
        {
            get
            {
                throw new NotImplementedException();
            }
            set
            {
                throw new NotImplementedException();
            }
        }
    }
}

http://www.lbrq.cn/news/1244503.html

相关文章:

  • wordpress中ajax请求/长春seo培训
  • 3d网站建设/关键词优化怎么写
  • 哪个网站有做彩平的材质贴图/北京网站提升排名
  • 用什么程序做网站好/商品热搜词排行榜
  • wap网站前景/合肥网络seo推广服务
  • 广东省住房和建设委员会网站/四川游戏seo整站优化
  • 江苏建设个人信息网站/网络营销的方式都有哪些
  • android做网站/seo职业规划
  • 个人网站做论坛还是博客好/windows优化大师怎么卸载
  • 建设思政教育网站案例/营销的概念是什么
  • 网站的建设公司/5118网站如何使用免费版
  • 做网站就上凡科建设/天津最新消息今天
  • seo建站是什么/中国疫情今天最新消息
  • 合肥网站建设费用/百度统计收费吗
  • 重生做二次元网站/网络推广的目标
  • 做的网站适应屏幕大小/seo网页推广
  • 专业做学校网站的公司/腾讯云1元域名
  • 容桂网站制作咨询/北京网站seo
  • 站酷网官网入口/厦门seo排名优化公司
  • 在线教育网站建设方案/北大青鸟培训机构靠谱吗
  • 南宁企业建站模板/百度怎么找人工客服
  • 宁波网站建设联系方法/深圳纯手工seo
  • 建筑证书兼职网站/南宁seo优化
  • 行唐县做网站电话/seo网络推广企业
  • 网站维护英文/seo是什么的缩写
  • 高校网站如何建设论文/南宁百度关键词推广
  • 宝安做棋牌网站建设/关键词优化案例
  • 国土资源网站建设方案/百度免费推广怎么操作
  • 开发网站监控推荐/手机如何制作自己的网站
  • 域名费用和网站服务器费用是同样的吗/广东: 确保科学精准高效推进疫情
  • 从O(n²)到O(n log n):深度剖析快速排序的内存优化与cache-friendly实现
  • grafana/lock-stack 日志 Pipeline 配置
  • 《Java 程序设计》第 14 章 - JavaFX 基础
  • 暑期算法训练.11
  • systmctl的作用,使用场景和用法
  • 开发避坑短篇(9):解决升级Vue3后slot attributes废弃警告