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


C# IValue类代码示例

本文整理汇总了C#中IValue的典型用法代码示例。如果您正苦于以下问题:C# IValue类的具体用法?C# IValue怎么用?C# IValue使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: ArrayAdapter

 public ArrayAdapter(IValue array)
 {
     _array = array;
     _list = array.ActualType.CreateGenericListInstance().As<IList>();
     _listType = _list.GetType().ToCachedType();
     _listType.InvokeAction("AddRange", _list, array.Instance);
 }
开发者ID:carl-berg,项目名称:Bender,代码行数:7,代码来源:ArrayAdapter.cs

示例2: ForceEarlyReturn

        public void ForceEarlyReturn(IValue returnValue)
        {
            Contract.Requires<ArgumentNullException>(returnValue != null, "returnValue");
            Contract.Requires<VirtualMachineMismatchException>(this.GetVirtualMachine().Equals(returnValue.GetVirtualMachine()));

            throw new NotImplementedException();
        }
开发者ID:Kav2018,项目名称:JavaForVS,代码行数:7,代码来源:IThreadReferenceContracts.cs

示例3: AddCustomValue

        private void AddCustomValue(XmlElement parent, PropertyAuditingData propertyAuditingData,
            IValue value, ISimpleMapperBuilder mapper, bool insertable, bool key)
        {
            if (parent != null) {
                XmlElement prop_mapping = MetadataTools.AddProperty(parent, propertyAuditingData.Name,
                        null, insertable, key);

                //CustomType propertyType = (CustomType) value.getType();

                XmlElement type_mapping = parent.OwnerDocument.CreateElement("type");
                prop_mapping.AppendChild(type_mapping);
                type_mapping.SetAttribute("name", value.GetType().Name);

                if (value is SimpleValue) {
                    IDictionary<string, string> typeParameters = ((SimpleValue)value).TypeParameters;
                    if (typeParameters != null) {
                        foreach (KeyValuePair<string,string> paramKeyValue in typeParameters) {
                            XmlElement type_param = parent.OwnerDocument.CreateElement("param");
                            type_param.SetAttribute("name", (String) paramKeyValue.Key);
                            type_param["name"].Value =  paramKeyValue.Value;
                        }
                    }
                }

                MetadataTools.AddColumns(prop_mapping, (IEnumerator<ISelectable>)value.ColumnIterator);
            }

            if (mapper != null) {
                mapper.Add(propertyAuditingData.getPropertyData());
            }
        }
开发者ID:hazzik,项目名称:nhcontrib-all,代码行数:31,代码来源:BasicMetadataGenerator.cs

示例4: MapValue

        public static IPersistentValue MapValue(IValue value)
        {
            var component = value as Component;
            if(component != null)
            {
                return new PersistentComponent(MapProperties(component.PropertyIterator));
            }
            var collection = value as Collection;
            if(collection != null)
            {
                return new PersistentCollection(MapValue(collection.Element));
            }
            var toOne = value as ToOne;
            if(toOne != null)
            {
                return new PersistentToOne(toOne.ReferencedEntityName);
            }

            var oneToMany = value as OneToMany;
            if(oneToMany != null)
            {
                return new PersistentOneToMany(oneToMany.ReferencedEntityName);
            }
            return null;
        }
开发者ID:mausch,项目名称:NHWorkbench,代码行数:25,代码来源:ConfigurationMapper.cs

示例5: Create

 public static IVariable Create(IValue val)
 {
     return new Variable()
     {
         _val = val
     };
 }
开发者ID:Shemetov,项目名称:OneScript,代码行数:7,代码来源:Variables.cs

