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


C# IServerConnection.GetCustomProperty方法代码示例

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


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

示例1: SetupRun

        public SetupRun(IServerConnection connection, string[] maps, Dictionary<string, string> args)
            : this()
        {
            m_connection = connection;

            grpDifferentConnection.Enabled = chkUseDifferentConnection.Enabled = !m_connection.ProviderName.ToUpper().Equals("MAESTRO.LOCAL"); //NOXLATE
            m_commandlineargs = args;
            m_coordinateOverrides = new Dictionary<string, IEnvelope>();
            IEnvelope overrideExtents = null;

            //HttpServerConnection hc = connection as HttpServerConnection;
            try
            {
                var url = connection.GetCustomProperty("BaseUrl"); //NOXLATE
                if (url != null)
                    MapAgent.Text = url.ToString();
            }
            catch { }

            if (m_commandlineargs.ContainsKey("mapdefinitions")) //NOXLATE
                m_commandlineargs.Remove("mapdefinitions"); //NOXLATE
            if (m_commandlineargs.ContainsKey("mapagent")) //NOXLATE
                MapAgent.Text = m_commandlineargs["mapagent"]; //NOXLATE
            if (m_commandlineargs.ContainsKey("username")) //NOXLATE
                Username.Text = m_commandlineargs["username"]; //NOXLATE
            if (m_commandlineargs.ContainsKey("password")) //NOXLATE
                Password.Text = m_commandlineargs["password"]; //NOXLATE

            if (m_commandlineargs.ContainsKey("native-connection")) //NOXLATE
                UseNativeAPI.Checked = true;

            if (m_commandlineargs.ContainsKey("limitrows")) //NOXLATE
            {
                int i;
                if (int.TryParse(m_commandlineargs["limitrows"], out i) && i > 0) //NOXLATE
                {
                    MaxRowLimit.Value = i;
                    TilesetLimitPanel.Enabled = true;
                }
            }

            if (m_commandlineargs.ContainsKey("limitcols")) //NOXLATE
            {
                int i;
                if (int.TryParse(m_commandlineargs["limitcols"], out i) && i > 0) //NOXLATE
                {
                    MaxColLimit.Value = i;
                    TilesetLimitPanel.Enabled = true;
                }
            }

            if (m_commandlineargs.ContainsKey("extentoverride")) //NOXLATE
            {
                 string[] parts = m_commandlineargs["extentoverride"].Split(',');
                if (parts.Length == 4)
                {
                    double minx;
                    double miny;
                    double maxx;
                    double maxy;
                    if (
                        double.TryParse(parts[0], System.Globalization.NumberStyles.Float, System.Globalization.CultureInfo.InvariantCulture, out minx) &&
                        double.TryParse(parts[1], System.Globalization.NumberStyles.Float, System.Globalization.CultureInfo.InvariantCulture, out miny) &&
                        double.TryParse(parts[2], System.Globalization.NumberStyles.Float, System.Globalization.CultureInfo.InvariantCulture, out maxx) &&
                        double.TryParse(parts[3], System.Globalization.NumberStyles.Float, System.Globalization.CultureInfo.InvariantCulture, out maxy)
                        )
                    {
                        overrideExtents = ObjectFactory.CreateEnvelope(minx, miny, maxx, maxy);
                    }
                }

            }

            if (m_commandlineargs.ContainsKey("metersperunit")) //NOXLATE
            {
                double d;
                if (
                    double.TryParse(m_commandlineargs["metersperunit"], System.Globalization.NumberStyles.Float, System.Globalization.CultureInfo.CurrentUICulture, out d) //NOXLATE
                    || double.TryParse(m_commandlineargs["metersperunit"], System.Globalization.NumberStyles.Float, System.Globalization.CultureInfo.InvariantCulture, out d) //NOXLATE
                    )
                    if (d >= (double)MetersPerUnit.Minimum && d <= (double)MetersPerUnit.Maximum)
                    {
                        UseOfficialMethod.Checked = true;
                        MetersPerUnit.Value = (decimal)d;
                    }
            }

            if (maps == null || maps.Length == 0 || (maps.Length == 1 && maps[0].Trim().Length == 0))
            {
                List<string> tmp = new List<string>();
                foreach (ResourceListResourceDocument doc in m_connection.ResourceService.GetRepositoryResources(StringConstants.RootIdentifier, ResourceTypes.MapDefinition.ToString()).Items)
                    tmp.Add(doc.ResourceId);
                maps = tmp.ToArray();
            }

            var basegroupsSelected = new List<string>();
            if (m_commandlineargs.ContainsKey("basegroups"))//NOXLATE
            {
                basegroupsSelected = new List<string>(m_commandlineargs["basegroups"].Split(','));//NOXLATE
                m_commandlineargs.Remove("basegroups"); //NOXLATE
//.........这里部分代码省略.........
开发者ID:kanbang,项目名称:Colt,代码行数:101,代码来源:SetupRun.cs

示例2: CreateFromExistingSession

 public override IServerConnection CreateFromExistingSession(IServerConnection orig)
 {
     return ConnectionProviderRegistry.CreateConnection("Maestro.Http",
         HttpServerConnection.PARAM_URL, orig.GetCustomProperty(HttpServerConnection.PROP_BASE_URL).ToString(),
         HttpServerConnection.PARAM_SESSION, orig.SessionID);
 }
开发者ID:kanbang,项目名称:Colt,代码行数:6,代码来源:HttpConnectionTests.cs


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