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


C# ISurrogateSelector.ChainSelector方法代码示例

本文整理汇总了C#中ISurrogateSelector.ChainSelector方法的典型用法代码示例。如果您正苦于以下问题:C# ISurrogateSelector.ChainSelector方法的具体用法?C# ISurrogateSelector.ChainSelector怎么用?C# ISurrogateSelector.ChainSelector使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ISurrogateSelector的用法示例。


在下文中一共展示了ISurrogateSelector.ChainSelector方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: ChainSelector

 /// <summary>
 /// Adds the specified <see cref="T:System.Runtime.Serialization.ISurrogateSelector"/> that
 /// can handle a particular object type to the list of surrogates.
 /// </summary>
 /// <param name="selector">The surrogate selector to add.</param>
 /// <exception cref="T:System.ArgumentNullException">The
 /// <paramref name="selector"/>parameter is null.</exception>
 /// <exception cref="T:System.Runtime.Serialization.SerializationException">The selector is
 /// already on the list of selectors.</exception>
 /// <exception cref="T:System.Security.SecurityException">The caller does not have the
 /// required permission.</exception>
 public virtual void ChainSelector(ISurrogateSelector selector) {
     if (selector == null)
         throw new ArgumentNullException("Selector is null.");
     if (_nextSelector != null)
         selector.ChainSelector(_nextSelector);
     _nextSelector = selector;
 }
开发者ID:Boxxxx,项目名称:clicker,代码行数:18,代码来源:DictionarySurrogateSelector.cs

示例2: ChainSelector

 public virtual void ChainSelector(ISurrogateSelector selector)
 {
     if (selector == null)
     {
         throw new ArgumentNullException("Selector is null.");
     }
     if (this._nextSelector != null)
     {
         selector.ChainSelector(this._nextSelector);
     }
     this._nextSelector = selector;
 }
开发者ID:fuboss,项目名称:aiProject,代码行数:12,代码来源:DictionarySurrogateSelector.cs

示例3: ChainSelector

		public virtual void ChainSelector (ISurrogateSelector selector)
		{
			if (selector == null)
				throw new ArgumentNullException ("Selector is null.");

			// Chain the selector at the beggining of the chain
			// since "The last selector added to the list will be the first one checked"
			// (from MS docs)

			if (nextSelector != null)
				selector.ChainSelector (nextSelector);

			nextSelector = selector;
		}
开发者ID:jack-pappas,项目名称:mono,代码行数:14,代码来源:SurrogateSelector.cs

示例4: ChainSelector

		public virtual void ChainSelector (ISurrogateSelector selector)
		{
			if (_next != null) selector.ChainSelector (_next);
			_next = selector;
		}
开发者ID:jack-pappas,项目名称:mono,代码行数:5,代码来源:RemotingSurrogateSelector.cs

示例5: ChainSelector

        [System.Security.SecurityCritical]  // auto-generated_required 
        public virtual void ChainSelector(ISurrogateSelector selector) {
            ISurrogateSelector temp; 
            ISurrogateSelector tempCurr;
            ISurrogateSelector tempPrev;
            ISurrogateSelector tempEnd;
 
            if (selector==null) {
                throw new ArgumentNullException("selector"); 
            } 
            Contract.EndContractBlock();
 
            //
            // Verify that we don't try and add ourself twice.
            //
            if (selector==this) { 
                throw new SerializationException(Environment.GetResourceString("Serialization_DuplicateSelector"));
            } 
 
            //
            // Verify that the argument doesn't contain a cycle. 
            //
            if (!HasCycle(selector)) {
                throw new ArgumentException(Environment.GetResourceString("Serialization_SurrogateCycleInArgument"), "selector");
            } 

            // 
            // Check for a cycle that would lead back to this.  We find the end of the list that we're being asked to 
            // insert for use later.
            // 
            tempCurr = selector.GetNextSelector();
            tempEnd = selector;
            while (tempCurr!=null && tempCurr!=this) {
                tempEnd = tempCurr; 
                tempCurr = tempCurr.GetNextSelector();
            } 
            if (tempCurr==this) { 
                throw new ArgumentException(Environment.GetResourceString("Serialization_SurrogateCycle"), "selector");
            } 

            //
            // Check for a cycle later in the list which would be introduced by this insertion.
            // 
            tempCurr = selector;
            tempPrev = selector; 
            while(tempCurr!=null) { 
                if (tempCurr==tempEnd) {
                    tempCurr = this.GetNextSelector(); 
                } else {
                    tempCurr = tempCurr.GetNextSelector();
                }
                if (tempCurr==null) { 
                    break;
                } 
                if (tempCurr==tempPrev) { 
                    throw new ArgumentException(Environment.GetResourceString("Serialization_SurrogateCycle"), "selector");
                } 

                if (tempCurr==tempEnd) {
                    tempCurr = this.GetNextSelector();
                } else { 
                    tempCurr = tempCurr.GetNextSelector();
                } 
 

                if (tempPrev==tempEnd) { 
                    tempPrev = this.GetNextSelector();
                } else {
                    tempPrev = tempPrev.GetNextSelector();
                } 
                if (tempCurr==tempPrev) {
                    throw new ArgumentException(Environment.GetResourceString("Serialization_SurrogateCycle"), "selector"); 
                } 
            }
 
            //
            // Add the new selector and it's entire chain of selectors as the next thing that
            // we check.
            // 
            temp = m_nextSelector;
            m_nextSelector = selector; 
            if (temp!=null) { 
                tempEnd.ChainSelector(temp);
            } 
        }
开发者ID:sjyanxin,项目名称:WPFSource,代码行数:85,代码来源:SurrogateSelector.cs


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