本文整理汇总了C#中Proto类的典型用法代码示例。如果您正苦于以下问题:C# Proto类的具体用法?C# Proto怎么用?C# Proto使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Proto类属于命名空间,在下文中一共展示了Proto类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: FromDecimal
public static decimal FromDecimal(Proto.Seto.Decimal sDecimal)
{
var val = new decimal(sDecimal.Value);
// Annoyingly, there is no integer exponentiation
var divisor = new decimal((long)Math.Pow(10, sDecimal.Exponent));
return Math.Round(val / divisor, (int)sDecimal.Exponent);
}
示例2: luaF_freeproto
public static void luaF_freeproto(lua_State L, Proto f)
{
luaM_freearray<Instruction>(L, f.code);
luaM_freearray<Proto>(L, f.p);
luaM_freearray<TValue>(L, f.k);
luaM_freearray<Int32>(L, f.lineinfo);
luaM_freearray<LocVar>(L, f.locvars);
luaM_freearray<TString>(L, f.upvalues);
luaM_free(L, f);
}
示例3: LuaFFreeProto
public static void LuaFFreeProto(LuaState L, Proto f)
{
LuaMFreeArray<Instruction>(L, f.code);
LuaMFreeArray<Proto>(L, f.p);
LuaMFreeArray<TValue>(L, f.k);
LuaMFreeArray<Int32>(L, f.lineinfo);
LuaMFreeArray<LocVar>(L, f.locvars);
LuaMFreeArray<TString>(L, f.upvalues);
LuaMFree(L, f);
}
示例4: FromSeto
internal static MarketQuotes FromSeto(Proto.Seto.MarketQuotes setoQuotes)
{
var quantityType = Quantity.QuantityTypeFromSeto(setoQuotes.QuantityType);
var priceType = Price.PriceTypeFromSeto(setoQuotes.PriceType);
return new MarketQuotes(
Uid.FromUuid128(setoQuotes.Market),
ContractQuotesMap.FromSeto(
setoQuotes.ContractQuotes, priceType, quantityType),
priceType,
quantityType);
}
示例5: LuaUDump
public static int LuaUDump(LuaState L, Proto f, lua_Writer w, object data, int strip)
{
DumpState D = new DumpState();
D.L=L;
D.writer=w;
D.data=data;
D.strip=strip;
D.status=0;
DumpHeader(D);
DumpFunction(f,null,D);
return D.status;
}
示例6: LuaFGetLocalName
/*
** Look for n-th local variable at line `line' in function `func'.
** Returns null if not found.
*/
public static CharPtr LuaFGetLocalName(Proto f, int local_number, int pc)
{
int i;
for (i = 0; i<f.sizelocvars && f.locvars[i].startpc <= pc; i++) {
if (pc < f.locvars[i].endpc) { /* is variable active? */
local_number--;
if (local_number == 0)
return GetStr(f.locvars[i].varname);
}
}
return null; /* not found */
}
示例7: PrintFunction
public static void PrintFunction(Proto f, int full)
{
int i,n=f.sizep;
PrintHeader(f);
PrintCode(f);
if (full != 0)
{
PrintConstants(f);
PrintLocals(f);
PrintUpvalues(f);
}
for (i=0; i<n; i++) PrintFunction(f.p[i],full);
}
示例8: PrintConstant
private static void PrintConstant(Proto f, int i)
{
/*const*/ TValue o=f.k[i];
switch (TType(o))
{
case LUA_TNIL:
printf("nil");
break;
case LUA_TBOOLEAN:
printf(BValue(o) != 0 ? "true" : "false");
break;
case LUA_TNUMBER:
printf(LUA_NUMBER_FMT,NValue(o));
break;
case LUA_TSTRING:
PrintString(RawTSValue(o));
break;
default: /* cannot happen */
printf("? type=%d",TType(o));
break;
}
}
示例9: LoadConstants
private static void LoadConstants(LoadState S, Proto f)
{
int i,n;
n=LoadInt(S);
f.k = luaM_newvector<TValue>(S.L, n);
f.sizek=n;
for (i=0; i<n; i++) setnilvalue(f.k[i]);
for (i=0; i<n; i++)
{
TValue o=f.k[i];
int t=LoadChar(S);
switch (t)
{
case LUA_TNIL:
setnilvalue(o);
break;
case LUA_TBOOLEAN:
setbvalue(o, LoadChar(S));
break;
case LUA_TNUMBER:
setnvalue(o, LoadNumber(S));
break;
case LUA_TSTRING:
setsvalue2n(S.L, o, LoadString(S));
break;
default:
error(S,"bad constant");
break;
}
}
n=LoadInt(S);
f.p=luaM_newvector<Proto>(S.L,n);
f.sizep=n;
for (i=0; i<n; i++) f.p[i]=null;
for (i=0; i<n; i++) f.p[i]=LoadFunction(S,f.source);
}
示例10: SetPTValue2S
//#define setptvalue2s setptvalue
internal static void SetPTValue2S(LuaState L, TValue obj, Proto x)
{
SetPTValue(L, obj, x);
}
示例11: DumpConstants
private static void DumpConstants(Proto f, DumpState D)
{
int i,n=f.sizek;
DumpInt(n,D);
for (i=0; i<n; i++)
{
/*const*/ TValue o=f.k[i];
DumpChar(TType(o),D);
switch (TType(o))
{
case LUA_TNIL:
break;
case LUA_TBOOLEAN:
DumpChar(BValue(o),D);
break;
case LUA_TNUMBER:
DumpNumber(NValue(o),D);
break;
case LUA_TSTRING:
DumpString(RawTSValue(o),D);
break;
default:
LuaAssert(0); /* cannot happen */
break;
}
}
n=f.sizep;
DumpInt(n,D);
for (i=0; i<n; i++) DumpFunction(f.p[i],f.source,D);
}
示例12: DumpDebug
private static void DumpDebug(Proto f, DumpState D)
{
int i,n;
n= (D.strip != 0) ? 0 : f.sizelineinfo;
DumpVector(f.lineinfo, n, D);
n= (D.strip != 0) ? 0 : f.sizelocvars;
DumpInt(n,D);
for (i=0; i<n; i++)
{
DumpString(f.locvars[i].varname,D);
DumpInt(f.locvars[i].startpc,D);
DumpInt(f.locvars[i].endpc,D);
}
n= (D.strip != 0) ? 0 : f.sizeupvalues;
DumpInt(n,D);
for (i=0; i<n; i++) DumpString(f.upvalues[i],D);
}
示例13: setptvalue
internal static void setptvalue(lua_State L, TValue obj, Proto x)
{
obj.value.gc = x;
obj.tt = LUA_TPROTO;
checkliveness(G(L), obj);
}
示例14: Update
internal void Update(Proto.Seto.OrderCancelled message)
{
State.Update(message);
OnStateUpdated();
}
示例15: Deserialize
/// <summary>Helper: put the buffer into a MemoryStream before deserializing</summary>
public static Proto.Test.Nullables.MyMessage Deserialize(byte[] buffer, Proto.Test.Nullables.MyMessage instance)
{
using (var ms = new MemoryStream(buffer))
Deserialize(ms, instance);
return instance;
}