Ejemplo n.º 1
0
        public bool Update(Found found)
        {
            if (found == null)
            {
                return(false);
            }

            using (MySqlConnection conn = new MySqlConnection(connStr))
            {
                try
                {
                    conn.Open();
                    MySqlCommand cmd = new MySqlCommand("update found set name=@name, headpic=@headpic, detailimage=@detailimage, note=@note, updatedAt=now() where id=@id", conn);
                    cmd.Parameters.Add(new MySqlParameter("id", found.id));
                    cmd.Parameters.Add(new MySqlParameter("name", found.name));
                    cmd.Parameters.Add(new MySqlParameter("headpic", found.headpic));
                    cmd.Parameters.Add(new MySqlParameter("detailimage", found.detailimage));
                    cmd.Parameters.Add(new MySqlParameter("note", found.note));

                    cmd.ExecuteNonQuery();

                    return(true);
                }
                finally
                {
                    conn.Close();
                }
            }
        }
Ejemplo n.º 2
0
        public bool AddFound(Found found)
        {
            if (found == null)
            {
                return(false);
            }

            using (MySqlConnection conn = new MySqlConnection(connStr))
            {
                try
                {
                    conn.Open();
                    MySqlCommand cmd = new MySqlCommand("insert into found(openId, name, nickName, headpic, city, note, detailimage, createdAt, updatedAt) values(@openId, @name, @nickName, @headpic, @city, @note, @detailimage, now(), now())", conn);
                    cmd.Parameters.Add(new MySqlParameter("openId", found.openId));
                    cmd.Parameters.Add(new MySqlParameter("name", found.name));
                    cmd.Parameters.Add(new MySqlParameter("nickName", found.nickName));
                    cmd.Parameters.Add(new MySqlParameter("city", found.city));
                    cmd.Parameters.Add(new MySqlParameter("headpic", found.headpic));
                    cmd.Parameters.Add(new MySqlParameter("note", found.note));
                    cmd.Parameters.Add(new MySqlParameter("detailimage", found.detailimage));

                    cmd.ExecuteNonQuery();

                    return(true);
                }
                finally
                {
                    conn.Close();
                }
            }
        }
Ejemplo n.º 3
0
 public void Clear()
 {
     UtcEarliestEntry = DateTime.MaxValue;
     Found.Clear();
     Unavailable.Clear();
     Requested.Clear();
 }
Ejemplo n.º 4
0
        public void FoundPropertiesAssignedCorrectly()
        {
            var found = new Found <int>(true, 4);

            Assert.IsTrue(found.IsFound);
            Assert.AreEqual(4, found.Element);
        }
        protected override void Execute(CodeActivityContext context)
        {
            try
            {
                string    inVal      = context.GetValue(this.SearchValue);
                DataTable dt         = context.GetValue(this.SourceDatatable);
                string    colName    = context.GetValue(this.SourceColumn);
                int       rowCounter = 0;
                bool      found      = false;

                foreach (DataRow row in dt.Rows)
                {
                    string colVal = row[colName].ToString();
                    Console.WriteLine("Row value for column: " + colName + " is: " + colVal);
                    if (string.Equals(colVal, inVal))
                    {
                        found = true;
                        Row.Set(context, row);
                        break;
                    }
                    rowCounter++;
                }

                rowCounter = (found) ? rowCounter : -1;
                Found.Set(context, found);
                RowNumber.Set(context, rowCounter);
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.Message);
                Exception.Set(context, ex);
                throw ex;
            }
        }
Ejemplo n.º 6
0
        public string InsertFound(Found found)
        {
            //found.FindID = GetUserID(found.FindID);
            SqlCommand cmd = ConnectSql("Insert into Found  Values(@FindID , @CategoryCode , @FoundDesc , @FoundColor , @FoundDate , @Remarks, @StatusCode , @Date, @FoundCityCode, @FoundLat, @FoundLng)");

            try
            {
                cmd.Parameters.AddWithValue("@FindID", found.FindID);
                cmd.Parameters.AddWithValue("@CategoryCode", found.CategoryCode);
                cmd.Parameters.AddWithValue("@FoundDesc", found.FoundDesc);
                cmd.Parameters.AddWithValue("@FoundColor", found.FoundColor);
                cmd.Parameters.AddWithValue("@FoundDate", found.FoundDate);
                cmd.Parameters.AddWithValue("@Remarks", found.Remarks);
                cmd.Parameters.AddWithValue("@StatusCode", found.StatusCode);
                cmd.Parameters.AddWithValue("@Date", found.Date);
                cmd.Parameters.AddWithValue("@FoundCityCode", found.FoundCityCode);
                cmd.Parameters.AddWithValue("@FoundLat", found.FoundLat);
                cmd.Parameters.AddWithValue("@FoundLng", found.FoundLng);
                cmd.ExecuteNonQuery();
                return("Inserting Found Seccessfuly");
            }
            catch (Exception e)
            {
                return("Exception Occre while inserting found:" + e.Message + "\t" + e.GetType());
            }
            finally
            {
                connection.DisConnectSql();
            }
        }
