public void Load() { string json = File.ReadAllText(_filePath); PageLayoutV001 layout = JsonConvert.DeserializeObject <PageLayoutV001>(json); SetValue(layout); }
private void SetValue(PageLayoutV001 layout) { this._rotation = new ModelValueDouble(_application.EventLayoutChanged, layout.Rotation); this._threshold = new ModelValueInt(_application.EventLayoutChanged, layout.Threshold); this._lineSize = new ModelValueDouble(_application.EventLayoutChanged, layout.LineSize); this._lineOffset = new ModelValueDouble(_application.EventLayoutChanged, layout.LineOffset); this._lineCount = new ModelValueInt(_application.EventLayoutChanged, layout.LineCount); this._colSize = new ModelValueDouble(_application.EventLayoutChanged, layout.ColSize); this._colOffset = new ModelValueDouble(_application.EventLayoutChanged, layout.ColOffset); this._colCount = new ModelValueInt(_application.EventLayoutChanged, layout.ColCount); this._margin = new ModelValueInt(_application.EventLayoutChanged, layout.Margin); this._overlap = new ModelValueDouble(_application.EventLayoutChanged, layout.Overlap); }
private PageLayoutV001 GetValue() { PageLayoutV001 layout = new PageLayoutV001(); layout.Rotation = Rotation.Value; layout.Threshold = Threshold.Value; layout.LineSize = LineSize.Value; layout.LineOffset = LineOffset.Value; layout.LineCount = LineCount.Value; layout.ColSize = ColSize.Value; layout.ColOffset = ColOffset.Value; layout.ColCount = ColCount.Value; layout.Margin = Margin.Value; layout.Overlap = Overlap.Value; return(layout); }