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


C# IodineObject.SetAttribute方法代码示例

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


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

示例1: Inherit

 public virtual void Inherit(VirtualMachine vm, IodineObject self, IodineObject[] arguments)
 {
     IodineObject obj = this.Invoke (vm, arguments);
     foreach (string attr in attributes.Keys) {
         if (!self.HasAttribute (attr))
             self.SetAttribute (attr, attributes [attr]);
         obj.SetAttribute (attr, attributes [attr]);
     }
     self.SetAttribute ("__super__", obj);
     self.Base = obj;
 }
开发者ID:iwatakeshi,项目名称:Iodine,代码行数:11,代码来源:IodineTypeDefinition.cs

示例2: BindAttributes

 public IodineObject BindAttributes(IodineObject obj)
 {
     foreach (KeyValuePair<string, IodineObject> kv in attributes) {
         if (!obj.HasAttribute (kv.Key))
             obj.SetAttribute (kv.Key, kv.Value);
     }
     return obj;
 }
开发者ID:iwatakeshi,项目名称:Iodine,代码行数:8,代码来源:IodineTypeDefinition.cs

示例3: Inherit

        public override void Inherit(VirtualMachine vm, IodineObject self, IodineObject[] arguments)
        {
            IodineObject obj = Invoke (vm, arguments);

            foreach (KeyValuePair<string, IodineObject> kv in attributes) {
                if (!self.HasAttribute (kv.Key))
                    self.SetAttribute (kv.Key, kv.Value);
                if (!obj.HasAttribute (kv.Key))
                    obj.SetAttribute (kv.Key, kv.Value);
            }
            self.SetAttribute ("__super__", obj);
            self.Base = obj;
        }
开发者ID:iwatakeshi,项目名称:Iodine,代码行数:13,代码来源:IodineClass.cs

示例4: Inherit

		public override void Inherit (VirtualMachine vm, IodineObject self, IodineObject[] arguments)
		{
			IodineObject obj = Invoke (vm, arguments);

			foreach (KeyValuePair<string, IodineObject> kv in Attributes) {
				if (!self.HasAttribute (kv.Key))
					self.SetAttribute (kv.Key, kv.Value);
				if (!obj.HasAttribute (kv.Key)) {
					obj.SetAttribute (kv.Key, kv.Value);
				}
			}
			Dictionary<string, IodineObject> childAttributes = obj.Attributes;

			foreach (KeyValuePair<string, IodineObject> kv in childAttributes) {
				if (kv.Value is IodineInstanceMethodWrapper) {
					IodineInstanceMethodWrapper wrapper = (IodineInstanceMethodWrapper)kv.Value;
					wrapper.Rewrap (self);
				}
			}
			self.SetAttribute ("__super__", obj);
			self.Base = obj;
		}
开发者ID:GruntTheDivine,项目名称:Iodine,代码行数:22,代码来源:IodineClass.cs

示例5: RaiseException

 public void RaiseException(IodineObject ex)
 {
     if (exceptionHandlers.Count == 0) {
         throw new UnhandledIodineExceptionException (Top, ex);
     } else {
         IodineExceptionHandler handler = exceptionHandlers.Pop ();
         ex.SetAttribute ("stackTrace", new IodineString (Trace ()));
         Unwind (frameCount - handler.Frame);
         lastException = ex;
         Top.InstructionPointer = handler.InstructionPointer;
     }
 }
开发者ID:iwatakeshi,项目名称:Iodine,代码行数:12,代码来源:VirtualMachine.cs

示例6: RaiseException

		public void RaiseException (IodineObject ex)
		{
			if (traceCallback != null) {
				traceCallback (TraceType.Exception, this, Top, currentLocation);
			}
			IodineExceptionHandler handler = PopCurrentExceptionHandler ();
			if (handler == null) { // No exception handler
				/*
				 * The program has gone haywire and we ARE going to crash, however
				 * we must attempt to properly dispose any objects created inside 
				 * Iodine's with statement
				 */
				StackFrame top = Top;
				while (top != null) {
					while (top.DisposableObjects.Count > 0) {
						IodineObject obj = top.DisposableObjects.Pop ();
						try {
							obj.Exit (this); // Call __exit__
						} catch (UnhandledIodineExceptionException) {
							// Ignore this, we will throw one when we're done anyway
						}
					}
					top = top.Parent;
				}
				throw new UnhandledIodineExceptionException (Top, ex);
			}
			ex.SetAttribute ("stackTrace", new IodineString (GetStackTrace ()));
			UnwindStack (frameCount - handler.Frame);
			lastException = ex;
			Top.InstructionPointer = handler.InstructionPointer;
		}
开发者ID:GruntTheDivine,项目名称:Iodine,代码行数:31,代码来源:VirtualMachine.cs


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