Ejemplo n.º 7
0
        // MarkupExtension ::= '{' TYPENAME Arguments? '}'
        //    Arguments    ::= (PositionalArgs ( ',' NamedArgs)?) | NamedArgs
        //    NamedArgs    ::= NamedArg ( ',' NamedArg )*
        //    NamedArg     ::= PROPERTYNAME '=' (STRING | QUOTEDMARKUPEXTENSION | MarkupExtension)
        //  PositionalArgs ::= (Value (',' PositionalArgs)?) | NamedArg
        //       Value     ::= STRING | QUOTEDMARKUPEXTENSION |MarkupExtension

        public IEnumerable <XamlNode> Parse(string text, int lineNumber, int linePosition)
        {
            _tokenizer    = new MeScanner(_context, text, lineNumber, linePosition);
            _originalText = text;
            Found f = new Found();

            NextToken();
            foreach (XamlNode node in P_MarkupExtension(f))
            {
                yield return(node);
            }
            if (!f.found)
            {
                string brokenRule = _brokenRule;
                _brokenRule = null;
                throw new XamlParseException(_tokenizer, brokenRule);
            }
            if (_tokenizer.Token != MeTokenType.None)
            {
                throw new XamlParseException(_tokenizer, SR.Get(SRID.UnexpectedTokenAfterME));
            }
            if (_tokenizer.HasTrailingWhitespace)
            {
                throw new XamlParseException(_tokenizer, SR.Get(SRID.WhitespaceAfterME));
            }
        }
Ejemplo n.º 8
0
        public ActionResult Search(string searchString)
        {
            if (searchString != null && searchString != "")
            {
                if (searchString.Contains("movieid="))
                {
                    var movieid = int.Parse(searchString.Substring(8));
                    return(RedirectToAction("Details", "Movies", new { id = movieid }));
                }

                if (searchString.Contains("peopleid="))
                {
                    var peopleid = int.Parse(searchString.Substring(9));
                    return(RedirectToAction("Details", "People", new { id = peopleid }));
                }

                Found found = new Found();
                found.Movies  = db.Movies.Where(m => m.Title.ToUpper().Contains(searchString.ToUpper()) || m.TitlePL.ToUpper().Contains(searchString.ToUpper())).ToList();
                found.Peoples = db.Peoples.Where(p => p.FirstName.ToUpper().Contains(searchString.ToUpper()) || p.LastName.ToUpper().Contains(searchString.ToUpper()) || searchString.ToUpper() == p.FirstName.ToUpper() + " " + p.LastName.ToUpper()).ToList();

                return(View(found));
            }
            else
            {
                return(RedirectToAction("Index"));
            }
        }
        public IEnumerable <XamlNode> Parse(string text, int lineNumber, int linePosition)
        {
            this._tokenizer    = new MeScanner(this._context, text, lineNumber, linePosition);
            this._originalText = text;
            Found f = new Found();

            this.NextToken();
            foreach (XamlNode iteratorVariable1 in this.P_MarkupExtension(f))
            {
                yield return(iteratorVariable1);
            }
            if (!f.found)
            {
                string message = this._brokenRule;
                this._brokenRule = null;
                throw new XamlParseException(this._tokenizer, message);
            }
            if (this._tokenizer.Token != MeTokenType.None)
            {
                throw new XamlParseException(this._tokenizer, System.Xaml.SR.Get("UnexpectedTokenAfterME"));
            }
            if (this._tokenizer.HasTrailingWhitespace)
            {
                throw new XamlParseException(this._tokenizer, System.Xaml.SR.Get("WhitespaceAfterME"));
            }
        }
        private IEnumerable <XamlNode> P_NamedArgs(Found f)
        {
            Found iteratorVariable0 = new Found();

            if (this._tokenizer.Token == MeTokenType.PropertyName)
            {
                foreach (XamlNode iteratorVariable1 in this.P_NamedArg(iteratorVariable0))
                {
                    yield return(iteratorVariable1);
                }
                f.found = iteratorVariable0.found;
                while (this._tokenizer.Token == MeTokenType.Comma)
                {
                    this.NextToken();
                    foreach (XamlNode iteratorVariable2 in this.P_NamedArg(iteratorVariable0))
                    {
                        yield return(iteratorVariable2);
                    }
                }
            }
            else
            {
                this.SetBrokenRuleString("NamedArgs ::= @NamedArg ( ',' NamedArg )*");
            }
        }
Ejemplo n.º 11
0
        //ФУНКЦИЯ ВОЗВРАШАЕТ ДЛЯ БУКВЫ ИСХОДНОГО ТЕКСТА СТРОКУ И СТОЛБЕЦ  ИЗ АЛФАВИТА
        private Found Find(char smb)
        {
            if (Char.IsUpper(smb))
            {
                smb = Char.ToLower(smb);
            }

            for (int i = 0; i < alphabet.Length; i++)
            {
                if (smb == alphabet[i])
                {
                    Found infSmb = new Found();
                    infSmb.row     = i / 10;
                    infSmb.col     = i % 10;
                    infSmb.alpabet = alphabet[i];
                    return(infSmb);
                }
            }

            Found inf3Smb = new Found();

            inf3Smb.alpabet = smb;

            return(inf3Smb);
        }
