本文整理汇总了C#中Kirikiri.Tjs2.Variant类的典型用法代码示例。如果您正苦于以下问题:C# Variant类的具体用法?C# Variant怎么用?C# Variant使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Variant类属于Kirikiri.Tjs2命名空间,在下文中一共展示了Variant类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: AddArrayElement
/// <exception cref="Kirikiri.Tjs2.TJSException"></exception>
/// <exception cref="Kirikiri.Tjs2.VariantException"></exception>
public void AddArrayElement(Variant val)
{
string ss_add = "add";
Variant[] args = new Variant[1];
args[0] = val;
mVal.AsObjectClosure().FuncCall(0, ss_add, null, args, null);
}
开发者ID:fantasydr,项目名称:krkr-cs,代码行数:9,代码来源:ExprNode.cs
示例2: NativeClass
public NativeClass(string name)
: base()
{
mCallFinalize = false;
mClassName = TJS.MapGlobalStringMap(name);
mWorkParam = new Variant();
}
开发者ID:fantasydr,项目名称:krkr-cs,代码行数:7,代码来源:NativeClass.cs
示例3: PostClear
public virtual void PostClear()
{
mName = null;
mValue = null;
mValue = new Variant();
mSymFlags &= ~SYMBOL_USING;
}
开发者ID:fantasydr,项目名称:krkr-cs,代码行数:7,代码来源:SymbolData.cs
示例4: CreateNew
/// <exception cref="Kirikiri.Tjs2.VariantException"></exception>
/// <exception cref="Kirikiri.Tjs2.TJSException"></exception>
public override int CreateNew(int flag, string membername, Holder<Dispatch2> result
, Variant[] param, Dispatch2 objthis)
{
// CreateNew
Dispatch2 dsp = CreateBaseTJSObject();
// instance initialization
//int hr = funcCall( 0, null, null, null, dsp); // add member to dsp
// 生成を高速化するためにメンバコピーを特别处理する形で实装
dsp.AddClassInstanveInfo(mClassName);
NativeInstance nativeptr = CreateNativeInstance();
dsp.SetNativeInstance(mClassIDInternal, nativeptr);
int hr = CopyAllMembers((CustomObject)dsp);
if (hr < 0)
{
return hr;
}
hr = base.FuncCall(0, mClassName, null, param, dsp);
// call constructor
// call the constructor
if (hr == Error.E_MEMBERNOTFOUND)
{
hr = Error.S_OK;
}
// missing constructor is OK ( is this ugly ? )
if (hr >= 0)
{
result.Set(dsp);
}
return hr;
}
开发者ID:fantasydr,项目名称:krkr-cs,代码行数:32,代码来源:NativeClass.cs
示例5: RegExpNI
public RegExpNI()
{
mFlags = RegExpFlagToValue((char)0, 0);
//mStart = 0;
//mIndex =0;
//mLastIndex = 0;
mArray = new Variant();
}
开发者ID:fantasydr,项目名称:krkr-cs,代码行数:8,代码来源:RegExpNI.cs
示例6: FuncCall
/// <exception cref="Kirikiri.Tjs2.VariantException"></exception>
/// <exception cref="Kirikiri.Tjs2.TJSException"></exception>
public override int FuncCall(int flag, string membername, Variant result, Variant
[] param, Dispatch2 objthis)
{
if (membername != null)
{
return base.FuncCall(flag, membername, result, param, objthis);
}
return Process(result, param, objthis);
}
开发者ID:fantasydr,项目名称:krkr-cs,代码行数:11,代码来源:NativeConvertedFunction.cs
示例7: CreateNew
// create new object
/// <exception cref="Kirikiri.Tjs2.VariantException"></exception>
/// <exception cref="Kirikiri.Tjs2.TJSException"></exception>
public override int CreateNew(int flag, string memberName, Holder<Dispatch2> result
, Variant[] param, Dispatch2 objThis)
{
if (IsNumber(memberName, Result))
{
return CreateNewByNum(flag, Result[0], result, param, objThis);
}
return base.CreateNew(flag, memberName, result, param, objThis);
}
开发者ID:fantasydr,项目名称:krkr-cs,代码行数:12,代码来源:ArrayObject.cs
示例8: SelfClear
public virtual void SelfClear()
{
mName = null;
mHash = 0;
mFlags = 0;
mValue = new Variant();
mNext = null;
mSymFlags = SYMBOL_INIT;
}
开发者ID:fantasydr,项目名称:krkr-cs,代码行数:9,代码来源:SymbolData.cs
示例9: CreateNewByNum
/// <exception cref="Kirikiri.Tjs2.TJSException"></exception>
/// <exception cref="Kirikiri.Tjs2.VariantException"></exception>
public virtual int CreateNewByNum(int flag, int num, Holder<Dispatch2> result, Variant
[] param, Dispatch2 objThis)
{
if (mObject == null)
{
throw new TJSException(Error.NullAccess);
}
return mObject.CreateNewByNum(flag, num, result, param, mObjThis != null ? mObjThis
: (objThis != null ? objThis : mObject));
}
开发者ID:fantasydr,项目名称:krkr-cs,代码行数:12,代码来源:VariantClosure.cs
示例10: PropSet
public override int PropSet(int flag, string membername, Variant param, Dispatch2
objThis)
{
if (membername != null)
{
return Error.E_MEMBERNOTFOUND;
}
mValue.Set(param);
return Error.S_OK;
}
开发者ID:fantasydr,项目名称:krkr-cs,代码行数:10,代码来源:SimpleGetSetProperty.cs
示例11: CreateNew
/// <exception cref="Kirikiri.Tjs2.VariantException"></exception>
/// <exception cref="Kirikiri.Tjs2.TJSException"></exception>
public override int CreateNew(int flag, string membername, Holder<Dispatch2> result
, Variant[] param, Dispatch2 objthis)
{
int hr = base.CreateNew(flag, membername, result, param, objthis);
if (hr == Error.E_MEMBERNOTFOUND && (flag & Interface.MEMBERMUSTEXIST) == 0)
{
return Error.E_INVALIDTYPE;
}
// call operation for void
return hr;
}
开发者ID:fantasydr,项目名称:krkr-cs,代码行数:13,代码来源:DictionaryObject.cs
示例12: SaveStructuredDataForObject
/// <exception cref="Kirikiri.Tjs2.VariantException"></exception>
/// <exception cref="Kirikiri.Tjs2.TJSException"></exception>
public static void SaveStructuredDataForObject(Dispatch2 dsp, AList<Dispatch2> stack
, TextWriteStreamInterface stream, string indentstr)
{
// check object recursion
int count = stack.Count;
for (int i = 0; i < count; i++)
{
Dispatch2 d = stack[i];
if (d == dsp)
{
// object recursion detected
stream.Write("null /* object recursion detected */");
return;
}
}
// determin dsp's object type
DictionaryNI dicni;
ArrayNI arrayni;
if (dsp != null)
{
dicni = (DictionaryNI)dsp.GetNativeInstance(DictionaryClass.ClassID);
if (dicni != null)
{
// dictionary
stack.AddItem(dsp);
dicni.SaveStructuredData(stack, stream, indentstr);
stack.Remove(stack.Count - 1);
return;
}
else
{
arrayni = (ArrayNI)dsp.GetNativeInstance(ArrayClass.ClassID);
if (arrayni != null)
{
// array
stack.AddItem(dsp);
arrayni.SaveStructuredData(stack, stream, indentstr);
stack.Remove(stack.Count - 1);
return;
}
else
{
// other objects
stream.Write("null /* (object) \"");
// stored as a null
Variant val = new Variant(dsp, dsp);
stream.Write(LexBase.EscapeC(val.AsString()));
stream.Write("\" */");
return;
}
}
}
stream.Write("null");
}
开发者ID:fantasydr,项目名称:krkr-cs,代码行数:56,代码来源:ArrayNI.cs
示例13: CreateNewByNum
/// <exception cref="Kirikiri.Tjs2.VariantException"></exception>
/// <exception cref="Kirikiri.Tjs2.TJSException"></exception>
public virtual int CreateNewByNum(int flag, int num, Holder<Dispatch2> result, Variant
[] param, Dispatch2 objthis)
{
Dispatch2 OBJ1 = ((objthis != null) ? (objthis) : (mDispatch1));
int hr = mDispatch1.CreateNewByNum(flag, num, result, param, OBJ1);
if (hr == Error.E_MEMBERNOTFOUND && mDispatch1 != mDispatch2)
{
Dispatch2 OBJ2 = ((objthis != null) ? (objthis) : (mDispatch2));
return mDispatch2.CreateNewByNum(flag, num, result, param, OBJ2);
}
return hr;
}
开发者ID:fantasydr,项目名称:krkr-cs,代码行数:14,代码来源:ObjectProxy.cs
示例14: CharacterCodeOf
/// <exception cref="Kirikiri.Tjs2.VariantException"></exception>
public static void CharacterCodeOf(Variant val)
{
string str = val.AsString();
if (str != null)
{
int v = str[0];
val.Set(v);
}
else
{
val.Set(0);
}
}
开发者ID:fantasydr,项目名称:krkr-cs,代码行数:14,代码来源:NativeConvertedClassBase.cs
示例15: PropGet
public override int PropGet(int flag, string membername, Variant result, Dispatch2
objthis)
{
if (membername != null)
{
return Error.E_MEMBERNOTFOUND;
}
if (result != null)
{
result.Set(mValue);
}
return Error.S_OK;
}
开发者ID:fantasydr,项目名称:krkr-cs,代码行数:13,代码来源:SimpleGetSetProperty.cs
示例16: PropGet
/// <exception cref="Kirikiri.Tjs2.VariantException"></exception>
/// <exception cref="Kirikiri.Tjs2.TJSException"></exception>
public override int PropGet(int flag, string membername, Variant result, Dispatch2
objthis)
{
int hr = base.PropGet(flag, membername, result, objthis);
if (hr == Error.E_MEMBERNOTFOUND && (flag & Interface.MEMBERMUSTEXIST) == 0)
{
if (result != null)
{
result.Clear();
}
// returns void
return Error.S_OK;
}
return hr;
}
开发者ID:fantasydr,项目名称:krkr-cs,代码行数:17,代码来源:DictionaryObject.cs
示例17: TJS
/// <exception cref="Kirikiri.Tjs2.VariantException"></exception>
/// <exception cref="Kirikiri.Tjs2.TJSException"></exception>
public TJS()
{
// create script cache object
mCache = new ScriptCache(this);
mPPValues = new Dictionary<string, int>();
SetPPValue("version", VERSION_HEX);
SetPPValue("environment", ENV_JAVA_APPLICATION);
// TODO 适切な值を入れる
SetPPValue("compatibleSystem", 1);
// 互换システム true
mGlobal = new CustomObject(GLOBAL_HASH_BITS);
mScriptBlocks = new AList<WeakReference<ScriptBlock>>();
Dispatch2 dsp;
Variant val;
// Array
//dsp = new ArrayClass();
dsp = mArrayClass;
val = new Variant(dsp, null);
mGlobal.PropSet(MEMBERENSURE, "Array", val, mGlobal);
// Dictionary
//dsp = new DictionaryClass();
dsp = mDictionayClass;
val = new Variant(dsp, null);
mGlobal.PropSet(MEMBERENSURE, "Dictionary", val, mGlobal);
// Date //TODO: add date back
//dsp = new DateClass();
//val = new Variant(dsp, null);
//mGlobal.PropSet(MEMBERENSURE, "Date", val, mGlobal);
{
// Math
Dispatch2 math;
dsp = math = new MathClass();
val = new Variant(dsp, null);
mGlobal.PropSet(MEMBERENSURE, "Math", val, mGlobal);
// Math.RandomGenerator
dsp = new RandomGeneratorClass();
val = new Variant(dsp, null);
math.PropSet(MEMBERENSURE, "RandomGenerator", val, math);
}
// Exception
dsp = new ExceptionClass();
val = new Variant(dsp, null);
mGlobal.PropSet(MEMBERENSURE, "Exception", val, mGlobal);
// RegExp
dsp = new RegExpClass();
val = new Variant(dsp, null);
mGlobal.PropSet(MEMBERENSURE, "RegExp", val, mGlobal);
}
开发者ID:fantasydr,项目名称:krkr-cs,代码行数:50,代码来源:TJS.cs
示例18: Process
protected internal override int Process(Variant result, Variant[] param, Dispatch2
objthis)
{
DictionaryNI _this = (DictionaryNI)objthis.GetNativeInstance(Kirikiri.Tjs2.DictionaryClass
.ClassID);
if (_this == null)
{
return Error.E_NATIVECLASSCRASH;
}
int hr = _this.Construct(param, objthis);
if (hr < 0)
{
return hr;
}
return Error.S_OK;
}
开发者ID:fantasydr,项目名称:krkr-cs,代码行数:16,代码来源:DictionaryClass.cs
示例19: Operation
/// <exception cref="Kirikiri.Tjs2.VariantException"></exception>
/// <exception cref="Kirikiri.Tjs2.TJSException"></exception>
public override int Operation(int flag, string membername, Variant result, Variant
param, Dispatch2 objthis)
{
int hr = base.Operation(flag, membername, result, param, objthis);
if (hr == Error.E_MEMBERNOTFOUND && (flag & Interface.MEMBERMUSTEXIST) == 0)
{
// value not found -> create a value, do the operation once more
hr = base.PropSet(Interface.MEMBERENSURE, membername, VoidVal, objthis);
if (hr < 0)
{
return hr;
}
hr = base.Operation(flag, membername, result, param, objthis);
}
return hr;
}
开发者ID:fantasydr,项目名称:krkr-cs,代码行数:18,代码来源:DictionaryObject.cs
示例20: FuncCall
/// <exception cref="Kirikiri.Tjs2.VariantException"></exception>
/// <exception cref="Kirikiri.Tjs2.TJSException"></exception>
public override int FuncCall(int flag, string membername, Variant result, Variant
[] param, Dispatch2 objthis)
{
if (membername != null)
{
return base.FuncCall(flag, membername, result, param, objthis);
}
if (objthis == null)
{
return Error.E_NATIVECLASSCRASH;
}
if (result != null)
{
result.Clear();
}
return Process(result, param, objthis);
}
开发者ID:fantasydr,项目名称:krkr-cs,代码行数:19,代码来源:NativeClassMethod.cs
注:本文中的Kirikiri.Tjs2.Variant类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论