コード例 #1
0
        public void writeBat()
        {
            //Call Class
            tags tag = new tags();

            //Console.Write(tag.tagList[0]);
            string tempString;
            //tempString = tagList;
            //C:\Program Files\RAPID\bin>DumpEvents.exe /o d:\rapidexport\WIT-CT308_Meas1_PRIM.csv /c /b %rapidboot% /i WIT-CT308/Meas1/PRIM /s %oldestarc% /e %newestarc%
            string cat1 = @"C:\Program Files\RAPID\bin>DumpEvents.exe /o d:\rapidexport\";
            //string cat2 = tag.tagList[0];
            string cat3 = " /c /b %rapidboot% /i WIT-CT308/Meas1/PRIM /s %oldestarc% /e %newestarc%";

            //string lines = cat1 + cat2 + cat3;

            // WriteAllLines creates a file, writes a collection of strings to the file,
            // and then closes the file.  You do NOT need to call Flush() or Close().
            //System.IO.File.WriteAllText(@"C:\TEMP\WriteText.txt", lines);
            // Compose string including list variables

            /* string[] test = { "echo\n", "test" };
             * //string line2 = "test";
             *
             * // Write the string to a file.
             * System.IO.File.WriteAllText(@"C:\\TEMP\\WriteText.txt", test);*/
            //file.Close();

            //This is going to get hairy
            //string lines = cat1 +
            // WriteAllLines creates a file, writes a collection of strings to the file,
            // and then closes the file.  You do NOT need to call Flush() or Close().
            //System.IO.File.WriteAllLines(@"C:\\TEMP\\WriteText.txt", lines);
        }
コード例 #2
0
        public void convertTagList()
        {
            //Call Class
            tags tag = new tags();


            string tempString;

            // Open the file, read and convert list
            using (System.IO.StreamReader sr = new System.IO.StreamReader("C:\\TEMP\\tagnames1.txt"))
            {
                while (!sr.EndOfStream) // Keep reading until we get to the end
                {
                    tag.splitMe   = sr.ReadLine();
                    tag.splitLine = tag.splitMe.Split(null);        //Split at the spaces
                    tempString    = tag.splitLine[1];               //Assign temp var
                    tempString    = tempString.Replace('/', '_');   //Replace characters
                    //Console.WriteLine(tempString);
                    tag.tagList.Add(tempString);                    //Add to da list

                    /*foreach (String test in tag.tagList)
                     * {
                     *  Console.WriteLine(test);
                     * }*/

                    Console.Write(tag.tagList[0]);                  //This prints f*****g everything
                }
            }
        }
コード例 #3
0
        public void createTagList()
        {
            //Call Class
            tags tag = new tags();

            //Create Tag List
            List <String> tagList = new List <String>();

            //Temp String
            string tempString;

            // Open the file into a streamreader and populate tag list
            using (System.IO.StreamReader sr = new System.IO.StreamReader("C:\\TEMP\\tagnames1.txt"))
            {
                while (!sr.EndOfStream)                      // Keep reading until end of file
                {
                    tag.splitMe   = sr.ReadLine();           //Read that shit
                    tag.splitLine = tag.splitMe.Split(null); //Split at the spaces
                    tempString    = tag.splitLine[1];        //Each separation goes into it's own index
                    tagList.Add(tempString);                 //Add Middle column

                    //Testing

                    /*foreach (String test in tagList)
                     * {
                     *  Console.WriteLine(test);
                     * }*/
                }
            }
        }
コード例 #4
0
ファイル: TagBL.cs プロジェクト: alonsodev/SSR
        public void Modificar(TagViewModel pTagViewModel)
        {
            tags otags = oRepositorio.FindById(pTagViewModel.tag_id);

            otags.name = pTagViewModel.name;

            otags.user_id_modified = pTagViewModel.user_id_modified;

            otags.date_modified = DateTime.Now;
            oRepositorio.Update(otags);
            oUnitOfWork.SaveChanges();
        }
コード例 #5
0
        public async Task <tags> CreateTag(string name, string workflowState, int version)
        {
            tags tag = new tags();

            tag.Name          = name;
            tag.WorkflowState = workflowState;
            tag.Version       = version;
            await tag.Create(dbContext).ConfigureAwait(false);

//            DbContext.tags.Add(tag);
//            await dbContext.SaveChangesAsync().ConfigureAwait(false);

            return(tag);
        }
コード例 #6
0
ファイル: Connection.cs プロジェクト: pietpukkel/xmpp
        public void Send(tags.Tag tag)
        {
            // Remove comments
            var manipulationCopy = new XElement(tag);
            var descendants = manipulationCopy.DescendantNodesAndSelf();
            var comments = descendants.Where(node => node.NodeType == System.Xml.XmlNodeType.Comment);
            while (comments.Count() > 0)
                comments.First().Remove();

            this.Send(manipulationCopy.ToString());
        }
コード例 #7
0
ファイル: ProgWin.xaml.cs プロジェクト: zuzhu/pinac
 private int compare(tags t1, tags t2)
 {
     if (t1.start < t2.start)
         return 1;
     if (t1.start == t2.start)
         return 0;
     return -1;
 }
コード例 #8
0
ファイル: ProgWin.xaml.cs プロジェクト: zuzhu/pinac
 private void syntax()
 {
     TextPointer start = rtbInput.Document.ContentStart;
     TextPointer end = rtbInput.Document.ContentEnd;
     TextRange tr = new TextRange(start, end);
     tr.ApplyPropertyValue(TextElement.ForegroundProperty, new SolidColorBrush(Colors.Black)); 
     m_tags.Clear();
     for (int s = 0; s < keywords.Count && tr.Text.Length > 2; s++)
     {
         int index = -1;
         string text = tr.Text.ToString();
         string[] txt;
         index = text.LastIndexOf(keywords[s]);
         while (index != -1 && text.Length > 0)
         {
             tags t = new tags();
             text = text.Substring(0, index + keywords[s].Length);
             txt = text.Split('\n');
             int num = 0;
             for (int i = 0; i < txt.Length; i++)
                 if (txt[i].Length > 1)
                     num = num + 1;
                 else if (txt[i].Length == 1 && keywords[s].Length == 1 && txt[i] == keywords[s])
                     num = num + 1;
             if ((index==0 || (index >= 1 &&
                 !((tr.Text[index - 1] >= 'a' && tr.Text[index - 1] <= 'z') || (tr.Text[index - 1] >= 'A' && tr.Text[index - 1] <= 'Z')))) &&
                 !((tr.Text[index + keywords[s].Length] >= 'a' && tr.Text[index + keywords[s].Length] <= 'z') || (tr.Text[index + keywords[s].Length] >= 'A' && tr.Text[index + keywords[s].Length] <= 'Z')))
             {
                 t.start = index+2*num;
                 t.size = keywords[s].Length;
                 m_tags.Add(t);
             }
                 text = text.Substring(0, index);
                 index = text.LastIndexOf(keywords[s]);
         }
     }
     format();
 }