Ejemplo n.º 12
0
        ////////////////////////////////
        // NamedArgs ::= NamedArg ( ',' NamedArg )*
        //
        private IEnumerable <XamlNode> P_NamedArgs(Found f)
        {
            Found f2 = new Found();

            // NamedArgs ::= @NamedArg ( ',' NamedArg )*
            switch (_tokenizer.Token)
            {
            case MeTokenType.PropertyName:
                foreach (XamlNode node in P_NamedArg(f2))
                {
                    yield return(node);
                }
                f.found = f2.found;

                // NamedArgs ::= NamedArg @( ',' NamedArg )*
                while (_tokenizer.Token == MeTokenType.Comma)
                {
                    // NamedArgs ::= NamedArg ( @',' NamedArg )*
                    NextToken();

                    // NamedArgs ::= NamedArg ( ',' @NamedArg )*
                    foreach (XamlNode node in P_NamedArg(f2))
                    {
                        yield return(node);
                    }
                }
                break;

            default:
                SetBrokenRuleString("NamedArgs ::= @NamedArg ( ',' NamedArg )*");
                break;
            }
        }
Ejemplo n.º 13
0
        private IEnumerable<XamlNode> P_Arguments (Found f)
        {
            Found iteratorVariable0 = new Found();
            switch (this._tokenizer.Token) {
                case MeTokenType.PropertyName: {
                    IEnumerator<XamlNode> enumerator = this.P_NamedArgs(iteratorVariable0).GetEnumerator();
                    while (enumerator.MoveNext()) {
                        XamlNode current = enumerator.Current;
                        yield return current;
                    }
                    f.found = iteratorVariable0.found;
                    break;
                }
                case MeTokenType.Close:
                    break;

                default:
                    /*this.SetBrokenRuleString("Arguments ::= @ (PositionalArgs ( ',' NamedArgs)?) | NamedArgs");
                    break;*/
                    foreach (XamlNode iteratorVariable1 in this.P_PositionalArgs(iteratorVariable0)) {
                        yield return iteratorVariable1;
                    }
                    f.found = iteratorVariable0.found;
                    if (f.found && (this._context.CurrentArgCount > 0)) {
                        yield return this.Logic_EndPositionalParameters();
                    }
                    while (this._tokenizer.Token == MeTokenType.Comma) {
                        this.NextToken();
                        foreach (XamlNode iteratorVariable2 in this.P_NamedArgs(iteratorVariable0)) {
                            yield return iteratorVariable2;
                        }
                    }
                    break;
            }
        }
Ejemplo n.º 14
0
        //ФУНКЦИЯ РАСШИФРОВАНИЯ

        public void PlayfairDecrypt()
        {
            char[] first_data = textBox1.Text.ToCharArray();

            //функция добавления флага в алфавит
            FlagAlphabetAll();
            Found f = null, s = null; //парные  символы

            //расшифровываем
            List <Found> cooking_data = new List <Found>(); //здесь храятся все символы без разделителей
            List <Found> splitters    = new List <Found>();

            for (int i = 0; i < first_data.Length; i++)
            {
                Found smb = Find(first_data[i]);
                smb.address = i;
                if (smb.row != -1)
                {
                    if (f == null)
                    {
                        f = smb;
                    }
                    else
                    {
                        s = smb;
                        PlayfairDec(ref f, ref s);
                        if (f.alpabet != '\xa0')
                        {
                            cooking_data.Add(f);
                        }
                        if (s.alpabet != '\xa0')
                        {
                            cooking_data.Add(s);
                        }
                        f = null;
                    }
                }
                else
                {
                    splitters.Add(smb);
                }
            }
            //теперь вствляем нешифруемые разделители
            foreach (Found var in splitters)
            {
                cooking_data.Insert(var.address, var);
            }

            string cooked_text        = "";

            //вывод в окно
            foreach (Found var in cooking_data)
            {
                cooked_text += var.alpabet;
            }
            textBox2.Text = cooked_text;

            alphabet = save_alpha;
        }
Ejemplo n.º 15
0
 public void Stop()
 {
     m_Probe.Stop();
     lock (m_Lock)
     {
         Found.Clear();
     }
 }
Ejemplo n.º 16
0
 private PlayfairEncrtypt(ref Found left, ref Found right)
 {
     if (left.row == right.row)
     {
     }
     if (left.col == right.col)
     {
     }
 }
