Пример #1
0
 public override Boolean performTask(FileObj fileObj)
 {
     if (appObject.clearProperty())
     {
         msg.doMsg("Properties cleared for file.");
         return true;
     }
     else
     {
         msg.doErrorMsg("Property could not be cleared.");
         return false;
     }
 }
Пример #2
0
 public override Boolean performTask(FileObj fileObj)
 {
     if (appObject.updateProperty(propName, propValue))
     {
         msg.doMsg("Property updated for file.");
         return true;
     }
     else
     {
         msg.doErrorMsg("Property could not be updated.");
         return false;
     }
 }
Пример #3
0
        public override bool openDocument(FileObj file)
        {
            try
            {
                SwDmDocumentOpenError oError;
                swType = docTypeForExtension(file.ext);
                if (swType != SwDmDocumentType.swDmDocumentUnknown)
                {
                    doc = (SwDMDocument10)app.GetDocument(file.path, swType, false, out oError);
                    if (doc != null && 
                        (int)oError == (int)SwDmDocumentOpenError.swDmDocumentOpenErrorNone)
                        return true;
                }
            }
            catch {}

            doc = null;
            return false;
        }
Пример #4
0
        public override Boolean performTask(FileObj fileObj)
        {
            if (appObject.calculateMass(fileObj))
            {
                String message = "Mass calculated for file";
                if (fileObj.resultCode == -2)
                    message += " but one or more configurations failed. Update SW performance settings to update mass properties while saving document";

                msg.doMsg(message + ".");
                return true;
            }
            else
            {
                String message = "Mass could not be obtained";
                if (fileObj.resultCode == -2)
                    message += " due to missing mass property. Update SW performance settings to update mass properties while saving document";

                msg.doErrorMsg(message + ".");
                return false;
            }
        }
Пример #5
0
 public override bool calculateMass(FileObj fileObj)
 {
     throw new NotImplementedException();
 }
Пример #6
0
 public override bool openDocument(FileObj fileObj)
 {
     filePath = fileObj.path;
     return true;
 }
Пример #7
0
 public abstract Boolean performTask(FileObj fileObj);
Пример #8
0
        public override Boolean calculateMass(FileObj currentFile)
        {
            Boolean result = false;
            if (doc != null && currentFile != null)
            {
                try
                {
                    currentFile.massResult = new Dictionary<string, double>();
                    SwDMConfigurationMgr configMgr = doc.ConfigurationManager;
                    if (configMgr != null && configMgr.GetConfigurationCount() > 0)
                    {
                        Array array = configMgr.GetConfigurationNames();
                        foreach (object obj in array)
                        {
                            try
                            {
                                SwDMConfiguration14 cfg = (SwDMConfiguration14)configMgr.GetConfigurationByName((string)obj);
                                String configuration = cfg.Name;

                                if (!configuration.EndsWith("FLAT-PATTERN", StringComparison.OrdinalIgnoreCase))
                                {
                                    Double resultValue = this.handleMassProperty(cfg);
                                    if (resultValue > 0)
                                    {
                                        currentFile.massResult.Add(configuration, resultValue);
                                        result = true;
                                    }
                                    else if (resultValue == -2)
                                    {
                                        currentFile.resultCode = -2;
                                        currentFile.massResult.Add(configuration, resultValue);
                                    }
                                }
                            }
                            catch { }
                        }
                    }                  
                }
                catch { }           
            }
            return result;
        }
Пример #9
0
 public abstract Boolean calculateMass(FileObj fileObj);
Пример #10
0
 public abstract Boolean openDocument(FileObj fileObj);