示例#1
0
        public List <string> GetTemplates()
        {
            var tList = new List <string>();

            foreach (var tName in TemplateContainer.GetInstance().GetTemplateList().Keys)
            {
                tList.Add(tName);
            }
            return(tList);
        }
示例#2
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);
        }
示例#3
0
 public void Initialize()
 {
     TemplateContainer.GetInstance().SacnTemplate();
 }