Esempio n. 1
0
        public Form1(TSOConfig tso_config, string[] args)
        {
            InitializeComponent();
            this.ClientSize = tso_config.ClientSize;

            for (int i = 0; i < keysEnabled.Length; i++)
            {
                keysEnabled[i] = true;
            }
            this.KeyDown += new KeyEventHandler(form_OnKeyDown);
            this.KeyUp   += new KeyEventHandler(form_OnKeyUp);

            this.DragDrop += new DragEventHandler(form_OnDragDrop);
            this.DragOver += new DragEventHandler(form_OnDragOver);

            viewer            = new Viewer();
            viewer.DeviceSize = tso_config.DeviceSize;
            if (viewer.InitializeGraphices(this))
            {
                foreach (string arg in args)
                {
                    viewer.LoadAnyFile(arg, true);
                }

                this.timer1.Enabled = true;
            }
        }
Esempio n. 2
0
        public static TSOConfig Load(string source_file)
        {
            XmlReader     reader     = XmlReader.Create(source_file);
            XmlSerializer serializer = new XmlSerializer(typeof(TSOConfig));
            TSOConfig     config     = serializer.Deserialize(reader) as TSOConfig;

            reader.Close();
            return(config);
        }
Esempio n. 3
0
        static void Main(string[] args)
        {
            TSOConfig tso_config;

            string tso_config_file = Path.Combine(Application.StartupPath, @"config.xml");

            if (File.Exists(tso_config_file))
            {
                tso_config = TSOConfig.Load(tso_config_file);
            }
            else
            {
                tso_config = new TSOConfig();
            }

            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            Application.Run(new Form1(tso_config, args));
        }