Exemple #1
0
        public static NotifyData?GetDataByID(string threadID)
        {
            NotifyData data = LISTS.Find(( NotifyData v ) =>
            {
                return(v.threadID == threadID);
            });

            return(data);
        }
Exemple #2
0
        public static void SetFocused(string threadID, bool newFocusValue)
        {
            //Predicate<NotifyData> finder = ( NotifyData data ) => { return data.threadID == threadNumber; };
            int index = LISTS.FindIndex(( NotifyData data ) =>
            {
                return(data.threadID == threadID);
            });

            if (index > -1 && LISTS?[index] != null)
            {
                NotifyData oldData = LISTS[index];
                oldData.focused = newFocusValue;
                LISTS[index]    = oldData;

                Save( );
            }
            else
            {
                Utility.WriteErrorLog("NotifyIndexError", Utility.LogSeverity.EXCEPTION);
                NotifyBox.Show(null, "오류", "죄송합니다, 데이터 조작 중 오류가 발생했습니다.", NotifyBoxType.OK, NotifyBoxIcon.Error);
            }
        }
Exemple #3
0
        public static void SetData(string threadID, DataSettingDelegate setCallBack)
        {
            int index = LISTS.FindIndex(( NotifyData data ) =>
            {
                return(data.threadID == threadID);
            });

            if (index > -1 && LISTS?[index] != null)
            {
                NotifyData oldData = LISTS[index];

                setCallBack.Invoke(ref oldData);

                LISTS[index] = oldData;

                Save( );
            }
            else
            {
                Utility.WriteErrorLog("NotifyIndexError", Utility.LogSeverity.EXCEPTION);
                NotifyBox.Show(null, "오류", "죄송합니다, 데이터 조작 중 오류가 발생했습니다.", NotifyBoxType.OK, NotifyBoxIcon.Error);
            }
        }
Exemple #4
0
        public static void Add(TableDataTable table)
        {
            string threadID = table.number;

            NotifyData data = new NotifyData( );

            data.threadTitle = HttpUtility.HtmlDecode(table.title);
            data.threadID    = table.number;
            data.threadURL   = table.url;
            data.threadHit   = table.hit;
            data.focused     = false;

            TopProgressMessage.Set("#" + threadID + " 게시글의 정보를 불러오고 있습니다 ... [2/3]");

            ThreadDetailStruct?detailStruct = NaverRequest.GetSpecificThreadDetail(threadID);

            if (detailStruct.HasValue)
            {
                data.threadAuthor  = detailStruct.Value.threadAuthor;
                data.threadTime    = detailStruct.Value.threadTime;
                data.personaconURL = detailStruct.Value.personaconURL;
                data.articleName   = detailStruct.Value.articleName;
                data.authorRank    = detailStruct.Value.authorRank;
            }
            else
            {
                data.threadAuthor  = "NULL(NULL)";
                data.threadTime    = "00:00";
                data.personaconURL = "";
                data.articleName   = "알 수 없음";
                data.authorRank    = "새싹멤버";
            }

            LISTS.Insert(0, data);

            //await Task.Run( new Action( ( ) => Advice.CheckThread( data ) ) );
            //Advice.CheckThread( data );

            if (Config.Get("CaptureEnable", "1") == "1")
            {
                TopProgressMessage.Set("#" + threadID + " 게시글을 캡처하고 있습니다 ... [3/3]");

                Main mainForm = Utility.GetMainForm( );

                if (mainForm != null)
                {
                    if (mainForm.InvokeRequired)
                    {
                        mainForm.Invoke(new Action(() => BrowserCapture.Capture(threadID)));
                    }
                    else
                    {
                        BrowserCapture.Capture(threadID);
                    }
                }
            }
            else
            {
                TopProgressMessage.Set("#" + threadID + " 게시글을 설정에 의해 캡처하지 않습니다. [3/3]");
            }
        }