Ejemplo n.º 17
0
        public static void Start()
        {
            var launcherAssembly    = typeof(LazuriteUI.Windows.Launcher.App).Assembly;
            var launcherExePath     = Path.GetFullPath(Lazurite.Windows.Utils.Utils.GetAssemblyPath(launcherAssembly));
            var launcherProcessName = Path.GetFileNameWithoutExtension(launcherExePath);

            var currentProcess         = Process.GetCurrentProcess();
            var currentProcessName     = currentProcess.ProcessName;
            var currentProcessLocation = GetProcessFilePath(currentProcess);
            var currentProcessId       = currentProcess.Id;

            var listenInterval = DuplicatedProcessesListenerInterval;

            var action = (Action)(() =>
            {
                try
                {
                    var processes =
                        Process.GetProcessesByName(currentProcessName)
                        .Union(Process.GetProcessesByName(launcherProcessName))
                        .ToArray();
                    var targetProcesses = processes.Where(x =>
                                                          x.Id != currentProcessId &&
                                                          ((StringComparer.OrdinalIgnoreCase.Equals(x.ProcessName, launcherProcessName) &&
                                                            StringComparer.OrdinalIgnoreCase.Equals(GetProcessFilePath(x), launcherExePath)) ||
                                                           (StringComparer.OrdinalIgnoreCase.Equals(x.ProcessName, currentProcessName) &&
                                                            StringComparer.OrdinalIgnoreCase.Equals(GetProcessFilePath(x), currentProcessLocation))))
                                          .ToArray();
                    if (targetProcesses.Any())
                    {
                        foreach (var process in targetProcesses)
                        {
                            process.Kill();
                        }

                        Found?.Invoke(App.Current, new EventsArgs <Process[]>(targetProcesses));
                        listenInterval = DuplicatedProcessesListenerInterval_onFound;
                    }
                    else
                    {
                        listenInterval = DuplicatedProcessesListenerInterval;
                    }
                    //crutch
                    foreach (var process in processes)
                    {
                        process.Dispose();
                    }
                }
                catch (Exception e)
                {
                    Log.Warn("Ошибка во время получения процессов в DuplicatedProcessesListener. Возможной причиной может являться антивирус или отсутвие доступа.", e);
                }
            });

            SystemUtils.StartTimer((token) => action(), () => listenInterval);
        }
Ejemplo n.º 18
0
        ////////////////////////////////
        // Arguments ::= (PositionalArgs ( ',' NamedArgs)?) | NamedArgs
        //
        private IEnumerable <XamlNode> P_Arguments(Found f)
        {
            Found f2 = new Found();

            // Arguments ::= @ (PositionalArgs ( ',' NamedArgs)?) | NamedArgs
            switch (_tokenizer.Token)
            {
            case MeTokenType.Close:  // not found
                break;

            // Arguments ::= (@ PositionalArgs ( ',' NamedArgs)?) | NamedArgs
            case MeTokenType.String:
            case MeTokenType.QuotedMarkupExtension:
            case MeTokenType.Open:
                foreach (XamlNode node in P_PositionalArgs(f2))
                {
                    yield return(node);
                }
                f.found = f2.found;
                if (f.found)
                {
                    if (_context.CurrentArgCount > 0)
                    {
                        yield return(Logic_EndPositionalParameters());
                    }
                }

                // Arguments ::= (PositionalArgs @ ( ',' NamedArgs)?) | NamedArgs
                while (_tokenizer.Token == MeTokenType.Comma)
                {
                    // Arguments ::= (PositionalArgs ( @ ',' NamedArgs)?) | NamedArgs
                    NextToken();

                    // Arguments ::= (PositionalArgs ( ',' @ NamedArgs)?) | NamedArgs
                    foreach (XamlNode node in P_NamedArgs(f2))
                    {
                        yield return(node);
                    }
                }
                break;

            // Arguments ::= (PositionalArgs ( ',' NamedArgs)?) | @ NamedArgs
            case MeTokenType.PropertyName:
                foreach (XamlNode node in P_NamedArgs(f2))
                {
                    yield return(node);
                }
                f.found = f2.found;
                break;

            default:
                SetBrokenRuleString("Arguments ::= @ (PositionalArgs ( ',' NamedArgs)?) | NamedArgs");
                break;
            }
        }
Ejemplo n.º 19
0
 private void pnlGreen_Click(object sender, EventArgs e)
 {
     if (_foundEggs == Found.FoundRed)
     {
         _foundEggs = Found.FoundGreen;
     }
     else
     {
         _foundEggs = Found.None;
     }
 }
Ejemplo n.º 20
0
 public Found[] ListAllByKind(string kind)
 {
     DataTable table = SqlHelper.ExecuteDataTable("select * from Tb_Found where Kind=@kind and IsDeleted=0 ",
         new SqlParameter("@Kind", kind));
     Found[] dt = new Found[table.Rows.Count];
     for (int i = 0; i < table.Rows.Count; i++)
     {
         dt[i] = ToModel(table.Rows[i]);
     }
     return dt;
 }
Ejemplo n.º 21
0
 private void pnlBlue_Click(object sender, EventArgs e)
 {
     if (_foundEggs == Found.FoundGreen)
     {
         var win = new Form2();
         win.ShowDialog(this);
     }
     else
     {
         _foundEggs = Found.None;
     }
 }
Ejemplo n.º 22
0
        public static void MethodName3()
        {
            var myApp     = new Application("C:\\TestApp\\UIAutomation.TestApp.exe");
            var appWindow = myApp.Start();
            var editBox   = appWindow.Locate <ComboBox>(Found.ByAutomationId("comboboxAutomationId"));

            //editBox.GetSelection

            Assert.That(editBox.GetSelection, Is.EqualTo(0));

            myApp.Close();
        }
