本文整理汇总了C#中Dict类的典型用法代码示例。如果您正苦于以下问题:C# Dict类的具体用法?C# Dict怎么用?C# Dict使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
Dict类属于命名空间,在下文中一共展示了Dict类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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));
}
示例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>;
}
示例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;
}
示例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;
}
示例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("修改失败!");
}
}
}
示例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);
}
示例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;
}
示例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);
}
示例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);
}
示例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);
}
示例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>();
}
示例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;
}
示例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();
}
}
示例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);
}
示例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);
}