private volatile bool _shouldStop = false; // signal for server loop to stop #endregion Fields #region Constructors /*************************************************************************************************************************/ // SERVER LOOP public Server(Main main) { this.main = main; this.mainProcess = false; try { if (!SendMessage("ping")) // check if server exists { Int32 port = main.options.server_default_port; IPAddress localAddr = IPAddress.Parse(main.options.server_default_ip); this.tcpListener = new TcpListener(localAddr, port); this.listenThread = new Thread(new ThreadStart(ListenForClients)); // start thread with server this.listenThread.Start(); this.mainProcess = true; Program.log.write("Server: start on " + main.options.server_default_ip + ":" + main.options.server_default_port); } else { this.mainProcess = false; Program.log.write("Server: already exist"); } } catch (Exception ex) { Program.log.write("Server: "+ex.Message); } }
public AboutForm(Main main) { this.main = main; this.InitializeComponent(); this.labelLicenceType.Text = this.main.options.license; this.labelVersionNumber.Text = Program.GetVersion(); this.linkLabelMe.Text = this.main.options.author; this.labelHomepage.Text = this.main.options.home_page; }
private static void Main() { Program.log.write("Start application: " + GetLocation()); Program.log.write("Version : " + GetVersion()); #if DEBUG Program.log.write("Debug mode"); #else Program.log.write("Production mode"); #endif // aplication default settings Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); // prevent catch global exception in debug mode #if !DEBUG try { #endif main = new Main(); if (main.mainform != null) { Application.Run(main.mainform); } Application.Exit(); #if !DEBUG // catch all exception globaly in release mode and prevent application crash } catch (Exception e) // global exception handling { log.write("Application crash: message:" + e.Message); log.saveLogToFile(); MessageBox.Show("Application crash: message:" + e.Message); System.Environment.Exit(1); //close application with error code 1 } #endif }
public MainForm(Main main) { this.main = main; this.InitializeComponent(); }
public PasswordForm(Main main) { this.main = main; this.InitializeComponent(); }
public Console(Main main) { this.main = main; this.InitializeComponent(); }
private string lastEvent = ""; // remember last event in console (for remove duplicate events) #endif #region Constructors /*************************************************************************************************************************/ // FORM Constructor public DiagramView(Main main, Diagram diagram, DiagramView parentView = null) { this.main = main; this.diagram = diagram; this.parentView = parentView; // initialize layer history this.currentLayer = this.diagram.layers.getLayer(0); this.layersHistory.Add(this.currentLayer); this.InitializeComponent(); // initialize popup menu this.PopupMenu = new Popup(this.components, this); // initialize edit panel this.editPanel = new EditPanel(this); this.Controls.Add(this.editPanel); // initialize edit link panel this.editLinkPanel = new EditLinkPanel(this); this.Controls.Add(this.editLinkPanel); // initialize breadcrumbs this.breadcrumbs = new Breadcrumbs(this); // move timer this.animationTimer.Tick += new EventHandler(animationTimer_Tick); this.animationTimer.Interval = 10; this.animationTimer.Enabled = false; // move timer this.zoomTimer.Tick += new EventHandler(zoomTimer_Tick); this.zoomTimer.Interval = 10; this.zoomTimer.Enabled = false; // lineWidthForm this.lineWidthForm.trackbarStateChanged += this.resizeLineWidth; //colorPickerForm this.colorPickerForm.changeColor += this.changeColor; // custom diagram icon if (this.diagram.options.icon != "") { this.Icon = Media.StringToIcon(this.diagram.options.icon); } }
private byte[] salt = null; // salt #endregion Fields #region Constructors /*************************************************************************************************************************/ // CONSTRUCTORS public Diagram(Main main) { this.main = main; this.FontDefault = new Font("Open Sans", 10); this.undoOperations = new UndoOperations(this); }