Ejemplo n.º 23
0
        public static void MethodName()
        {
            var myApp     = new Application("C:\\TestApp\\UIAutomation.TestApp.exe");
            var appWindow = myApp.Start();
            var editBox   = appWindow.Locate <Edit>(Found.ByAutomationId("textboxAutomationId"));

            editBox.Value = "Hello World";

            Assert.That(editBox.Value, Is.EqualTo("Hello World"));

            myApp.Close();
        }
Ejemplo n.º 24
0
        public static void MethodName2()
        {
            var myApp     = new Application("C:\\TestApp\\UIAutomation.TestApp.exe");
            var appWindow = myApp.Start();
            var editBox   = appWindow.Locate <CheckBox>(Found.ByAutomationId("checkboxAutomationId"));

            editBox.Check();

            Assert.That(editBox.IsChecked, Is.True);

            myApp.Close();
        }
Ejemplo n.º 25
0
 public void Insert(Found model)
 {
     SqlHelper.ExecuteNonQuery(@"insert into Tb_Found(Id,Name,Address,Image,Phone,Remark,Time)
                                 values(@Id,@Name,@Address,@Image,@Phone,@Remark,@Time)",
     new SqlParameter("@Id", model.Id),
     new SqlParameter("@Name", model.Name),
     new SqlParameter("@Address", model.Address),
     new SqlParameter("@Image", model.Image),
     new SqlParameter("@Phone", model.Phone),
     new SqlParameter("@Remark", model.Remark),
     new SqlParameter("@Time", model.Time));
 }
Ejemplo n.º 26
0
        //ФУНКЦИЯ РАБОТЫ С АЛФАВИТОМ ПРИ РАСШИФРОВАНИИ
        private void PlayfairDec(ref Found left, ref Found right)
        {
            if (left.row == right.row)
            {
                if (left.col == 0)
                {
                    left.alpabet = alphabet[left.row * 10 + 9];
                }
                else
                {
                    left.alpabet = alphabet[left.row * 10 + left.col - 1];
                }

                if (right.col == 0)
                {
                    right.alpabet = alphabet[right.row * 10 + 9];
                }
                else
                {
                    right.alpabet = alphabet[right.row * 10 + (right.col - 1)];
                }
                return;
            }
            if (left.col == right.col) //50 51 52 53 54 55 56 57 58 59
            {
                if (left.row == 0)
                {
                    left.alpabet = alphabet[50 + left.col];
                }
                else
                {
                    left.alpabet = alphabet[(left.row * 10 + left.col - 10)];
                }
                if (right.row == 0)
                {
                    right.alpabet = alphabet[50 + right.col];
                }
                else
                {
                    right.alpabet = alphabet[right.row * 10 + right.col - 10];
                }
                return;
            }
            else
            {
                //квадратик
                left.alpabet  = alphabet[left.row * 10 + right.col];
                right.alpabet = alphabet[right.row * 10 + left.col];
                return;
            }
        }
        private IEnumerable <XamlNode> P_MarkupExtension(Found f)
        {
            if (this.Expect(MeTokenType.Open, "MarkupExtension ::= @'{' Expr '}'"))
            {
                this.NextToken();
                if (this._tokenizer.Token != MeTokenType.TypeName)
                {
                    this.SetBrokenRuleString("MarkupExtension ::= '{' @TYPENAME (Arguments)? '}'");
                }
                else
                {
                    XamlType tokenType = this._tokenizer.TokenType;
                    yield return(this.Logic_StartElement(tokenType, this._tokenizer.Namespace));

                    this.NextToken();
                    Found iteratorVariable1 = new Found();
                    switch (this._tokenizer.Token)
                    {
                    case MeTokenType.PropertyName:
                    case MeTokenType.String:
                    case MeTokenType.QuotedMarkupExtension:
                    case MeTokenType.Open:
                    {
                        IEnumerator <XamlNode> enumerator = this.P_Arguments(iteratorVariable1).GetEnumerator();
                        while (enumerator.MoveNext())
                        {
                            XamlNode current = enumerator.Current;
                            yield return(current);
                        }
                        break;
                    }

                    default:
                        this.SetBrokenRuleString("MarkupExtension ::= '{' TYPENAME @(Arguments)? '}'");
                        break;
                        yield return(this.Logic_EndObject());

                        this.NextToken();
                        f.found = true;
                        break;
                    }
                    if (iteratorVariable1.found && this.Expect(MeTokenType.Close, "MarkupExtension ::= '{' TYPENAME (Arguments)? @'}'"))
                    {
                        yield return(this.Logic_EndObject());

                        f.found = true;
                        this.NextToken();
                    }
                }
            }
        }
Ejemplo n.º 28
0
        public override int GetHashCode()
        {
            int hash = 1;

            if (Found != false)
            {
                hash ^= Found.GetHashCode();
            }
            if (FilePath.Length != 0)
            {
                hash ^= FilePath.GetHashCode();
            }
            return(hash);
        }
