本文整理汇总了C#中Kirikiri.Tjs2.Variant类的典型用法代码示例。如果您正苦于以下问题:C# Variant类的具体用法?C# Variant怎么用?C# Variant使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Variant类属于Kirikiri.Tjs2命名空间,在下文中一共展示了Variant类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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);
}
示例2: NativeClass
public NativeClass(string name)
: base()
{
mCallFinalize = false;
mClassName = TJS.MapGlobalStringMap(name);
mWorkParam = new Variant();
}
示例3: PostClear
public virtual void PostClear()
{
mName = null;
mValue = null;
mValue = new Variant();
mSymFlags &= ~SYMBOL_USING;
}
示例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;
}
示例5: RegExpNI
public RegExpNI()
{
mFlags = RegExpFlagToValue((char)0, 0);
//mStart = 0;
//mIndex =0;
//mLastIndex = 0;
mArray = new Variant();
}
示例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);
}
示例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);
}
示例8: SelfClear
public virtual void SelfClear()
{
mName = null;
mHash = 0;
mFlags = 0;
mValue = new Variant();
mNext = null;
mSymFlags = SYMBOL_INIT;
}
示例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));
}
示例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;
}
示例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;
}
示例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");
}
示例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;
}
示例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);
}
}
示例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;
}