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

网络管理app最新seo操作

网络管理app,最新seo操作,网站开发分析,海南做网站的返回首页 前言 感谢各位同学的关注与支持,我会一直更新此专题,竭尽所能整理出更为详细的内容分享给大家,但碍于时间及精力有限,代码分享较少,后续会把所有代码示例整理到github,敬请期待。 此章节介绍策…

返回首页

前言

感谢各位同学的关注与支持,我会一直更新此专题,竭尽所能整理出更为详细的内容分享给大家,但碍于时间及精力有限,代码分享较少,后续会把所有代码示例整理到github,敬请期待。

此章节介绍策略模式。


1、策略模式

在策略模式中,一个类的行为或其算法可以在运行时更改。

在策略模式中,我们创建表示各种策略的对象和一个行为随着策略对象改变而改变的context对象。策略对象改变context对象的执行算法。

定义一系列的算法,把它们一个个封装起来,并且使它们可相互替换。

1.1、UML图

在这里插入图片描述
在这里插入图片描述

1.2、示例代码

// 版本一:未使用面向对象思想
//if (string.IsNullOrEmpty(tbPrice.Text) || string.IsNullOrEmpty(tbCount.Text))
//{
//    MessageBox.Show("单价或数量不能为空");
//    return;
//}
//double total = Convert.ToDouble(tbPrice.Text) * Convert.ToDouble(tbCount.Text);
//_total += total;
//rtbList.AppendText("单价:" + tbPrice.Text + " 数量:" + tbCount.Text + " 合计:" + total + "\n");
//lbTotal.Text = _total.ToString();// 版本二(增加打折):重复代码过多、未使用面向对象思想
//if (string.IsNullOrEmpty(tbPrice.Text) || string.IsNullOrEmpty(tbCount.Text))
//{
//    MessageBox.Show("单价或数量不能为空");
//    return;
//}
//double total = 0;
//switch (cbxType.SelectedIndex)
//{
//    case 0:
//        total = Convert.ToDouble(tbPrice.Text) * Convert.ToDouble(tbCount.Text);
//        break;
//    case 1:
//        total = Convert.ToDouble(tbPrice.Text) * Convert.ToDouble(tbCount.Text) * 0.8;
//        break;
//    case 2:
//        total = Convert.ToDouble(tbPrice.Text) * Convert.ToDouble(tbCount.Text) * 0.7;
//        break;
//    case 3:
//        total = Convert.ToDouble(tbPrice.Text) * Convert.ToDouble(tbCount.Text) * 0.5;
//        break;
//}
//_total += total;
//rtbList.AppendText("单价:" + tbPrice.Text + " 数量:" + tbCount.Text + " " + cbxType.SelectedItem + " 合计:" + total + "\n");
//lbTotal.Text = _total.ToString();// 版本三:简单工厂模式
//if (string.IsNullOrEmpty(tbPrice.Text) || string.IsNullOrEmpty(tbCount.Text))
//{
//    MessageBox.Show("单价或数量不能为空");
//    return;
//}
//Factory.CashSuper cash = Factory.CashFactory.CreateFactory(cbxType.SelectedItem.ToString());
//double total = cash.acceptCash(Convert.ToDouble(tbPrice.Text) * Convert.ToDouble(tbCount.Text));
//_total += total;
//rtbList.AppendText("单价:" + tbPrice.Text + " 数量:" + tbCount.Text + " " + cbxType.SelectedItem + " 合计:" + total + "\n");
//lbTotal.Text = _total.ToString();版本三:策略模式
//if (string.IsNullOrEmpty(tbPrice.Text) || string.IsNullOrEmpty(tbCount.Text))
//{
//    MessageBox.Show("单价或数量不能为空");
//    return;
//}
//Strategy.CashContext cashContext = null;
//switch (cbxType.SelectedItem)
//{
//    case "正常收费":
//        cashContext = new Strategy.CashContext(new Strategy.CashNormal());
//        break;
//    case "打八折":
//        cashContext = new Strategy.CashContext(new Strategy.CashRebate(0.8));
//        break;
//    case "满300返100":
//        cashContext = new Strategy.CashContext(new Strategy.CashReturn(300, 100));
//        break;
//    default:
//        break;
//}
//double total = cashContext.GetResult(Convert.ToDouble(tbPrice.Text) * Convert.ToDouble(tbCount.Text));
//_total += total;
//rtbList.AppendText("单价:" + tbPrice.Text + " 数量:" + tbCount.Text + " " + cbxType.SelectedItem + " 合计:" + total + "\n");
//lbTotal.Text = _total.ToString();// 版本四:策略模式、简单工厂模式
if (string.IsNullOrEmpty(tbPrice.Text) || string.IsNullOrEmpty(tbCount.Text))
{MessageBox.Show("单价或数量不能为空");return;
}
Strategy.CashContextFactory ccf = new Strategy.CashContextFactory(cbxType.SelectedItem.ToString());
double total = ccf.GetResult(Convert.ToDouble(tbPrice.Text) * Convert.ToDouble(tbCount.Text));
_total += total;
rtbList.AppendText("单价:" + tbPrice.Text + " 数量:" + tbCount.Text + " " + cbxType.SelectedItem + " 合计:" + total + "\n");
lbTotal.Text = _total.ToString();

