当前位置: 首页>>代码示例>>C#>>正文


C# Ice.setProperties方法代码示例

本文整理汇总了C#中Ice.setProperties方法的典型用法代码示例。如果您正苦于以下问题:C# Ice.setProperties方法的具体用法?C# Ice.setProperties怎么用?C# Ice.setProperties使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Ice的用法示例。


在下文中一共展示了Ice.setProperties方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: updateProps

 static void updateProps(Ice.PropertiesAdminPrx cprops,
             Ice.PropertiesAdminPrx sprops,
             UpdateCallbackI callback,
             Dictionary<string, string> props,
             string map)
 {
     if(sprops.ice_getConnection() != null)
     {
         cprops.setProperties(getClientProps(cprops, props, map));
         sprops.setProperties(getServerProps(sprops, props, map));
     }
     else
     {
         Dictionary<string, string> clientProps = getClientProps(cprops, props, map);
         Dictionary<string, string> serverProps = getClientProps(sprops, props, map);
         foreach(KeyValuePair<string, string> p in clientProps)
         {
             if(!serverProps.ContainsKey(p.Key))
             {
                 serverProps.Add(p.Key, p.Value);
             }
         }
         cprops.setProperties(serverProps);
     }
     callback.waitForUpdate();
 }
开发者ID:zhangwei5095,项目名称:ice,代码行数:26,代码来源:AllTests.cs

示例2: clearView

    static void clearView(Ice.PropertiesAdminPrx cprops, Ice.PropertiesAdminPrx sprops, UpdateCallbackI callback)
    {
        Dictionary<string, string> dict;

        dict = cprops.getPropertiesForPrefix("IceMX.Metrics");
        dict["IceMX.Metrics.View.Disabled"] = "1";
        cprops.setProperties(dict);

        dict = sprops.getPropertiesForPrefix("IceMX.Metrics");
        dict["IceMX.Metrics.View.Disabled"] = "1";
        sprops.setProperties(dict);

        callback.waitForUpdate();

        dict = cprops.getPropertiesForPrefix("IceMX.Metrics");
        dict["IceMX.Metrics.View.Disabled"] = "";
        cprops.setProperties(dict);

        dict = sprops.getPropertiesForPrefix("IceMX.Metrics");
        dict["IceMX.Metrics.View.Disabled"] = "";
        sprops.setProperties(dict);

        callback.waitForUpdate();
    }
开发者ID:zhangwei5095,项目名称:ice,代码行数:24,代码来源:AllTests.cs

示例3: testAttribute

    static void testAttribute(IceMX.MetricsAdminPrx metrics,
                  Ice.PropertiesAdminPrx props,
                  UpdateCallbackI update,
                  string map,
                  string attr,
                  string value,
                  System.Action func)
    {
        Dictionary<string, string> dict = new Dictionary<string, string>();
        dict.Add("IceMX.Metrics.View.Map." + map + ".GroupBy", attr);
        if(props.ice_getIdentity().category.Equals("client"))
        {
            props.setProperties(getClientProps(props, dict, map));
            update.waitForUpdate();
        }
        else
        {
            props.setProperties(getServerProps(props, dict, map));
            props.setProperties(new Dictionary<string, string>());
        }

        func();
        long timestamp;
        Dictionary<string, IceMX.Metrics[]> view = metrics.getMetricsView("View", out timestamp);
        if(!view.ContainsKey(map) || view[map].Length == 0)
        {
            if(value.Length > 0)
            {
                WriteLine("no map `" + map + "' for group by = `" + attr + "'");
                test(false);
            }
        }
        else if(!view[map][0].id.Equals(value))
        {
            WriteLine("invalid attribute value: " + attr + " = " + value + " got " + view[map][0].id);
            test(false);
        }

        dict.Clear();
        if(props.ice_getIdentity().category.Equals("client"))
        {
            props.setProperties(getClientProps(props, dict, map));
            update.waitForUpdate();
        }
        else
        {
            props.setProperties(getServerProps(props, dict, map));
            props.setProperties(new Dictionary<string, string>());
        }
    }
开发者ID:zhangwei5095,项目名称:ice,代码行数:50,代码来源:AllTests.cs


注:本文中的Ice.setProperties方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。