예제 #1
0
 public static TemplateContainer GetInstance()
 {
     if (instance == null)
     {
         instance = new TemplateContainer();
     }
     return(instance);
 }
예제 #2
0
        public List <string> GetTemplates()
        {
            var tList = new List <string>();

            foreach (var tName in TemplateContainer.GetInstance().GetTemplateList().Keys)
            {
                tList.Add(tName);
            }
            return(tList);
        }
예제 #3
0
        public IPrintObject GetPrintModel(string modelData)
        {
            JObject jo         = (JObject)JsonConvert.DeserializeObject(modelData);
            string  print_type = jo["print_type"].ToString();

            Type modelType = TemplateContainer.GetInstance().GetTemplateType(print_type);

            if (modelType == null)
            {
                throw new Exception(Language.I.Text("err_unknown_template", "Error:Unknown Template"));
            }

            JavaScriptSerializer serializer = new JavaScriptSerializer();
            IPrintObject         model      = (IPrintObject)serializer.Deserialize(modelData, modelType);

            return(model);
        }
예제 #4
0
 public void Initialize()
 {
     TemplateContainer.GetInstance().SacnTemplate();
 }