Esempio n. 1
0
        public ModelPageLayout(IModelApplication application, string filePath, ModelPageLayout other)
        {
            _application    = application;
            _filePath       = filePath;
            this._rotation  = new ModelValueDouble(application.EventLayoutChanged, 0);
            this._threshold = new ModelValueInt(application.EventLayoutChanged, 0);

            this._lineSize   = new ModelValueDouble(application.EventLayoutChanged, 0);
            this._lineOffset = new ModelValueDouble(application.EventLayoutChanged, 0);
            this._lineCount  = new ModelValueInt(application.EventLayoutChanged, 0);

            this._colSize   = new ModelValueDouble(application.EventLayoutChanged, 0);
            this._colOffset = new ModelValueDouble(application.EventLayoutChanged, 0);
            this._colCount  = new ModelValueInt(application.EventLayoutChanged, 0);


            this._margin  = new ModelValueInt(application.EventLayoutChanged, 0);
            this._overlap = new ModelValueDouble(application.EventLayoutChanged, 0);

            if (File.Exists(_filePath))
            {
                Load();
            }
            else
            {
                if (other == null)
                {
                    this._rotation.Value  = 180;
                    this._threshold.Value = 100;

                    this._lineSize.Value   = 20;
                    this._lineOffset.Value = 100;
                    this._lineCount.Value  = 0;

                    this._colSize.Value   = 20;
                    this._colOffset.Value = 100;
                    this._colCount.Value  = 0;

                    this._margin.Value  = 0;
                    this._overlap.Value = 0;
                }
                else
                {
                    SetValue(other.GetValue());
                }
                Save();
            }
        }
Esempio n. 2
0
        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);
        }