Ejemplo n.º 29
0
        public IRaycastable Raycast(out RaycastHit?hit)
        {
            if (lastFound.frame == Time.frameCount)
            {
                hit = lastFound.hit;
                return(lastFound.obj);
            }

            var raycastable = IRaycastable.Raycast(orientation.pos, orientation.rot, out hit);

            lastFound = new Found(Time.frameCount, hit, raycastable);

            return(raycastable);
        }
Ejemplo n.º 30
0
        /// <summary>
        /// Checks if a domain exists in the DNS server's cache
        /// </summary>
        /// <params>
        /// <param name="dnsIp">DNS server's IP address</param>
        /// <param name="query">Query to be executed</param>
        /// </params>
        /// <returns>True if it exists</returns>
        private bool ExistsInDnsServerCache(string dnsIp, string query)
        {
            var r = new Heijden.DNS.Resolver(dnsIp)
            {
                Recursion = false
            };

            if (r.Query(query, Heijden.DNS.QType.A, Heijden.DNS.QClass.IN).Answers.Count > 0)
            {
                Found?.Invoke(query, null);
                return(true);
            }
            return(false);
        }
Ejemplo n.º 31
0
        public List <Found> GetFoundsPersonalArea(Person person)
        {
            SqlCommand    cmd         = ConnectSql(string.Format("Select * From Found Where FindID = '{0}'", person.PersonID));
            SqlDataReader reader      = cmd.ExecuteReader();
            List <Found>  resultFound = new List <Found>();
            Found         found       = new Found();

            while (reader.Read())
            {
                resultFound.Add(found.Initialization(reader));
            }
            connection.DisConnectSql();
            int x = resultFound.Count();

            return(resultFound);
        }
Ejemplo n.º 32
0
        private void _FetchRemaining
        (
            ServerResponse mainResponse,
            int expected
        )
        {
            if (ReferenceEquals(Found, null))
            {
                return;
            }

            if (!_subCommand && expected > IrbisConstants.MaxPostings)
            {
                int firstRecord = FirstRecord + Found.Count;

                while (firstRecord < expected)
                {
                    SearchCommand subCommand = Clone();
                    subCommand.FirstRecord     = firstRecord;
                    subCommand.NumberOfRecords =
                        Math.Min
                        (
                            expected - firstRecord + 1,
                            IrbisConstants.MaxPostings
                        );
                    subCommand._subCommand = true;

                    ClientQuery    clientQuery = subCommand.CreateQuery();
                    ServerResponse subResponse = subCommand
                                                 .Execute(clientQuery);
                    subCommand.CheckResponse(subResponse);

                    List <FoundItem> found = subCommand.Found
                                             .ThrowIfNull("Found");
                    int count = found.Count;
                    Found.ThrowIfNull().AddRange(found);

                    Debug.Assert
                    (
                        count != 0,
                        "Found.Count == 0 in SubCommand"
                    );

                    firstRecord += count;
                }
            }
        }
Ejemplo n.º 33
0
        public void GetSeoul(DateTime today)
        {
            string url_Seoul = "http://openapi.seoul.go.kr:8088/76676170526a7268313032484a736978/xml/lostArticleInfo/" +
                               1 + "/" +
                               1000 + "/";

            XmlDocument xdoc = new XmlDocument();

            xdoc.Load(url_Seoul);
            XmlNodeList xnodeList = xdoc.DocumentElement.SelectNodes("/lostArticleInfo/row");

            foreach (XmlNode xnode in xnodeList)
            {
                if (xnode["STATUS"].InnerText != "수령")
                {
                    if (DateTime.Compare(today.AddDays(-7),
                                         Convert.ToDateTime(xnode["REG_DATE"].InnerText)) <= 0)
                    {
                        Found found_Seoul = new Found();

                        found_Seoul.Found_DateTime    = Convert.ToDateTime(xnode["REG_DATE"].InnerText);
                        found_Seoul.Found_BigCate     = xnode["CATE"].InnerText;
                        found_Seoul.Found_Name        = xnode["GET_NAME"].InnerText;
                        found_Seoul.Found_GetPosition = xnode["GET_POSITION"].InnerText;
                        found_Seoul.Found_data        = "서울시";

                        using (var db = new NoteDBContext())
                        {
                            var data = db.Found
                                       .FirstOrDefault(d => d.Found_DateTime.Equals(found_Seoul.Found_DateTime) &&
                                                       d.Found_BigCate.Equals(found_Seoul.Found_BigCate) &&
                                                       d.Found_Name.Equals(found_Seoul.Found_Name) &&
                                                       d.Found_GetPosition.Equals(found_Seoul.Found_GetPosition) &&
                                                       d.Found_data.Equals(found_Seoul.Found_data)
                                                       );

                            if (data == null)
                            {
                                db.Found.Add(found_Seoul);
                                db.SaveChanges();
                            }
                        }
                    }
                }
            }
        }