示例6: Send

 public void Send(
     IValue receiver,
     ValueSymbol selector,
     IList<IValue> args,
     VM vm,
     SourceInfo info
 )
 {
     IValueFunc func = null;
     foreach (ValueSymbol klass in KlassList)
     {
         if (vm.Env.LookupMethod(klass, selector, out func))
         {
             break;
         }
     }
     if (func == null)
     {
         throw new RheaException(
             string.Format(
                 "invalid selector for {0}: {1}",
                 receiver,
                 selector.Name.ToIdentifier()
             ),
             info
         );
     }
     List<IValue> newArgs = new List<IValue>();
     newArgs.Add(receiver);
     newArgs.AddRange(args);
     func.Call(newArgs, vm, info);
 }
开发者ID:takuto-h,项目名称:rhea,代码行数:32,代码来源:KlassHolder.cs

示例7: CreateAssignment

        public void CreateAssignment(IValueRegister targetRegister, IValue value)
        {
            JavaScriptRegister registerToUse = targetRegister as JavaScriptRegister;
            JavaScriptValue valueToUse = value as JavaScriptValue;

            AppendFormatLine("{0} = {1};", registerToUse.Expression, valueToUse.Expression);
        }
开发者ID:shravanrn,项目名称:Cleps,代码行数:7,代码来源:JavaScriptMethod.cs

示例8: AddComponent

        //@SuppressWarnings({"unchecked"})
        public void AddComponent(XmlElement parent, PropertyAuditingData propertyAuditingData,
            IValue value, ICompositeMapperBuilder mapper, String entityName,
            EntityXmlMappingData xmlMappingData, bool firstPass)
        {
            Component prop_component = (Component) value;

            ICompositeMapperBuilder componentMapper = mapper.AddComponent(propertyAuditingData.getPropertyData(),
                    prop_component.ComponentClassName);

            // The property auditing data must be for a component.
            ComponentAuditingData componentAuditingData = (ComponentAuditingData) propertyAuditingData;

            // Adding all properties of the component
            IEnumerator<Property> properties = (IEnumerator<Property>) prop_component.PropertyIterator.GetEnumerator();
            while (properties.MoveNext()) {
                Property property = properties.Current;

                PropertyAuditingData componentPropertyAuditingData =
                        componentAuditingData.getPropertyAuditingData(property.Name);

                // Checking if that property is audited
                if (componentPropertyAuditingData != null) {
                    mainGenerator.AddValue(parent, property.Value, componentMapper, entityName, xmlMappingData,
                            componentPropertyAuditingData, property.IsInsertable, firstPass);
                }
            }
        }
开发者ID:hazzik,项目名称:nhcontrib-all,代码行数:28,代码来源:ComponentMetadataGenerator.cs

示例9: AddComponent

        public void AddComponent(XmlElement parent, PropertyAuditingData propertyAuditingData,
								 IValue value, ICompositeMapperBuilder mapper, string entityName,
								 EntityXmlMappingData xmlMappingData, bool firstPass, bool insertable)
        {
            var propComponent = (Component) value;

            var componentMapper = mapper.AddComponent(propertyAuditingData.GetPropertyData(),
                                                                          propComponent.ComponentClassName);

            // The property auditing data must be for a component.
            var componentAuditingData = (ComponentAuditingData) propertyAuditingData;

            // Adding all properties of the component
            foreach (var property in propComponent.PropertyIterator)
            {
                var componentPropertyAuditingData = componentAuditingData.GetPropertyAuditingData(property.Name);

                // Checking if that property is audited
                if (componentPropertyAuditingData != null)
                {
                    mainGenerator.AddValue(parent, property.Value, componentMapper, entityName, xmlMappingData,
                            componentPropertyAuditingData, property.IsInsertable && insertable, firstPass);
                }
            }
        }
开发者ID:umittal,项目名称:MunimJi,代码行数:25,代码来源:ComponentMetadataGenerator.cs

