本文整理汇总了C#中VariableDef类的典型用法代码示例。如果您正苦于以下问题:C# VariableDef类的具体用法?C# VariableDef怎么用?C# VariableDef使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
VariableDef类属于命名空间,在下文中一共展示了VariableDef类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: ReplaceVariable
internal override void ReplaceVariable(string name, VariableDef def) {
if (_name != name) {
Parent.ReplaceVariable(name, def);
} else {
_variable = def;
}
}
开发者ID:lioaphy,项目名称:nodejstools,代码行数:7,代码来源:DefinitiveAssignmentEnvironmentRecord.cs
示例2: TryGetVariable
public override bool TryGetVariable(string name, out VariableDef variable) {
if (name == _name) {
variable = _variable;
return true;
}
return base.TryGetVariable(name, out variable);
}
开发者ID:lioaphy,项目名称:nodejstools,代码行数:7,代码来源:DefinitiveAssignmentEnvironmentRecord.cs
示例3: FunctionInfo
internal FunctionInfo(AnalysisUnit unit, ProjectEntry entry)
: base(unit)
{
_entry = entry;
_returnValue = new VariableDef();
_declVersion = entry.Version;
// TODO: pass NoneInfo if we can't determine the function always returns
}
开发者ID:TerabyteX,项目名称:main,代码行数:8,代码来源:FunctionInfo.cs
示例4: GeneratorInfo
public GeneratorInfo(JAnalyzer projectState, Node node)
: base(projectState._generatorType)
{
_node = node;
Yields = new VariableDef();
Sends = new VariableDef();
Returns = new VariableDef();
}
开发者ID:borota,项目名称:JTVS,代码行数:8,代码来源:GeneratorInfo.cs
示例5: SetVariable
public override void SetVariable(VariableDef value, object obj) {
base.SetVariable(value, obj);
if (value != null)
{ setProperty(value.Value, "", false, obj); }
else
{ update(); }
}
开发者ID:675492062,项目名称:behaviac,代码行数:9,代码来源:DesignerCompositeEditor.cs
示例6: GeneratorInfo
public GeneratorInfo(PythonAnalyzer projectState, IPythonProjectEntry entry)
: base(projectState.ClassInfos[BuiltinTypeId.Generator]) {
_declaringModule = entry;
_declaringVersion = entry.AnalysisVersion;
Yields = new VariableDef();
Sends = new VariableDef();
Returns = new VariableDef();
}
开发者ID:CforED,项目名称:Node.js-Tools-for-Visual-Studio,代码行数:9,代码来源:GeneratorInfo.cs
示例7: FunctionScope
public FunctionScope(FunctionInfo function, Node node, InterpreterScope declScope)
: base(function, node, declScope)
{
ReturnValue = new VariableDef();
if (Function.FunctionDefinition.IsGenerator) {
Generator = new GeneratorInfo(function.ProjectState, Function.FunctionDefinition);
ReturnValue.AddTypes(function.ProjectEntry, Generator.SelfSet, false);
}
}
开发者ID:borota,项目名称:JTVS,代码行数:9,代码来源:FunctionScope.cs
示例8: SetVariable
public override void SetVariable(VariableDef variable, object obj) {
base.SetVariable(variable, obj);
if (variable != null) {
Type valueType = variable.GetValueType();
if (valueType == typeof(bool))
{ checkBox.Checked = (bool)variable.Value; }
}
}
开发者ID:675492062,项目名称:behaviac,代码行数:10,代码来源:DesignerBooleanEditor.cs
示例9: CopyVariableDef
private static VariableDef CopyVariableDef(VariableDef original) {
LocatedVariableDef locVarDef = original as LocatedVariableDef;
if (locVarDef != null) {
return new LocatedVariableDef(
locVarDef.Entry,
locVarDef.Node
);
}
return new VariableDef();
}
开发者ID:lioaphy,项目名称:nodejstools,代码行数:10,代码来源:CarteseanProductFunctionAnalysisUnit.cs
示例10: CoroutineInfo
public CoroutineInfo(PythonAnalyzer projectState, IPythonProjectEntry entry)
: base(projectState.ClassInfos[BuiltinTypeId.Generator]) {
// Internally, coroutines are represented by generators with a CO_*
// flag on the code object. Here we represent it as a separate info,
// but reuse the underlying class info.
_declaringModule = entry;
_declaringVersion = entry.AnalysisVersion;
Returns = new VariableDef();
}
开发者ID:wenh123,项目名称:PTVS,代码行数:10,代码来源:CoroutineInfo.cs
示例11: CreateVariable
public VariableDef CreateVariable(Node node, AnalysisUnit unit, string name, bool addRef = true)
{
var res = GetVariable(node, unit, name, addRef);
if (res == null) {
_variables[name] = res = new VariableDef();
if (addRef) {
res.AddReference(node, unit);
}
}
return res;
}
开发者ID:TerabyteX,项目名称:main,代码行数:11,代码来源:InterpreterScope.cs
示例12: GeneratorInfo
public GeneratorInfo(FunctionInfo functionInfo)
: base(functionInfo.ProjectState._generatorType)
{
_functionInfo = functionInfo;
var nextMeth = VariableDict["next"];
var sendMeth = VariableDict["send"];
_nextMethod = new GeneratorNextBoundBuiltinMethodInfo(this, (BuiltinMethodInfo)nextMeth.First());
_sendMethod = new GeneratorSendBoundBuiltinMethodInfo(this, (BuiltinMethodInfo)sendMeth.First());
_sends = new VariableDef();
}
开发者ID:TerabyteX,项目名称:main,代码行数:12,代码来源:GeneratorInfo.cs
示例13: CartesianProductFunctionAnalysisUnit
public CartesianProductFunctionAnalysisUnit(UserFunctionValue funcInfo, EnvironmentRecord environment, AnalysisUnit outerUnit, UserFunctionValue.CallArgs callArgs, VariableDef returnValue)
: base(funcInfo, outerUnit, environment.Parent, outerUnit.ProjectEntry, environment) {
_callArgs = callArgs;
_returnValue = returnValue;
_this = new VariableDef();
var funcScope = environment as FunctionEnvironmentRecord;
var specLocals = new List<CartesianLocalVariable>();
ProcessVariablesForScope(funcScope, specLocals);
_specializedLocals = specLocals.ToArray();
}
开发者ID:lioaphy,项目名称:nodejstools,代码行数:12,代码来源:CarteseanProductFunctionAnalysisUnit.cs
示例14: SetVariable
public override void SetVariable(VariableDef value, object obj)
{
base.SetVariable(value, obj);
string selectionName = "";
if (value != null)
{
ParInfo par = value.Value as ParInfo;
if (par != null)
selectionName = par.Name;
}
setComboBox(selectionName);
}
开发者ID:KeyleXiao,项目名称:behaviac,代码行数:14,代码来源:DesignerParEnumEditor.cs
示例15: FunctionScope
public FunctionScope(
FunctionInfo function,
Node node,
InterpreterScope declScope,
IPythonProjectEntry declModule
)
: base(function, node, declScope) {
ReturnValue = new VariableDef();
if (Function.FunctionDefinition.IsCoroutine) {
Coroutine = new CoroutineInfo(function.ProjectState, declModule);
ReturnValue.AddTypes(function.ProjectEntry, Coroutine.SelfSet, false);
} else if (Function.FunctionDefinition.IsGenerator) {
Generator = new GeneratorInfo(function.ProjectState, declModule);
ReturnValue.AddTypes(function.ProjectEntry, Generator.SelfSet, false);
}
}
开发者ID:wenh123,项目名称:PTVS,代码行数:16,代码来源:FunctionScope.cs
示例16: FunctionEnvironmentRecord
//public readonly GeneratorInfo Generator;
public FunctionEnvironmentRecord(
UserFunctionValue function,
FunctionAnalysisUnit analysisUnit,
Node node,
EnvironmentRecord declScope,
IJsProjectEntry declModule
)
: base(node, declScope) {
_function = function;
_this = new VariableDef();
AnalysisUnit = analysisUnit;
#if FALSE
if (Function.FunctionObject.IsGenerator) {
Generator = new GeneratorInfo(function.ProjectState, declModule);
ReturnValue.AddTypes(function.ProjectEntry, Generator.SelfSet, false);
}
#endif
}
开发者ID:CforED,项目名称:Node.js-Tools-for-Visual-Studio,代码行数:20,代码来源:FunctionEnvironmentRecord.cs
示例17: GetValue
public IAnalysisSet GetValue(Node node, AnalysisUnit unit, ProjectEntry declaringScope, IAnalysisSet @this, bool addRef) {
if (Values == null) {
Values = new EphemeralVariableDef();
}
var res = Values.GetTypes(unit, declaringScope);
if (res.Count > 0) {
// Don't add references to ephemeral values... If they
// gain types we'll re-enqueue and the reference will be
// added then.
if (addRef && !Values.IsEphemeral) {
Values.AddReference(node, unit);
}
}
if (Getter != null) {
res = res.Union(Getter.GetTypesNoCopy(unit, declaringScope).Call(node, unit, @this, ExpressionEvaluator.EmptySets));
}
return res;
}
开发者ID:lioaphy,项目名称:nodejstools,代码行数:22,代码来源:PropertyDescriptorValue.cs
示例18: setParameter
protected VariableDef setParameter(NodeTag.DefaultObject node, string propertyType, string propertyName)
{
List<ParInfo> allPars = new List<ParInfo>();
((Nodes.Node)node.Behavior).GetAllPars(ref allPars);
if (allPars.Count > 0)
{
string fullname = string.Format("{0} {1}", propertyType, propertyName);
foreach (ParInfo p in allPars)
{
if (p.ToString() == fullname)
{
VariableDef v = new VariableDef(p);
v.SetValue(p, VariableDef.kPar);
return v;
}
}
}
return null;
}
开发者ID:KeyleXiao,项目名称:behaviac,代码行数:20,代码来源:DesignerPropertyEnum.cs
示例19: parseConstVar
protected VariableDef parseConstVar(NodeTag.DefaultObject node, object parentObject, string str)
{
Debug.Check(str.StartsWith("const"));
//const Int32 1
object propertyMemberDepended = null;
Type objType = node.GetType();
if (this.DependedProperty != "")
{
System.Reflection.PropertyInfo pi = objType.GetProperty(this.DependedProperty);
if (pi != null)
{
propertyMemberDepended = pi.GetValue(node, null);
}
else if (pi == null && parentObject != null)
{
Type parentType = parentObject.GetType();
pi = parentType.GetProperty(this.DependedProperty);
propertyMemberDepended = pi.GetValue(parentObject, null);
}
}
Type valueType = null;
VariableDef variableDepended = propertyMemberDepended as VariableDef;
if (variableDepended != null)
{
valueType = variableDepended.GetValueType();
}
else if (propertyMemberDepended != null)
{
MethodDef methodDepended = propertyMemberDepended as MethodDef;
if (methodDepended != null)
{
valueType = methodDepended.ReturnType;
}
else
{
RightValueDef varRV = propertyMemberDepended as RightValueDef;
if (varRV != null)
{
valueType = varRV.ValueType;
}
}
}
else
{
string[] tokens = str.Split(' ');
Debug.Check(tokens.Length == 3);
valueType = Plugin.GetTypeFromName(tokens[1]);
}
if (valueType != null)
{
VariableDef variable = new VariableDef(null);
string[] tokens = str.Split(' ');
Debug.Check(tokens.Length == 3);
Plugin.InvokeTypeParser(valueType, tokens[2],
(object value) => variable.Value = value,
node);
return variable;
}
return null;
}
开发者ID:KeyleXiao,项目名称:behaviac,代码行数:69,代码来源:DesignerPropertyEnum.cs
示例20: DictParameterVariableDef
public DictParameterVariableDef(AnalysisUnit unit, Node location, VariableDef copy)
: base(unit.DeclaringModule.ProjectEntry, location, copy) {
Dict = new StarArgsDictionaryInfo(unit.ProjectEntry, location);
AddTypes(unit, Dict);
}
开发者ID:omnimark,项目名称:PTVS,代码行数:5,代码来源:DictionaryInfo.cs
注:本文中的VariableDef类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论