void FireEvent_LoadModel(string path, DesignerModel model) { if (LoadModelEvent != null) { LoadModelEvent(this, new EventArgs <Tuple <string, DesignerModel> >(new Tuple <string, DesignerModel>(path, model))); } }
protected override void OnLoadModel(DesignerModel model) { base.OnLoadModel(model); LayerName = model.Name; IsDirty = false; SelectedTool = null; }
public ActionResult ReportDesigner(string name) { string reportName = name; DesignerModel designer = new DesignerModel(reportName); ViewBag.Message = designer; return(View()); }
public ActionResult Index(string schemeName) { var model = new DesignerModel() { SchemeName = schemeName }; return(View(model)); }
void OnOpen(object sender, EventArgs e) { FileDialog dialog = new OpenFileDialog() { CheckFileExists = true }; if (dialog.ShowDialog() == DialogResult.OK) { FireEvent_LoadModel(dialog.FileName, DesignerModel.FromFile(dialog.FileName)); } }
protected override void OnLoadModel(DesignerModel model) { base.OnLoadModel(model); DrawingTools.All(tool => { Point pt = tool.Location; pt.Offset(Offset); tool.Location = pt; return(true); }); }
public void Save(DesignerModel model) { var persistences = from tool in DrawingTools select tool.Persistence; // DrawingTools model.Name = LayerName; model.Description = LayerDescription; model.Width = LayerWidth; model.Height = LayerHeight; model.Layout = PersistenceFactory.Instance.GetLayout(persistences); IsDirty = false; }
public void OnSaveModel(object sender, EventArgs args) { if (string.IsNullOrEmpty(CurrentPath)) { FileDialog dialog = new SaveFileDialog(); if (dialog.ShowDialog() == DialogResult.OK) { CurrentPath = dialog.FileName; } } DesignerModel model = new DesignerModel(); DesignView.Save(model); model.SaveToFile(CurrentPath); }
public IEnumerable <ToolPersistence> Import(DesignerModel model) { List <ToolPersistence> ret = new List <ToolPersistence>(); if (string.IsNullOrEmpty(model.Layout)) { return(ret); } using (TextReader reader = new StringReader(model.Layout)) { RootPersistence persistence = Serializer.Deserialize(reader) as RootPersistence; ret.AddRange(persistence.Tools); } return(ret); }
public ActionResult AssociateItemProduct(Int32 id) { DesignerModel model = new DesignerModel(); try { SessionData.item = _itemService.GetItem(id); model.Categories = _categoryService.GetCategories(SessionData.customer.id, CommonUnit.CategoryType.Product); model.ItemProducts = SessionData.item.ItemProducts; return(PartialView("_ItemProductAssociatePartial", model)); } catch (Exception ex) { base.Log(ex); } finally { } return(null); }
public ActionResult Designer() { DesignerModel model; try { model = new DesignerModel(); model.Categories = _categoryService.GetCategories(SessionData.customer.id, CommonUnit.CategoryType.Menu); //model.Selected = _categoryService.GetMenuDesignerItems(SessionData.customer.id); model.ItemProducts = SessionData.item.ItemProducts; return(View("Designer", model)); } catch (Exception ex) { base.Log(ex); } finally { } return(null); }
protected virtual void OnLoadModel(DesignerModel model) { PersistenceFactory.Instance.Import(model).All(persist => { DrawingTool tool = persist.CreateDrawingTool(DesignerHost); AddTool(tool); return(true); }); LayerDescription = model.Description; if (model.Width > 0) { LayerWidth = model.Width; } if (model.Height > 0) { LayerHeight = model.Height; } }
private DesignerModel GetModel(CommonUnit.CategoryType type, String search) { DesignerModel model = new DesignerModel(); try { search = String.IsNullOrEmpty(search) ? search : search.ToUpper(); model.CategoryType = type; model.Categories = _categoryService.GetCategories(SessionData.customer.id, type, search); model.ItemProducts = null; if (SessionData.item != null) { model.ItemProducts = SessionData.item.ItemProducts; } return(model); } catch (Exception ex) { base.Log(ex); } finally { } return(null); }
public void Load(DesignerModel model) { OnLoadModel(model); Invalidate(); }
void IRuntimeView.Load(DesignerModel model) { Load(model); }