Beispiel #1
0
 /// <summary>
 /// Sets the local variables
 /// </summary>
 /// <param name="_Port">Port to listen to</param>
 /// <param name="_FileName">Local resource to be send</param>
 /// <param name="_Interface">Pointer to the interface (for status updating)</param>
 /// <param name="_Nexus">Pointer to Nexus</param>
 public BinaryServer(int _Port, string _FileName, GraphicalInterface _Interface, Nexus.Nexus _Nexus)
 {
     Port = _Port;
     FileName = _FileName;
     Interface = _Interface;
     MainNexus = _Nexus;
 }
Beispiel #2
0
 /// <summary>
 /// Constructors, sets variables
 /// </summary>
 /// <param name="Items">The items in the listview</param>
 /// <param name="FileSize">Size of the file</param>
 /// <param name="_TheForm">Pointer to the form</param>
 public DownLoadItem(string[] Items, long FileSize, GraphicalInterface _TheForm)
     : base(Items)
 {
     TotalByteCount = FileSize;
     TheForm = _TheForm;
 }
Beispiel #3
0
        static void StartWindowsProgram()
        {
            try
            {
                _nexus = new Nexus.Nexus();
                Application.EnableVisualStyles();
                Application.SetCompatibleTextRenderingDefault(false);
                GraphicalInterface gi = new GraphicalInterface(_nexus);
                _nexus.Interface = gi;
                Application.Run(gi);
            }

            // thrown by kisp itself
            catch (BullshitException e)
            {
                MessageBox.Show(e.Message, "NO WAI!!");
            }

            // thrown by invocation targets
            catch (System.Reflection.TargetInvocationException e)
            {
                string Message = e.Message
                    + "\n"
                    + e.InnerException.Message
                    + "\n"
                    + e.StackTrace;

                string Caption = "TargetInvocationException: "
                    + e.InnerException.GetType().ToString();

                MessageBox.Show(Message, Caption);
            }

            // uncaught exceptions
            catch (Exception e)
            {
                string Message = e.Message
                    + "\n"
                    + e.StackTrace;

                string Caption = e.GetType().ToString();

                MessageBox.Show(Message, Caption);
            }
        }