Esempio n. 1
0
        /// <summary>
        ///     ������ ����Ʈ �Ѵ�.
        /// </summary>
        protected void PostToSlack(int marketNum, HtmlNode marketSubjectNode, SlackClientWebhooks slackClient)
        {
            var arguments = new Arguments
                            {
                                UnfurlLinks = "true",
                                // Text = Weburl + href + "\n>" + marketNum + " : " + marketSubjectNode.InnerText
                                Text = WebUrl + "\n>" + marketNum + " : " + marketSubjectNode.InnerText
                            };

            slackClient.PostMessage(arguments);
        }
Esempio n. 2
0
            public override void DiffFiles(string baseFile, string newFile, string baseNiceName, string newNiceName)
            {
                if (baseFile == null)
                {
                    throw new ArgumentNullException("baseFile");
                }
                if (newFile == null)
                {
                    throw new ArgumentNullException("newFile");
                }

                Process proc = new Process();

                proc.StartInfo.FileName = _detectedPath;

                string baseFileContents;

                using (var reader = new StreamReader(baseFile))
                {
                    baseFileContents = reader.ReadToEnd();
                }
                string newFileContents;

                using (var reader = new StreamReader(newFile))
                {
                    newFileContents = reader.ReadToEnd();
                }

                var udiff = UnifiedDiff.GenerateUnifiedDiff(baseFileContents, newFileContents, baseNiceName, newNiceName);

                string udiffFilename = System.IO.Path.GetTempFileName();

                using (System.IO.StreamWriter sw = new System.IO.StreamWriter(udiffFilename))
                {
                    sw.Write(udiff);
                }

                var args = new Arguments();

                FileInfo udiffFI = StringToFileInfoAndTestExists(udiffFilename);

                args.AddArgument("/patchfile:", udiffFI.FullName);

                if ((baseNiceName != null) && (newNiceName != null))
                {
                    args.AddArgument("/title:", string.Join(", ", new string[] { baseNiceName, newNiceName }));
                }
                else if (baseNiceName != null)
                {
                    args.AddArgument("/title:", string.Join(", ", new string[] { baseNiceName, newFile }));
                }
                else if (newNiceName != null)
                {
                    args.AddArgument("/title:", string.Join(", ", new string[] { baseFile, newNiceName }));
                }
                else
                {
                    args.AddArgument("/title:", string.Join(", ", new string[] { baseFile, newFile }));
                }

                proc.StartInfo.Arguments = args.ToString();

                proc.Start();

                proc.WaitForExit();

                File.Delete(udiffFilename);
            }