Ejemplo n.º 34
0
 public void Update(Found model)
 {
     SqlHelper.ExecuteNonQuery(@"UPDATE Tb_Found set
                                 Id = @Id,
                                 Name = @Name,
                                 Address = @Address,
                                 Image = @Image,
                                 Phone = @Phone,
                                 Remark = @Remark,
                                 Time = @Time WHERE Id=@Id",
         new SqlParameter("@Id", model.Id),
         new SqlParameter("@Name", model.Name),
         new SqlParameter("@Address", model.Address),
         new SqlParameter("@Image", model.Image),
         new SqlParameter("@Phone", model.Phone),
         new SqlParameter("@Remark", model.Remark),
         new SqlParameter("@Time", model.Time));
 }
 public IEnumerable<XamlNode> Parse(string text, int lineNumber, int linePosition)
 {
     this._tokenizer = new MeScanner(this._context, text, lineNumber, linePosition);
     this._originalText = text;
     Found f = new Found();
     this.NextToken();
     foreach (XamlNode iteratorVariable1 in this.P_MarkupExtension(f))
     {
         yield return iteratorVariable1;
     }
     if (!f.found)
     {
         string message = this._brokenRule;
         this._brokenRule = null;
         throw new XamlParseException(this._tokenizer, message);
     }
     if (this._tokenizer.Token != MeTokenType.None)
     {
         throw new XamlParseException(this._tokenizer, System.Xaml.SR.Get("UnexpectedTokenAfterME"));
     }
     if (this._tokenizer.HasTrailingWhitespace)
     {
         throw new XamlParseException(this._tokenizer, System.Xaml.SR.Get("WhitespaceAfterME"));
     }
 }
 private IEnumerable<XamlNode> P_MarkupExtension(Found f)
 {
     if (this.Expect(MeTokenType.Open, "MarkupExtension ::= @'{' Expr '}'"))
     {
         this.NextToken();
         if (this._tokenizer.Token != MeTokenType.TypeName)
         {
             this.SetBrokenRuleString("MarkupExtension ::= '{' @TYPENAME (Arguments)? '}'");
         }
         else
         {
             XamlType tokenType = this._tokenizer.TokenType;
             yield return this.Logic_StartElement(tokenType, this._tokenizer.Namespace);
             this.NextToken();
             Found iteratorVariable1 = new Found();
             switch (this._tokenizer.Token)
             {
                 case MeTokenType.PropertyName:
                 case MeTokenType.String:
                 case MeTokenType.QuotedMarkupExtension:
                 case MeTokenType.Open:
                 {
                     IEnumerator<XamlNode> enumerator = this.P_Arguments(iteratorVariable1).GetEnumerator();
                     while (enumerator.MoveNext())
                     {
                         XamlNode current = enumerator.Current;
                         yield return current;
                     }
                     break;
                 }
                 default:
                     this.SetBrokenRuleString("MarkupExtension ::= '{' TYPENAME @(Arguments)? '}'");
                     break;
                     yield return this.Logic_EndObject();
                     this.NextToken();
                     f.found = true;
                     break;
             }
             if (iteratorVariable1.found && this.Expect(MeTokenType.Close, "MarkupExtension ::= '{' TYPENAME (Arguments)? @'}'"))
             {
                 yield return this.Logic_EndObject();
                 f.found = true;
                 this.NextToken();
             }
         }
     }
 }
        private IEnumerable<XamlNode> P_NamedArg(Found f)
        {
            Found iteratorVariable0 = new Found();
            if (this._tokenizer.Token == MeTokenType.PropertyName)
            {
                XamlMember tokenProperty = this._tokenizer.TokenProperty;
                yield return this.Logic_StartMember();
                this.NextToken();
                this.Expect(MeTokenType.EqualSign, "NamedArg ::= PROPERTYNAME @'=' Value");
                this.NextToken();
                switch (this._tokenizer.Token)
                {
                    case MeTokenType.PropertyName:
                        string str;
                        if (this._context.CurrentMember == null)
                        {
                            str = System.Xaml.SR.Get("MissingComma1", new object[] { this._tokenizer.TokenText });
                        }
                        else
                        {
                            str = System.Xaml.SR.Get("MissingComma2", new object[] { this._context.CurrentMember.Name, this._tokenizer.TokenText });
                        }
                        throw new XamlParseException(this._tokenizer, str);

                    case MeTokenType.QuotedMarkupExtension:
                    {
                        MePullParser iteratorVariable1 = new MePullParser(this._context);
                        foreach (XamlNode iteratorVariable2 in iteratorVariable1.Parse(this._tokenizer.TokenText, this.LineNumber, this.LinePosition))
                        {
                            yield return iteratorVariable2;
                        }
                        f.found = true;
                        this.NextToken();
                        break;
                    }
                    case MeTokenType.Open:
                    {
                        IEnumerator<XamlNode> enumerator = this.P_Value(iteratorVariable0).GetEnumerator();
                        while (enumerator.MoveNext())
                        {
                            XamlNode current = enumerator.Current;
                            yield return current;
                        }
                        f.found = iteratorVariable0.found;
                        break;
                    }
                    default:
                        this.SetBrokenRuleString("NamedArg ::= PROPERTYNAME '=' @(STRING | QUOTEDMARKUPEXTENSION | MarkupExtension)");
                        break;
                        yield return this.Logic_Text();
                        f.found = true;
                        this.NextToken();
                        break;
                }
                yield return this.Logic_EndMember();
            }
        }