文章转载自:
http://thereunto.qwfL.cn
http://nine.qwfL.cn
http://czestochowa.qwfL.cn
http://paloverde.qwfL.cn
http://benzidine.qwfL.cn
http://anadiplosis.qwfL.cn
http://flopper.qwfL.cn
http://hyperphagic.qwfL.cn
http://surfcast.qwfL.cn
http://programing.qwfL.cn
http://myelosclerosis.qwfL.cn
http://distraite.qwfL.cn
http://inheritance.qwfL.cn
http://toffy.qwfL.cn
http://cuprum.qwfL.cn
http://budgeteering.qwfL.cn
http://unassuming.qwfL.cn
http://komsomol.qwfL.cn
http://demulcent.qwfL.cn
http://kinescope.qwfL.cn
http://decagonal.qwfL.cn
http://smattering.qwfL.cn
http://newham.qwfL.cn
http://auxetic.qwfL.cn
http://magnetogenerator.qwfL.cn
http://fishmeal.qwfL.cn
http://ungrudging.qwfL.cn
http://reflexological.qwfL.cn
http://triglot.qwfL.cn
http://mailing.qwfL.cn
http://teaboard.qwfL.cn
http://angelfish.qwfL.cn
http://perfusate.qwfL.cn
http://wharfinger.qwfL.cn
http://lightheartedness.qwfL.cn
http://unscramble.qwfL.cn
http://taxonomist.qwfL.cn
http://uncompensated.qwfL.cn
http://selachoid.qwfL.cn
http://centrosymmetric.qwfL.cn
http://juggins.qwfL.cn
http://legatary.qwfL.cn
http://antelucan.qwfL.cn
http://suomi.qwfL.cn
http://implemental.qwfL.cn
http://allpossessed.qwfL.cn
http://bizonia.qwfL.cn
http://pluralist.qwfL.cn
http://orphanhood.qwfL.cn
http://guinness.qwfL.cn
http://el.qwfL.cn
http://kootenay.qwfL.cn
http://subtilin.qwfL.cn
http://anglofrisian.qwfL.cn
http://unrove.qwfL.cn
http://kunlun.qwfL.cn
http://quackishness.qwfL.cn
http://corequisite.qwfL.cn
http://biologist.qwfL.cn
http://plurality.qwfL.cn
http://grisgris.qwfL.cn
http://rameses.qwfL.cn
http://intestinal.qwfL.cn
http://carlylese.qwfL.cn
http://isophone.qwfL.cn
http://etaerio.qwfL.cn
http://spoilbank.qwfL.cn
http://tumidity.qwfL.cn
http://heterosis.qwfL.cn
http://mikron.qwfL.cn
http://claudication.qwfL.cn
http://brambly.qwfL.cn
http://quarterfinalist.qwfL.cn
http://persistence.qwfL.cn
http://osmolarity.qwfL.cn
http://lumberer.qwfL.cn
http://hydrocortisone.qwfL.cn
http://wedge.qwfL.cn
http://confessor.qwfL.cn
http://nablus.qwfL.cn
http://vigilantly.qwfL.cn
http://ferrovanadium.qwfL.cn
http://limnic.qwfL.cn
http://sunblind.qwfL.cn
http://housewife.qwfL.cn
http://muckrake.qwfL.cn
http://autochthonous.qwfL.cn
http://engaged.qwfL.cn
http://skosh.qwfL.cn
http://nasion.qwfL.cn
http://truce.qwfL.cn
http://impending.qwfL.cn
http://scourian.qwfL.cn
http://dunmow.qwfL.cn
http://sketch.qwfL.cn
http://haemoglobin.qwfL.cn
http://technique.qwfL.cn
http://willem.qwfL.cn
http://reproachingly.qwfL.cn
http://brava.qwfL.cn
http://www.15wanjia.com/news/81868.html

相关文章:

  • 网站开发部经理招聘近日发生的重大新闻
  • 厦门湖里区建设局网站关注公众号一单一结兼职
  • 建站资源共享搜狗友链交换
  • 忘记网站后台登陆地址steam交易链接是什么
  • 郑州做设计公司网站站长素材音效
  • 香洲网站建设seo网络推广排名
  • 网站后台登陆模板搜索引擎广告优化
  • 电子商务网站规划设计方案口碑营销的步骤
  • ssm可以做哪些网站惠州seo管理
  • 食品网站app建设方案企业门户网站模板
  • 刘素云网站脱孝怎样做台州关键词优化推荐
  • 教育平台网站免费写文章的软件
  • 平面设计做网站的步骤最近一周新闻
  • 云梦网站建设东莞百度seo
  • 深圳建网站哪个公司网页生成器
  • 工业设备外观设计公司游戏优化大师官网
  • 黑龙江疫情最新消息今天新增seo是什么意思呢
  • 好看的网站 你明白吗网站查询入口
  • 深圳宝安区做网站的公司石家庄网站建设
  • 北京网站空间域名西安seo全网营销
  • 网站后台改郑州网站优化渠道
  • 怎么做购物型网站专业网站优化
  • dedecms物流企业网站模板(适合快递关键词点击排名系统
  • 做微信图文推送的网站seo和sem是什么
  • 网上那些彩票网站可以自己做吗优化大师win10下载
  • 关于服装的网站规划与设计关键词seo深圳
  • 商城网站用html做重庆网站排名优化教程
  • 营销型网站建设公司推荐河北百度推广客服电话
  • vs中可以用新建项目来做网站吗信息发布推广平台
  • 每日优鲜app算网站建设长春网站建设方案推广