100165464.htm
来自「C#高级编程(第三版),顶死你们。。 。up」· HTM 代码 · 共 74 行
HTM
74 行
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><title>
16.3.2 特性和属性
</title></head>
<body>
<div class="area">
<div class="col1">
<div class="lineBlue">
</div>
<!-- title -->
<div class="arcTitle">
<h1>
<a href="../16">
C#高级编程(第3版)【全文连载】
</a>
</h1>
<div style="text-align: center; font-size: 15px">
<a href="100165464.htm">
16.3.2 特性和属性
</a>
</div>
<div style="text-align: center; font-size: 15px">
<a class="url" href="../../default.htm">http://book.csdn.net/</a>
2006-10-13 14:41:00
</div>
<div style="margin: 0px auto; width: 700px; border: solid 1px #0b5f98;">
<div style="float: left; width: 16px; background-color: #0b5f98; color: White; padding: 1px;">
图书导读
</div>
<div style="float: right; width: 670px; text-align: left; line-height: 16pt; padding-left: 2px">
<!--导读-->
<h1 id="divCurrentNode" style="color: #b83507; width: 100%; text-align: left; font-size: 12px; padding-left: 2px">当前章节:<a href='100165464.htm'><font color='red'>16.3.2 特性和属性</font></a></h1>
<div id="divRelateNode" style="padding-left: 2px">
<div style='float:left;width:49%'>·<a href='100165461.htm'>16.2 .NET Remoting概述</a></div><div style='float:right;width:49%'>·<a href='100165462.htm'>16.3 环境</a></div><div style='float:left;width:49%'>·<a href='100165463.htm'>16.3.1 激活</a></div><div style='float:right;width:49%'>·<a href='100165465.htm'>16.3.3 环境之间的通信</a></div><div style='float:left;width:49%'>·<a href='100165466.htm'>16.4 远程对象、客户机和服务器</a></div><div style='float:right;width:49%'>·<a href='100165467.htm'>16.4.1 远程对象</a></div></div>
</div>
</div>
</div>
<!-- main -->
<div id="main">
<div id="text"> <link href="css.css" rel="stylesheet" type="text/css" /><h3 style="MARGIN-TOP: 8.15pt; MARGIN-LEFT: 0cm; MARGIN-RIGHT: 0cm; FTEL: 8.15pt"><a ftel="_Toc507815548"><span lang="EN-US">16.3.2 </span></a><span style="FONT-FAMILY: 黑体">特性和属性</span></h3>
<p class="MsoNormal"><span style="FONT-FAMILY: 宋体">有了环境特性,就可以定义环境的属性。环境特性类从根本上来说是特性。第</span><span lang="EN-US">10</span><span style="FONT-FAMILY: 宋体">章有特性的详细介绍。环境特性类必须执行接口</span><span lang="EN-US">IContext Attribute</span><span style="FONT-FAMILY: 宋体">。因为</span><span lang="EN-US">ContextAttribute</span><span style="FONT-FAMILY: 宋体">类总是有</span><span lang="EN-US">IContextAttribute</span><span style="FONT-FAMILY: 宋体">接口的一个默认实现方式,所以定制的环境特性类可以由</span><span lang="EN-US">ContextAttribute</span><span style="FONT-FAMILY: 宋体">类派生而来。</span></p>
<p class="MsoNormal"><span lang="EN-US" style="LETTER-SPACING: -0.2pt">.NET Framework 1.1</span><span style="FONT-FAMILY: 宋体; LETTER-SPACING: -0.2pt">有一个环境特性类:即</span><span lang="EN-US" style="LETTER-SPACING: -0.2pt">System.Runtime.Remoting.Contexts. Synchronization</span><span lang="EN-US"> Attribute</span><span style="FONT-FAMILY: 宋体">。</span><span lang="EN-US" style="COLOR: black">Synchronization</span><span style="COLOR: black; FONT-FAMILY: 宋体">特性用于定义同步的要求,它指定对象需要的同步特性。可以指定多个线程不能同时访问对象,但是访问对象的线程可以改变。</span></p>
<p class="MsoNormal"><span style="COLOR: black; FONT-FAMILY: 宋体">使用这个特性的构造函数,可以设置以下</span><span lang="EN-US" style="COLOR: black">4</span><span style="COLOR: black; FONT-FAMILY: 宋体">个值:</span></p>
<p class="1" style="MARGIN-LEFT: 37.55pt; FTEL: -16.1pt"><span lang="EN-US">●<span style="FONT: 7pt 'Times New Roman'"> </span></span><span lang="EN-US">NOT_SUPPORTED</span><span style="FONT-FAMILY: 宋体">,定义不应该在设置了同步的环境中对类进行实例化。</span></p>
<p class="1" style="MARGIN-LEFT: 37.55pt; FTEL: -16.1pt"><span lang="EN-US">●<span style="FONT: 7pt 'Times New Roman'"> </span></span><span lang="EN-US">REQUIRED</span><span style="FONT-FAMILY: 宋体">,指定需要有同步环境。</span></p>
<p class="1" style="MARGIN-LEFT: 37.55pt; FTEL: -16.1pt"><span lang="EN-US" style="COLOR: black">●<span style="FONT: 7pt 'Times New Roman'"> </span></span><span style="COLOR: black; FONT-FAMILY: 宋体">使用</span><span lang="EN-US" style="COLOR: black">REQUIRED_NEW</span><span style="COLOR: black; FONT-FAMILY: 宋体">,总是得到一个新的环境。</span></p>
<p class="1" style="MARGIN-LEFT: 37.55pt; FTEL: -16.1pt"><span lang="EN-US">●<span style="FONT: 7pt 'Times New Roman'"> </span></span><span lang="EN-US">SUPPORTED</span><span style="FONT-FAMILY: 宋体">,表示得到什么样的环境并不重要,只要环境中有对象即可。</span></p></div>
<!-- page -->
<div class="page" style="text-align: center">
<a href="100165463.htm">上一页</a> <a href="index.html">首页</a> <a href="100165465.htm">下一页</a>
</div>
<div style="margin: 0px auto; width: 700px; border: solid 1px #0b5f98;">
<div style="float: left; width: 16px; background-color: #0b5f98; color: White; padding: 1px;">
图书导读
</div>
<div style="float: right; width: 670px; text-align: left; line-height: 16pt; padding-left: 2px">
<!--导读-->
<h1 id="divCurrentNode2" style="color: #b83507; width: 100%; text-align: left; font-size: 12px; padding-left: 2px">当前章节:<a href='100165464.htm'><font color='red'>16.3.2 特性和属性</font></a></h1>
<div id="divRealteNod2" style="padding-left: 2px">
<div style='float:left;width:49%'>·<a href='100165461.htm'>16.2 .NET Remoting概述</a></div><div style='float:right;width:49%'>·<a href='100165462.htm'>16.3 环境</a></div><div style='float:left;width:49%'>·<a href='100165463.htm'>16.3.1 激活</a></div><div style='float:right;width:49%'>·<a href='100165465.htm'>16.3.3 环境之间的通信</a></div><div style='float:left;width:49%'>·<a href='100165466.htm'>16.4 远程对象、客户机和服务器</a></div><div style='float:right;width:49%'>·<a href='100165467.htm'>16.4.1 远程对象</a></div></div>
</div>
</div>
</div>
</div>
</body>
</html>
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?