本文整理汇总了C#中Dict类的典型用法代码示例。如果您正苦于以下问题:C# Dict类的具体用法?C# Dict怎么用?C# Dict使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Dict类属于命名空间,在下文中一共展示了Dict类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: SendRequest
protected void SendRequest(string rPath, Dict<string, string> rArgs, ServerType rType, Action<WWW> rOnResponse)
{
var url = HttpServerHost + rPath;
useServerType = rType;
WaitingLayer.Show();
this.StartCoroutine(GET(url, rArgs, rOnResponse));
}
开发者ID:meta-42,项目名称:uEasyKit,代码行数:7,代码来源:HttpRequestBase.cs
示例2: V_VNA
public static void V_VNA(NetwRunnable nr, ExecHm rc, Bys m, out string name, out IDictionary<string, Object> args)
{
var res = new Dict(m.V<Dictionary<string, object>>());
name = res.Val("name", "");
var obj = res["args"];
args = res["args"] as IDictionary<string,object>;
}
开发者ID:Centny,项目名称:cswf,代码行数:7,代码来源:ExecHm.cs
示例3: GeneratorAssetbundleEntry
static List<AssetBundleBuild> GeneratorAssetbundleEntry()
{
string path = Application.dataPath + "/" + PackagePlatform.packageConfigPath;
if (string.IsNullOrEmpty(path)) return null;
string str = File.ReadAllText(path);
Dict<string, ABEntry> abEntries = new Dict<string, ABEntry>();
PackageConfig apc = JsonUtility.FromJson<PackageConfig>(str);
AssetBundlePackageInfo[] bundlesInfo = apc.bundles;
for (int i = 0; i < bundlesInfo.Length; i++)
{
ABEntry entry = new ABEntry();
entry.bundleInfo = bundlesInfo[i];
if (!abEntries.ContainsKey(entry.bundleInfo.name))
{
abEntries.Add(entry.bundleInfo.name, entry);
}
}
List<AssetBundleBuild> abbList = new List<AssetBundleBuild>();
foreach (var rEntryItem in abEntries)
{
abbList.AddRange(rEntryItem.Value.ToABBuild());
}
return abbList;
}
开发者ID:meta-42,项目名称:uEasyKit,代码行数:31,代码来源:AssetBundlePackage.cs
示例4: GLTexture
/// <summary>
/// Create OpenGL object specifying the referenced scene objects directly.
/// </summary>
/// <param name="block"></param>
/// <param name="scene"></param>
/// <param name="glbuff"></param>
/// <param name="glimg"></param>
public GLTexture(Compiler.Block block, Dict scene, GLBuffer glbuff, GLImage glimg)
: base(block.Name, block.Anno)
{
var err = new CompileException($"texture '{name}'");
// PARSE ARGUMENTS
Cmds2Fields(block, err);
// set name
glBuff = glbuff;
glImg = glimg;
// GET REFERENCES
if (Buff != null)
scene.TryGetValue(Buff, out glBuff, block, err);
if (Img != null)
scene.TryGetValue(Img, out glImg, block, err);
if (glBuff != null && glImg != null)
err.Add("Only an image or a buffer can be bound to a texture object.", block);
if (glBuff == null && glImg == null)
err.Add("Ether an image or a buffer has to be bound to a texture object.", block);
// IF THERE ARE ERRORS THROW AND EXCEPTION
if (err.HasErrors())
throw err;
// INCASE THIS IS A TEXTURE OBJECT
Link(block.Filename, block.LineInFile, err);
if (HasErrorOrGlError(err, block))
throw err;
}
开发者ID:h3tch,项目名称:ProtoFX,代码行数:38,代码来源:GLTexture.cs
示例5: btnSure_Click
protected void btnSure_Click(object sender, EventArgs e)
{
Dict dep = new Dict();
WebFormHelper.GetDataFromForm(this, dep);
if(dep.Id<0)
{
if (SimpleOrmOperator.Create(dep))
{
WebTools.Alert("添加成功!");
}
else
{
WebTools.Alert("添加失败!");
}
}
else{
if (SimpleOrmOperator.Update(dep))
{
WebTools.Alert("修改成功!");
}
else
{
WebTools.Alert("修改失败!");
}
}
}
开发者ID:romanu6891,项目名称:fivemen,代码行数:29,代码来源:DictEdit.aspx.cs
示例6: GLFragoutput
/// <summary>
/// Create OpenGL object. Standard object constructor for ProtoFX.
/// </summary>
/// <param name="block"></param>
/// <param name="scene"></param>
/// <param name="debugging"></param>
public GLFragoutput(Compiler.Block block, Dict scene, bool debugging)
: base(block.Name, block.Anno)
{
var err = new CompileException($"fragoutput '{name}'");
// PARSE ARGUMENTS
Cmds2Fields(block, err);
// CREATE OPENGL OBJECT
glname = GL.GenFramebuffer();
GL.BindFramebuffer(FramebufferTarget.Framebuffer, glname);
// PARSE COMMANDS
foreach (var cmd in block)
Attach(cmd, scene, err | $"command '{cmd.Name}'");
// if any errors occurred throw exception
if (err.HasErrors())
throw err;
// CHECK FOR OPENGL ERRORS
Bind();
var status = GL.CheckFramebufferStatus(FramebufferTarget.Framebuffer);
Unbind();
// final error checks
if (HasErrorOrGlError(err, block))
throw err;
if (status != FramebufferErrorCode.FramebufferComplete)
throw err.Add("Could not be created due to an unknown error.", block);
}
开发者ID:h3tch,项目名称:ProtoFX,代码行数:37,代码来源:GLFragoutput.cs
示例7: GLVertoutput
/// <summary>
/// Create OpenGL object. Standard object constructor for ProtoFX.
/// </summary>
/// <param name="block"></param>
/// <param name="scene"></param>
/// <param name="debugging"></param>
public GLVertoutput(Compiler.Block block, Dict scene, bool debugging)
: base(block.Name, block.Anno)
{
var err = new CompileException($"vertoutput '{name}'");
// PARSE ARGUMENTS
Cmds2Fields(block, err);
// CREATE OPENGL OBJECT
glname = GL.GenTransformFeedback();
GL.BindTransformFeedback(TransformFeedbackTarget.TransformFeedback, glname);
// parse commands
int numbindings = 0;
foreach (var cmd in block["buff"])
Attach(numbindings++, cmd, scene, err | $"command '{cmd.Text}'");
// if errors occurred throw exception
if (err.HasErrors())
throw err;
// unbind object and check for errors
GL.BindTransformFeedback(TransformFeedbackTarget.TransformFeedback, 0);
if (HasErrorOrGlError(err, block))
throw err;
}
开发者ID:h3tch,项目名称:ProtoFX,代码行数:32,代码来源:GLVertoutput.cs
示例8: Dict_List
public static List<Dict> Dict_List(Dict model,int OCID)
{
//if (!UserService.OC_IsRole(OCID))
//{
// return null;
//}
AffairsBLL affairsBLL = new AffairsBLL();
return affairsBLL.Dict_List(model);
}
开发者ID:holdbase,项目名称:IES2,代码行数:9,代码来源:AffairsProvider.aspx.cs
示例9: ParsePasses
/// <summary>
/// Parse commands in block.
/// </summary>
/// <param name="list"></param>
/// <param name="block"></param>
/// <param name="scene"></param>
/// <param name="err"></param>
private void ParsePasses(ref List<GLPass> list, Compiler.Block block, Dict scene,
CompileException err)
{
GLPass pass;
var cmdName = ReferenceEquals(list, init)
? "init" : ReferenceEquals(list, passes) ? "pass" : "uninit";
foreach (var cmd in block[cmdName])
if (scene.TryGetValue(cmd[0].Text, out pass, block, err | $"command '{cmd.Text}'"))
list.Add(pass);
}
开发者ID:h3tch,项目名称:ProtoFX,代码行数:17,代码来源:GLTech.cs
示例10: LoggingHandler
static void LoggingHandler(Logger.Level level, string message, Dict args)
{
if (args != null)
{
foreach (string key in args.Keys) {
message += string.Format(" {0}: {1},", "" + key, "" + args[key]);
}
}
Console.WriteLine("[ActionTests] [{0}] {1}", level, message);
}
开发者ID:detroitpro,项目名称:Analytics.Xamarin,代码行数:10,代码来源:ActionTests.cs
示例11: Page
public Page(Page p_pParentPage)
{
this.Parent = p_pParentPage;
this.Document = new HtmlDocument();
this.MetaInfo = new List<PageMeta>();
this.MetaLinkInfo = new List<PageMetaLink>();
this.AnchorList = new List<Anchor>();
this.ImageList = new List<Image>();
this.OtherTags = new Dict<string, string>();
this.DirectChildren = new List<Page>();
}
开发者ID:Green-Orca,项目名称:WebStuffCore,代码行数:11,代码来源:Page.cs
示例12: GetAttrDict
public override Dict GetAttrDict(ICallerContext context, object self)
{
List attrs = GetAttrNames(context, self);
Dict res = new Dict();
foreach (string o in attrs) {
res[o] = GetAttr(context, self, SymbolTable.StringToId(o));
}
return res;
}
开发者ID:FabioNascimento,项目名称:DICommander,代码行数:11,代码来源:ReflectedAssembly.cs
示例13: SaveDict
public void SaveDict(Dict domain)
{
using (Transaction trans = UnitOfWork.BeginTransaction(typeof(Dict)))
{
repository.SaveOrUpdate(domain);
foreach (var item in domain.DictItems)
repository.SaveOrUpdate(item);
trans.Commit();
}
}
开发者ID:AgileEAP,项目名称:WebStack,代码行数:12,代码来源:UtilService.cs
示例14: ItShouldAdd
public void ItShouldAdd()
{
Dict<int, string> test = new Dict<int, string>();
test.Add(1, "One");
test.Add(2, "Two");
test.Add(3, "Three");
test.Add(4, "Four");
test.Add(5, "Five");
bool actual = test.ContainsKey(1);
bool expected = true;
Assert.AreEqual(expected, actual);
}
开发者ID:bogdanuifalean,项目名称:JuniorMind,代码行数:12,代码来源:DictTest.cs
示例15: ItShouldGetValueForSpecificKey
public void ItShouldGetValueForSpecificKey()
{
Dict<int, string> test = new Dict<int, string>();
test.Add(1, "One");
test.Add(2, "Two");
test.Add(3, "Three");
test.Add(4, "Four");
test.Add(5, "Five");
test.Add(18, "Eightteen");
string actual = test[18];
string expected = "Eightteen";
Assert.AreEqual(expected, actual);
}
开发者ID:bogdanuifalean,项目名称:JuniorMind,代码行数:13,代码来源:DictTest.cs
示例16: SendBatch
public void SendBatch(Batch batch)
{
Dict props = new Dict {
{ "batch id", batch.MessageId },
{ "batch size", batch.batch.Count }
};
try
{
// set the current request time
batch.SentAt = DateTime.Now.ToString("o");
string json = JsonConvert.SerializeObject(batch);
props["json size"] = json.Length;
Uri uri = new Uri(_host + "/v1/import");
HttpRequestMessage request = new HttpRequestMessage(HttpMethod.Post, uri);
// basic auth: https://segment.io/docs/tracking-api/reference/#authentication
request.Headers.Add("Authorization", BasicAuthHeader(batch.WriteKey, ""));
request.Content = new StringContent(json, Encoding.UTF8, "application/json");
Logger.Info("Sending analytics request to Segment.io ..", props);
var start = DateTime.Now;
var response = _client.SendAsync(request).Result;
var duration = DateTime.Now - start;
props["success"] = response.IsSuccessStatusCode;
props["duration (ms)"] = duration.TotalMilliseconds;
if (response.IsSuccessStatusCode) {
Succeed(batch);
Logger.Info("Request successful", props);
}
else {
string reason = string.Format("Status Code {0} ", response.StatusCode);
reason += response.Content.ToString();
props["reason"] = reason;
Logger.Error("Request failed", props);
Fail(batch, new APIException("Unexpected Status Code", reason));
}
}
catch (System.Exception e)
{
props ["reason"] = e.Message;
Logger.Error ("Request failed", props);
Fail(batch, e);
}
}
开发者ID:jacksierkstra,项目名称:Analytics.Xamarin,代码行数:51,代码来源:BlockingRequestHandler.cs
示例17: OnFfProc
public virtual HResult OnFfProc(Request r)
{
var args = HttpUtility.ParseQueryString(r.req.Url.Query);
var tid = args.Get("tid");
var duration_ = args.Get("duration");
if (String.IsNullOrWhiteSpace(tid) || String.IsNullOrWhiteSpace(duration_))
{
r.res.StatusCode = 400;
r.WriteLine("the tid/duration is required");
return HResult.HRES_RETURN;
}
float duration = 0;
if (!float.TryParse(duration_, out duration))
{
r.res.StatusCode = 400;
r.WriteLine("the duration must be float");
return HResult.HRES_RETURN;
}
StreamReader reader = new StreamReader(r.req.InputStream);
String line = null;
var frame = new Dict();
while ((line = reader.ReadLine()) != null)
{
line = line.Trim();
if (line.Length < 1)
{
continue;
}
var kvs = line.Split(new char[] { '=' }, 2);
var key = kvs[0].Trim();
if (kvs.Length < 2)
{
frame[key] = "";
}
else
{
frame[key] = kvs[1].Trim();
}
if (key != "progress")
{
continue;
}
var ms = frame.Val<float>("out_time_ms", 0);
this.DTMC.NotifyProc(tid, ms / duration);
}
r.res.StatusCode = 200;
r.WriteLine("OK");
r.Flush();
return HResult.HRES_RETURN;
}
开发者ID:Centny,项目名称:ffcm,代码行数:50,代码来源:FFCM.cs
示例18: Initilize
/// <summary>
/// (Re)initialize the debugger. This method must
/// be called whenever a program is compiled.
/// </summary>
/// <param name="scene"></param>
public static void Initilize(Dict scene)
{
// allocate GPU resources
buf = new GLBuffer(DbgBufKey, "dbg", BufferUsageHint.DynamicRead, stage_size * 6 * 16);
tex = new GLTexture(DbgTexKey, "dbg", GpuFormat.Rgba32f, buf, null);
#if DEBUG // add to scene for debug inspection
scene.Add(DbgBufKey, buf);
scene.Add(DbgTexKey, tex);
#endif
passes.Clear();
// reset watch count for indexing in debug mode
dbgVarCount = 0;
}
开发者ID:h3tch,项目名称:ProtoFX,代码行数:19,代码来源:FXDebugger.cs
示例19: GLTech
/// <summary>
/// Create OpenGL object. Standard object constructor for ProtoFX.
/// </summary>
/// <param name="block"></param>
/// <param name="scene"></param>
/// <param name="debugging"></param>
public GLTech(Compiler.Block block, Dict scene, bool debugging)
: base(block.Name, block.Anno)
{
var err = new CompileException($"tech '{name}'");
// PARSE COMMANDS
ParsePasses(ref init, block, scene, err);
ParsePasses(ref passes, block, scene, err);
ParsePasses(ref uninit, block, scene, err);
// IF THERE ARE ERRORS THROW AND EXCEPTION
if (err.HasErrors())
throw err;
}
开发者ID:h3tch,项目名称:ProtoFX,代码行数:20,代码来源:GLTech.cs
示例20: ItShouldRemove
public void ItShouldRemove()
{
Dict<int, string> test = new Dict<int, string>();
test.Add(1, "One");
test.Add(2, "Two");
test.Add(3, "Three");
test.Add(4, "Four");
test.Add(5, "Five");
test.Add(18, "Eightteen");
test.Remove(3);
bool actual=test.ContainsKey(3);
bool expected=false;
Assert.AreEqual(expected, actual);
}
开发者ID:bogdanuifalean,项目名称:JuniorMind,代码行数:14,代码来源:DictTest.cs
注:本文中的Dict类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论