Пример #1
0
        private void ReadLayer()
        {
            Layers layers = m_doc.Layers;

            for (int layIndex = 1; layIndex <= layers.Count; layIndex++)
            {
                try
                {
                    Console.WriteLine(layIndex);
                    Layer  layer     = layers[layIndex];
                    string layerName = layer.Name.Trim().ToLower();
                    if (layerName.Equals("translation") ||
                        layerName.Equals("translate") ||
                        layerName.Equals("for translation"))
                    {
                        m_xmlProcess.ProcessLayer(layIndex);
                        TextFrames textFrames = layer.TextFrames;
                        ReadTextFrames(textFrames);
                        error = "0";
                    }
                }
                catch (Exception e)
                {
                    CloseFile();
                    m_app.restartApp();
                    throw new Exception();
                }
            }
            if (error == null)
            {
                error = "There is no layer needed to be translated ";
            }
        }
Пример #2
0
        private void ReadLayer()
        {
            Layers layers = m_doc.Layers;

            for (int layIndex = 1; layIndex <= layers.Count; layIndex++)
            {
                try
                {
                    Layer  layer     = layers[layIndex];
                    string layerName = layer.Name.Trim().ToLower();
                    if (layerName.Equals("translation") ||
                        layerName.Equals("translate") ||
                        layerName.Equals("for translation"))
                    {
                        m_xmlProcess.ProcessLayer(layIndex);
                        TextFrames textFrames = layer.TextFrames;
                        ReadTextFrames(textFrames);
                        error = "0";
                        // Sometimes some text is in GroupItems
                        GroupItems groupItems = layer.GroupItems;
                        ReadGroupItems(groupItems);
                    }
                }
                catch (Exception e)
                {
                    m_log.Log(e.ToString());
                    CloseFile();
                    m_app.restartApp();
                    throw new Exception();
                }
            }
            if (error == null)
            {
                error = "There is no layer needed to be translated ";
            }
        }