コード例 #1
0
ファイル: NetClass.cs プロジェクト: chandusekhar/RABot
    private static BitmapImage SetImgNetConn(bool notBusy)
    {
        string imgPath;

        if (notBusy)
        {
            using (Bitmap bit = RABot.Properties.Resources.notBusy)
            {
                //метод просто выгружает указанную картинку в папку temp и возвращает полный путь к ней
                imgPath = RaBotProgram.UnloadImage(bit, "notBusy");
            }
        }
        else
        {
            using (Bitmap bit = RABot.Properties.Resources.busy)
            {
                imgPath = RaBotProgram.UnloadImage(bit, "busy");
            }
        }

        var         stream = File.OpenRead(imgPath);
        BitmapImage b      = new BitmapImage();

        b.BeginInit();
        b.CacheOption  = BitmapCacheOption.OnLoad;
        b.StreamSource = stream;
        b.EndInit();
        stream.Close();
        return(b);
    }
コード例 #2
0
 private void CleanUp()
 {
     if (RaBotProgram.Qt != null)
     {
         RaBotProgram.Qt.Dispose();
     }
     NetClass.DisposeAsync();
     RaBotProgram.DeleteTempFolder();
     _ni.Dispose();
 }
コード例 #3
0
 public MainWindow()
 {
     InitializeComponent();
     try
     {
         SetIcon();
         RaBotProgram.SetTempFolder();
         Timers.InitTimers(LabelMoexTime, LabelLocalTime);
         NetClass.StartPing(ImgNetConn, ImgSlConn);
         LittleTable.GetLittleStops();
         SetLastLittleTable();
         GetCurrentLittleDeals();
         LittleTable.ReadCurrentDeals();
         RaBotProgram.SetFreeMoney();
     }
     catch (Exception)
     {
         Forms.MessageBox.Show("Ошибка в главном окне!");
         throw;
     }
     finally
     {
     }
 }