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; } }
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; } }
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; }
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; } }
public override bool calculateMass(FileObj fileObj) { throw new NotImplementedException(); }
public override bool openDocument(FileObj fileObj) { filePath = fileObj.path; return true; }
public abstract Boolean performTask(FileObj fileObj);
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; }
public abstract Boolean calculateMass(FileObj fileObj);
public abstract Boolean openDocument(FileObj fileObj);