Ejemplo n.º 38
0
 private Found ToModel(DataRow row)
 {
     Found model = new Found();
     model.Id = (System.Guid)SqlHelper.FromDBValue(row["Id"]);
     model.Name = (System.String)SqlHelper.FromDBValue(row["Name"]);
     model.Address = (System.String)SqlHelper.FromDBValue(row["Address"]);
     model.Image = (System.Byte[])SqlHelper.FromDBValue(row["Image"]);
     model.Phone = (System.String)SqlHelper.FromDBValue(row["Phone"]);
     model.Remark = (System.String)SqlHelper.FromDBValue(row["Remark"]);
     model.Time = (System.DateTime)SqlHelper.FromDBValue(row["Time"]);
     return model;
 }
 private IEnumerable<XamlNode> P_NamedArgs(Found f)
 {
     Found iteratorVariable0 = new Found();
     if (this._tokenizer.Token == MeTokenType.PropertyName)
     {
         foreach (XamlNode iteratorVariable1 in this.P_NamedArg(iteratorVariable0))
         {
             yield return iteratorVariable1;
         }
         f.found = iteratorVariable0.found;
         while (this._tokenizer.Token == MeTokenType.Comma)
         {
             this.NextToken();
             foreach (XamlNode iteratorVariable2 in this.P_NamedArg(iteratorVariable0))
             {
                 yield return iteratorVariable2;
             }
         }
     }
     else
     {
         this.SetBrokenRuleString("NamedArgs ::= @NamedArg ( ',' NamedArg )*");
     }
 }
 private IEnumerable<XamlNode> P_Value(Found f)
 {
     Found iteratorVariable0 = new Found();
     switch (this._tokenizer.Token)
     {
         case MeTokenType.QuotedMarkupExtension:
         {
             MePullParser iteratorVariable1 = new MePullParser(this._context);
             foreach (XamlNode iteratorVariable2 in iteratorVariable1.Parse(this._tokenizer.TokenText, this.LineNumber, this.LinePosition))
             {
                 yield return iteratorVariable2;
             }
             f.found = true;
             this.NextToken();
             break;
         }
         case MeTokenType.Open:
         {
             IEnumerator<XamlNode> enumerator = this.P_MarkupExtension(iteratorVariable0).GetEnumerator();
             while (enumerator.MoveNext())
             {
                 XamlNode current = enumerator.Current;
                 yield return current;
             }
             f.found = iteratorVariable0.found;
             break;
         }
         default:
             break;
             yield return this.Logic_Text();
             f.found = true;
             this.NextToken();
             break;
     }
 }
 private IEnumerable<XamlNode> P_PositionalArgs(Found f)
 {
     Found iteratorVariable0 = new Found();
     switch (this._tokenizer.Token)
     {
         case MeTokenType.PropertyName:
         {
             if (this._context.CurrentArgCount > 0)
             {
                 yield return this.Logic_EndPositionalParameters();
             }
             IEnumerator<XamlNode> enumerator = this.P_NamedArg(iteratorVariable0).GetEnumerator();
             while (enumerator.MoveNext())
             {
                 XamlNode current = enumerator.Current;
                 yield return current;
             }
             if (!iteratorVariable0.found)
             {
                 this.SetBrokenRuleString("PositionalArgs ::= (Value (',' PositionalArgs)?) | @ NamedArg");
             }
             f.found = iteratorVariable0.found;
             break;
         }
         default:
         {
             int num2;
             this.SetBrokenRuleString("PositionalArgs ::= @ (Value (',' PositionalArgs)?) | NamedArg");
             break;
             this._context.CurrentArgCount = (num2 = this._context.CurrentArgCount) + 1;
             if (num2 == 0)
             {
                 yield return this.Logic_StartPositionalParameters();
             }
             IEnumerator<XamlNode> iteratorVariable5 = this.P_Value(iteratorVariable0).GetEnumerator();
             while (iteratorVariable5.MoveNext())
             {
                 XamlNode iteratorVariable1 = iteratorVariable5.Current;
                 yield return iteratorVariable1;
             }
             if (!iteratorVariable0.found)
             {
                 this.SetBrokenRuleString("PositionalArgs ::= (NamedArg | (@Value (',' PositionalArgs)?)");
             }
             else
             {
                 f.found = iteratorVariable0.found;
                 if (this._tokenizer.Token == MeTokenType.Comma)
                 {
                     Found iteratorVariable2 = new Found();
                     this.NextToken();
                     foreach (XamlNode iteratorVariable3 in this.P_PositionalArgs(iteratorVariable2))
                     {
                         yield return iteratorVariable3;
                     }
                     if (!iteratorVariable2.found)
                     {
                         this.SetBrokenRuleString("PositionalArgs ::= (Value (',' @ PositionalArgs)?) | NamedArg");
                     }
                 }
             }
             break;
         }
     }
 }