Exemplo n.º 1
0
 public virtual bool make(KeyPressedData keyPressedData)
 {
     try
     {
         foreach (AppOptions param in m_settings.AppList)
         {
             Maker maker = Maker.CreateInstance(m_dte2, m_settings, param);
             maker.make(keyPressedData);
         }
     }
     catch (Exception e)
     {
         m_logger.Log(e);
     }
     return(true);
 }
Exemplo n.º 2
0
        public virtual bool make(List <Object> objects)
        {
            UInt32 stMax     = (UInt32)(m_settings.AppList.Count * objects.Count);
            UInt32 stCount   = 0;
            UInt32 stSuccess = 0;
            UInt32 stFailed  = 0;

            m_cancelPending = false;

            try
            {
                Started(this, null, "Files proceed...");
                foreach (Object obj in objects)
                {
                    foreach (AppOptions param in m_settings.AppList)
                    {
                        if (param.enable == false)
                        {
                            continue;
                        }
                        bool  maked = false;
                        Maker maker = Maker.CreateInstance(m_dte2, m_settings, param);
                        if (obj is String)
                        {
                            ProgressA(this, null, obj as String, stCount, stMax, stSuccess, stFailed);
                            maked = maker.make(obj as String);
                            ProgressA(this, null, obj as String, stCount, stMax, stSuccess, stFailed);
                        }
                        else if (obj is ProjectItem)
                        {
                            Progress(this, null, obj as ProjectItem, stCount, stMax, stSuccess, stFailed);
                            maked = maker.make(obj as ProjectItem);
                            Progress(this, null, obj as ProjectItem, stCount, stMax, stSuccess, stFailed);
                        }
                        else if (obj is Document)
                        {
                            ProgressB(this, null, obj as Document, stCount, stMax, stSuccess, stFailed);
                            maked = maker.make(obj as Document);
                            ProgressB(this, null, obj as Document, stCount, stMax, stSuccess, stFailed);
                        }
                        ++stCount;
                        if (maked)
                        {
                            ++stSuccess;
                        }
                        else
                        {
                            ++stFailed;
                        }

                        if (m_cancelPending)
                        {
                            return(false);
                        }
                    }
                }
                Finished(this, null);
            }
            catch (Exception e)
            {
                m_logger.Log(e);
            }

            return(true);
        }