private void AddModuleAtPath(ModuleClass moduleClass, string modulePath) { if (fileWatcher != null) { fileWatcher.WatchFile(modulePath); } var name = Path.GetFileNameWithoutExtension(modulePath); if (name == null) { throw new Exception(String.Format("Invalid skin module path \"{0}\"", modulePath)); } var module = SkinModule.FromXmlFile(modulePath); if (module == null) { isValid = false; return; } Debug.LogWarning("Adding module: " + module.SourcePath + " With class: " + moduleClass); _modules[moduleClass].Add(module); }
public static SkinModule FromXmlFile(string path) { SkinModule skinModule = null; try { var document = new XmlDocument(); document.LoadXml(File.ReadAllText(path)); skinModule = new SkinModule(path, document); } catch (XmlNodeException ex) { ErrorLogger.LogErrorFormat("{0} while parsing skin module \"{1}\" at node \"{2}\": {3}", ex.GetType(), path, XmlUtil.XmlNodeInfo(ex.Node), ex.ToString()); } catch (XmlException ex) { ErrorLogger.LogErrorFormat("XmlException while parsing skin module \"{0}\" at line {1}, col {2}: {3}", path, ex.LineNumber, ex.LinePosition, ex.Message); } catch (Exception ex) { ErrorLogger.LogErrorFormat("{0} while parsing skin module \"{1}\": {2}", ex.GetType(), path, ex.ToString()); } return skinModule; }
public static SkinModule FromXmlFile(string path) { SkinModule skinModule = null; try { var document = new XmlDocument(); document.LoadXml(File.ReadAllText(path)); skinModule = new SkinModule(path, document); } catch (XmlNodeException ex) { ErrorLogger.LogErrorFormat("{0} while parsing skin module \"{1}\" at node \"{2}\": {3}", ex.GetType(), path, XmlUtil.XmlNodeInfo(ex.Node), ex.ToString()); } catch (XmlException ex) { ErrorLogger.LogErrorFormat("XmlException while parsing skin module \"{0}\" at line {1}, col {2}: {3}", path, ex.LineNumber, ex.LinePosition, ex.Message); } catch (Exception ex) { ErrorLogger.LogErrorFormat("{0} while parsing skin module \"{1}\": {2}", ex.GetType(), path, ex.ToString()); } return(skinModule); }
private void ApplyInternal(SkinModule skinModule) { skinModule.WalkModule(ApplyInternalRecursive); }