Пример #1
0
  public static CommonDataFrame GetDataFrame(Configuration.MapTabRow mapTab)
	{
    Dictionary<String, CommonDataFrame> dataFrames = GetCachedDataFrames();

    string dataFrameKey = mapTab.GetDataFrameKey();
    CommonDataFrame dataFrame = null;

    if (dataFrames.ContainsKey(dataFrameKey))
    {
      dataFrame = dataFrames[dataFrameKey];
    }
    else
    {
      Dictionary<String, CommonMapService> services = GetCachedServices();
      CommonMapService service = null;

      string serviceKey = mapTab.GetServiceKey("AGS");

      if (services.ContainsKey(serviceKey))
      {
        service = services[serviceKey];
      }
      else
      {
        serviceKey = mapTab.GetServiceKey("ArcIMS");

        if (services.ContainsKey(serviceKey))
        {
          service = services[serviceKey];
        }
      }

      if (service == null)
      {
        service = GetService(mapTab, "AGS");

        if (service == null)
        {
          service = GetService(mapTab, "ArcIMS");
        }
      }

      if (service != null)
      {
        dataFrame = mapTab.IsDataFrameNull() ? service.DefaultDataFrame : service.DataFrames.FirstOrDefault(df => String.Compare(df.Name, mapTab.DataFrame, true) == 0);

        if (dataFrame != null)
        {
          dataFrames.Add(dataFrameKey, dataFrame);
        }
      }
    }

    return dataFrame;
	}