Exemple #1
0
        public CKernel()
        {
            #if VERBOSE
            LogClient=new CLogClient();
            #endif
            m_PortChanged=false;
            m_Version=(Protocol.ELEPHANT_VERSION_MAJOR-1).ToString()+"."+Protocol.ELEPHANT_VERSION.ToString("00");

            Preferences=new Config(DllDirectory, "config.xml", "0.02", "lphantKernel");
            Preferences.PropertyChanged+=new Config.PropertyEventHandler(OnPropertyChanged);
            Preferences.PropertyDefaults+=new Config.PropertyDefaultHandler(OnGetDefaultProperty);
            Preferences.PropertyLoaded+=new Config.PropertyLoadedHandler(OnPropertyLoaded);
            Preferences.LoadProperties();

            Globalization=new Classes.Globalization(LangDirectory, "kernel_", "xml",Preferences.GetString("Language"));

            SourcesOld=new CSourcesOld();
            Listener=new CListener();
            ConnectionsList=new CConnectionsList();
            ServersList=new CServersList();

            FilesList=new CFilesList();
            ClientsList=new CClientsList();
            InterfaceGateway[0]=new CInterfaceGateway();
            InterfaceGateway[0].apw=true;
            //InterfaceGateway[0].CheckPw(Preferences.GetString("RemotePassword"));
            //FilesList.LoadSharedFiles(); // > StartKernel()
            FriendsList=new CFriendsList();

            GlobalStatistics=new CStatistics();
            if (Preferences.GetBool("RemoteControlEnabled"))
            {
                Sremoto=new CRemoting();
            }
            Searchs=new SortedList();
            Queue=new CQueue();
            UDPListener=new CUDPListener(); // UDPListener.Start(); > StartKernel()

            CategoriesList=new CCategoriesList();

            httpDownload=new ChttpDownload();
            httpDownload.Downloaded+=new DownloadedEventHandler(OnFileDownloaded);
        }
Exemple #2
0
 private void Initialize()
 {
     m_PreviousState=FormWindowState.Normal;
     SystemIconsList=new CSystemIconsList();
     Skin=new CSkin();
     m_LastIcon=10;
     preferences = new Config(Application.StartupPath, "configInterface.xml", "0.01", "HathiInterface");
     preferences.PropertyChanged += new Config.PropertyEventHandler(m_OnPropertyChanged);
     preferences.PropertyDefaults += new Config.PropertyDefaultHandler(OnGetDefaultProperty);
     preferences.LoadProperties();
     Globalization=new Classes.Globalization(Application.StartupPath+Path.DirectorySeparatorChar+"language", "interface_", "xml",preferences.GetString("Language"));
     m_Globalize();
     m_KernelLoaded=false;
     toolTipMain.SetToolTip(HathiButtonConnect,Globalization["LBL_CONNDISC"]);
     toolTipMain.SetToolTip(buttonOptions,Globalization["LBL_OPTIONS"]);
     taskbarNotifier1=new TaskbarNotifier();
     taskbarNotifier1.SetBackgroundBitmap(new Bitmap(GetType(),"Client.Resources.Classic.PopUpSkin.bmp"),Color.FromArgb(255,0,0));
     taskbarNotifier1.SetCloseBitmap(new Bitmap(typeof(HathiForm),"Client.Resources.Classic.close.bmp"),Color.FromArgb(255,0,255),new Point(127,8));
     taskbarNotifier1.TitleRectangle=new Rectangle(50,65,100,70);
     taskbarNotifier1.ContentRectangle=new Rectangle(8,75,133,100);
     taskbarNotifier1.NormalContentColor = Color.White;
     //taskbarNotifier1.TitleClick+=new EventHandler(TitleClick);
     taskbarNotifier1.ContentClick+=new EventHandler(m_BallonClicked);
     //taskbarNotifier1.CloseClick+=new EventHandler(CloseClick);
     Skin.CurrentSkin=preferences.GetString("Skin","default");
     m_ApplySkin();
     graphics.AutoGraphicScale=preferences.GetBool("AutoGraphicScale",false);
     graphics.GraphicScale=preferences.GetInt("GraphicScale",1);
     FDownloads=new FormDownloads();
     FDownloads.TopLevel=false;
     panelContent.Controls.Add(FDownloads);
     FDownloads.Dock = DockStyle.Fill;
     FDownloads.ApplySkin();
     FUploads=new FormUploads();
     FUploads.TopLevel=false;
     FUploads.Dock = DockStyle.Fill;
     panelContent.Controls.Add(FUploads);
     FUploads.Dock = DockStyle.Fill;
     FUploads.ApplySkin();
     FServers=new FormServers();
     FServers.TopLevel=false;
     FServers.Dock = DockStyle.Fill;
     panelContent.Controls.Add(FServers);
     FServers.Dock = DockStyle.Fill;
     FServers.labelmsg=this.labelStatusMsg;
     FServers.ApplySkin();
     FSearchs=new FormSearch();
     FSearchs.TopLevel=false;
     FSearchs.Dock = DockStyle.Fill;
     panelContent.Controls.Add(FSearchs);
     FSearchs.Dock = DockStyle.Fill;
     FSearchs.ApplySkin();
     FFriends=new FormFriends();
     FFriends.TopLevel=false;
     FFriends.Dock = DockStyle.Fill;
     panelContent.Controls.Add(FFriends);
     FFriends.Dock = DockStyle.Fill;
     FFriends.ApplySkin();
 }