Exemplo n.º 1
0
        private bool SetSplinesAndFilled(Settings settings, bool splines, bool filled)
        {
            bool muted = false;
            if (splines)
            {
                if (filled)
                {
                    muted = settings.MuteCurveFillPolygon;
                }
                else
                {
                    muted = settings.MuteCurvePolygon;
                }
            }
            else
            {
                if (filled)
                {
                    muted = settings.MuteLineFillPolygon;
                }
                else
                {
                    muted = settings.MuteLinePolygon;
                }
            }

            if (muted)
                return false;

            Splines = splines;
            Filled = filled;

            return true;
        }
Exemplo n.º 2
0
 public MainForm()
 {
     InitializeComponent();
     Settings = Serializer.DeserializeSettings();
     if (Settings == null)
         Settings = new Settings();
 }
 public MainWindow()
 {
     InitializeComponent();
     //Settings = Serializer.DeserializeSettings();
     if (Settings == null)
         Settings = new Settings();
 }
Exemplo n.º 4
0
 public void Init()
 {
     Drawing = new DnaDrawing();
     Drawing.Init();
     Settings = new Settings();
     ErrorLevel = double.MaxValue;
     LastSavedFitness = double.MaxValue;
 }
Exemplo n.º 5
0
        public static void Serialize(Settings settings)
        {
            if (string.IsNullOrEmpty(Application.LocalUserAppDataPath))
                return;

            string fileName = Application.LocalUserAppDataPath + "\\Settings.xml";
            Serialize(settings, fileName);
        }
Exemplo n.º 6
0
 private void openToolStripMenuItem_Click(object sender, EventArgs e)
 {
     Settings settings = Serializer.DeserializeSettings(FileUtil.GetOpenFileName(FileUtil.XmlExtension));
     if (settings != null)
     {
         Settings = settings;
     }
 }
Exemplo n.º 7
0
        public static void Serialize(Settings settings, string fileName)
        {
            if (fileName == null)
                return;

            try
            {
                var serializer = new XmlSerializer(settings.GetType());
                using (var writer = new FileStream(fileName, FileMode.Create))
                {
                    serializer.Serialize(writer, settings);
                }
            }
            catch (Exception)
            {
            }
        }