예제 #1
0
        public familiesFamilylistFamily GetFamily(string path, ref CadDev.LogManager.LogDLG log)
        {
            familiesFamilylistFamily fixt = null;

            try
            {
                if (this != null)
                {
                    string id = GetArticleNumberFromFilename(path, ref log);

                    foreach (familiesFamilylistFamily itemFamily in this.familylist)
                    {
                        if (id == itemFamily.id)
                        {
                            fixt = itemFamily;
                            break;
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                log.AddLogEntry(ex.Message, CadDev.LogManager.LogLevel.Critical, null);
            }
            return(fixt);
        }
예제 #2
0
        public static families DataStructureLoad(ref CadDev.LogManager.LogDLG log, string filename)
        {
            families ds = null;

            if (File.Exists(filename))
            {
                try
                {
                    ds = CadDev.ObjectXmlSerializer.ObjectXMLSerializer <families> .Load(filename);
                }
                catch (Exception ex)
                {
                    log.AddLogEntry(ex.Message, CadDev.LogManager.LogLevel.Critical, null);
                }
            }
            return(ds);
        }
예제 #3
0
        public string GetUpdataDate(ref CadDev.LogManager.LogDLG log)
        {
            string date = "";

            try
            {
                if (this != null)
                {
                    date = this.timestamp;
                }
            }
            catch (Exception ex)
            {
                log.AddLogEntry(ex.Message, CadDev.LogManager.LogLevel.Critical, null);
            }

            return(date);
        }
예제 #4
0
        public string GetArticleNumberFromFilename(string path, ref CadDev.LogManager.LogDLG log)
        {
            string result = "";

            try
            {
                string   temp  = Path.GetFileNameWithoutExtension(path);
                string[] items = temp.Split('_');
                if (items.Count <string>() >= 3)
                {
                    result = items[1];
                }
            }
            catch (Exception ex)
            {
                log.AddLogEntry(ex.Message, CadDev.LogManager.LogLevel.Critical, null);
            }
            return(result);
        }
예제 #5
0
        public bool ContainsFamilyFile(string pathname, ref CadDev.LogManager.LogDLG log)
        {
            bool contains = false;

            try
            {
                if (this != null)
                {
                    string id = GetArticleNumberFromFilename(pathname, ref log);
                    familiesFamilylistFamily fam = GetFamily(pathname, ref log);
                    if (fam != null && fam.id == id)
                    {
                        contains = true;
                    }
                }
            }
            catch (Exception ex)
            {
                log.AddLogEntry(ex.Message, CadDev.LogManager.LogLevel.Critical, null);
            }
            return(contains);
        }
예제 #6
0
        public string GetFileNamesFromArticleNumberAndLanguage(string prefix, string arcticleNr, string language, ref CadDev.LogManager.LogDLG log)
        {
            string result = null;

            try
            {
                result = String.Format("{0}_{1}_{2}", prefix, arcticleNr, language);
            }
            catch (Exception ex)
            {
                log.AddLogEntry(ex.Message, CadDev.LogManager.LogLevel.Critical, null);
            }
            return(result);
        }