示例10: AddBasic

        public bool AddBasic(XmlElement parent, PropertyAuditingData propertyAuditingData,
					 IValue value, ISimpleMapperBuilder mapper, bool insertable, bool key)
        {
            var type = value.Type;
            var custType = type as CustomType;
            var compType = type as CompositeCustomType;
            if (type is ImmutableType || type is MutableType)
            {
                AddSimpleValue(parent, propertyAuditingData, value, mapper, insertable, key);
            }
            else if (custType != null)
            {
                AddCustomValue(parent, propertyAuditingData, value, mapper, insertable, key, custType.UserType.GetType());
            }
            else if (compType != null)
            {
                AddCustomValue(parent, propertyAuditingData, value, mapper, insertable, key, compType.UserType.GetType());
            }
            else
            {
                return false;
            }

            return true;
        }
开发者ID:umittal,项目名称:MunimJi,代码行数:25,代码来源:BasicMetadataGenerator.cs

示例11: MemberDefinition

 public MemberDefinition(CachedMember member, string name, IValue value)
 {
     Name = name;
     Value = value;
     Member = member;
     IsNodeType = value.SpecifiedType.Type.CanBeCastTo<INode>();
 }
开发者ID:carl-berg,项目名称:Bender,代码行数:7,代码来源:MemberDefinition.cs

示例12: CreateAssignment

        public void CreateAssignment(IValueRegister targetRegister, IValue value)
        {
            JavaScriptRegister registerToUse = targetRegister as JavaScriptRegister;
            JavaScriptValue valueToUse = value as JavaScriptValue;

            AppendFormatLine("{0} = {1};", registerToUse.Expression, valueToUse.Expression.Replace("\n", "\n" + new String('\t', IndentationLevel)));
        }
开发者ID:shravanrn,项目名称:Cleps,代码行数:7,代码来源:JavaScriptMethod.cs

示例13: Change

 /// <summary>
 ///     Constructor
 /// </summary>
 /// <param name="variable"></param>
 /// <param name="previousValue"></param>
 /// <param name="newValue"></param>
 public Change(IVariable variable, IValue previousValue, IValue newValue)
 {
     Variable = variable;
     PreviousValue = previousValue;
     NewValue = newValue;
     Applied = false;
 }
开发者ID:JamesOakey,项目名称:ERTMSFormalSpecs,代码行数:13,代码来源:Change.cs

示例14: CreateDeserializable

        public static ObjectNodeBase CreateDeserializable(string name, IValue @object, INode parent,
            Context context, CachedMember member = null)
        {
            var type = @object.SpecifiedType;
            var kind = GetTypeKind(type, context.Options);

            if (kind == TypeKind.Simple)
            {
                if (parent == null) throw new TypeNotSupportedException("simple type",
                    @object.SpecifiedType, Mode.Deserialize, "complex types");
                return new ValueNode(context, name, @object, member, parent);
            }

            Func<object> factory = () => ObjectFactory.CreateInstance(type,
                context.Options.Deserialization.ObjectFactory, parent.MapOrDefault(x => x.Value));

            if (member == null || parent == null) @object.Instance = factory();
            else @object = ValueFactory.Create(@object, factory);

            switch (kind)
            {
                case TypeKind.Dictionary: return new DictionaryNode(context, name, @object, member, parent);
                case TypeKind.Enumerable: return new EnumerableNode(context, name, @object, member, parent);
                default: return new ObjectNode(context, name, @object, member, parent);
            }
        }
开发者ID:raidenyn,项目名称:Bender,代码行数:26,代码来源:NodeFactory.cs

示例15: MethodExitEventArgs

        internal MethodExitEventArgs(VirtualMachine virtualMachine, SuspendPolicy suspendPolicy, EventRequest request, ThreadReference thread, Location location, IValue returnValue)
            : base(virtualMachine, suspendPolicy, request, thread, location)
        {
            Contract.Requires<ArgumentNullException>(returnValue != null, "returnValue");

            _returnValue = returnValue;
        }
开发者ID:fjnogueira,项目名称:JavaForVS,代码行数:7,代码来源:MethodExitEventArgs.cs


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