예제 #1
0
        // (verified with EDSM 29/9/2016)
        public static void SendComments(string star , string note, long edsmid = 0)
        {
            EDSMClass edsm = new EDSMClass();

            if (!edsm.IsApiKeySet)
                return;

            Task taskEDSM = Task.Factory.StartNew(() =>
            {
                edsm.SetComment(star, note, edsmid);
            });
        }
예제 #2
0
        // (verified with EDSM 29/9/2016)
        public static void SendComments(string star , string note)
        {
            if (!EDDConfig.Instance.CheckCommanderEDSMAPI)
                return;

            EDSMClass edsm = new EDSMClass();

            Task taskEDSM = Task.Factory.StartNew(() =>
            {
                edsm.SetComment(star, note);
            });
        }
예제 #3
0
        public static void SendComments(string star, string note, long edsmid = 0)  // (verified with EDSM 29/9/2016)
        {
            EDSMClass edsm = new EDSMClass();

            if (!edsm.IsApiKeySet)
            {
                return;
            }

            Task taskEDSM = Task.Factory.StartNew(() =>
            {
                edsm.SetComment(star, note, edsmid);
            });
        }
        private void StoreSystemNote()
        {
            string txt;

            try
            {
                EDSMClass edsm = new EDSMClass();
                SQLiteDBClass db = new SQLiteDBClass();


                edsm.apiKey = db.GetSettingString("EDSMApiKey", "");
                edsm.commanderName = db.GetSettingString("CommanderName", "");


                if (currentSysPos == null || currentSysPos.curSystem == null)
                    return;

                //SystemPosition sp = (SystemPosition)dataGridView1.Rows[lastRowIndex].Cells[1].Tag;
                txt = richTextBoxNote.Text;

                
                if (currentSysPos.curSystem.Note == null)
                    currentSysPos.curSystem.Note = "";

                if (currentSysPos != null && !txt.Equals(currentSysPos.curSystem.Note))
                {
                    SystemNoteClass sn;
                    List<SystemClass> systems = new List<SystemClass>();

                    if (SQLiteDBClass.globalSystemNotes.ContainsKey(currentSysPos.curSystem.SearchName))
                    {
                        sn = SQLiteDBClass.globalSystemNotes[currentSysPos.curSystem.SearchName];
                        sn.Note = txt;
                        sn.Time = DateTime.Now;

                        sn.Update();
                    }
                    else
                    {
                        sn = new SystemNoteClass();

                        sn.Name = currentSysPos.curSystem.name;
                        sn.Note = txt;
                        sn.Time = DateTime.Now;
                        sn.Add();
                    }

                    
                    currentSysPos.curSystem.Note = txt;
                    dataGridView1.Rows[lastRowIndex].Cells[3].Value = txt;

                    if (edsm.commanderName == null || edsm.apiKey == null)
                        return;

                    if (edsm.commanderName.Length>1 && edsm.apiKey.Length>1)
                        edsm.SetComment(sn);
                }

            }
            catch (Exception ex)
            {
                System.Diagnostics.Trace.WriteLine("Exception : " + ex.Message);
                System.Diagnostics.Trace.WriteLine(ex.StackTrace);

                LogText("Exception : " + ex.Message, Color.Red);
                LogText(ex.StackTrace, Color.Red);
            }
        }