Esempio n. 1
0
 public override bool equals(object other)
 {
     if (other is LiteralWrapper)
     {
         return(r.Equals(((LiteralWrapper)other).r));
     }
     else if (other is org.openrdf.model.Literal)
     {
         return(r.Equals(GetLiteral((org.openrdf.model.Literal)other)));
     }
     return(false);
 }
Esempio n. 2
0
        /// <summary>
        /// Returns a value indicating whether this instance and a specified <see cref="Token"/> object represent the same value.
        /// </summary>
        /// <param name="token">A <see cref="Token"/> to compare to this instance.</param>
        /// <returns>True if <paramref name="token"/> is equal to this instance; otherwise, false.</returns>
        public bool Equals(Token token)
        {
            if (token is null)
            {
                return(false);
            }

            if (ReferenceEquals(token, this))
            {
                return(true);
            }

            if (!(Type == token.Type &&
                  Lexeme == token.Lexeme &&
                  Line == token.Line))
            {
                return(false);
            }

            if (Literal == null)
            {
                return(token.Literal == null);
            }

            return(Literal.Equals(token.Literal));
        }
Esempio n. 3
0
 /// <summary>
 /// 行绑定事件
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 protected void RepeaterList_ItemDataBound(object sender, RepeaterItemEventArgs e)
 {
     if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
     {
         Literal ltr = (Literal)e.Item.FindControl("ltrXH");
         if (!ltr.Equals(null))
         {
             ltr.Text = (intPageSize * (CurrencyPage - 1) + e.Item.ItemIndex + 1).ToString();
         }
         LinkButton lkbD      = (LinkButton)e.Item.FindControl("lkbDel");
         LinkButton lkbCancel = (LinkButton)e.Item.FindControl("lkbCancel");
         if (!lkbD.Equals(null))
         {
             if (!CheckMasterGrant(YuYingPermission.宾访谈_管理该栏目, YuYingPermission.宾访谈_顾问团队审核))
             {
                 lkbD.Attributes.Add("onclick", "alert('对不起,您还没有该权限!');return false;");
             }
             else
             {
                 lkbD.Attributes.Add("onclick", "return confirm('确定要进行删除操作吗?');");
             }
         }
         if (lkbCancel != null)
         {
             if (!CheckMasterGrant(YuYingPermission.宾访谈_管理该栏目, YuYingPermission.宾访谈_顾问团队审核))
             {
                 lkbCancel.Attributes.Add("onclick", "alert('对不起,您还没有该权限!');return false;");
             }
         }
     }
 }
Esempio n. 4
0
        public bool Equals(Identity <TId> other)
        {
            if (other == null)
            {
                return(false);
            }

            return(Literal.Equals(other.Literal));
        }
        private void DoEqualsTest(object a, LiteralType aType, object b, LiteralType bType, bool expected)
        {
            // Arrange
            Literal aa = new Literal(a, aType);
            Literal bb = new Literal(b, bType);

            // Act
            bool result = aa.Equals(bb);

            // Assert
            Assert.AreEqual(expected, result);
        }
Esempio n. 6
0
 /// <summary>
 /// 行绑定事件
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 protected void RepeaterList_ItemDataBound(object sender, RepeaterItemEventArgs e)
 {
     if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
     {
         Literal ltr = (Literal)e.Item.FindControl("ltrXH");
         if (!ltr.Equals(null))
         {
             ltr.Text = (intPageSize * (CurrencyPage - 1) + e.Item.ItemIndex + 1).ToString();
         }
         ;
     }
 }
Esempio n. 7
0
 public bool Equals(DataValueLiteral other)
 {
     if (ReferenceEquals(null, other))
     {
         return(false);
     }
     if (ReferenceEquals(this, other))
     {
         return(true);
     }
     return(Literal.Equals(other.Literal) && Constraints.Equals(other.Constraints));
 }
Esempio n. 8
0
        public override bool Equals(object ao)
        {
            if (ao == null)
            {
                return(false);
            }
            if (!(ao.GetType() == typeof(ExecuteAction)))
            {
                return(false);
            }
            ExecuteAction a = (ExecuteAction)ao;

            return(action.Equals(a.action));
        }
Esempio n. 9
0
        public bool UnifiesNamespace(Literal t1s, Literal t2s)
        {
            // If both are the default NS
            if (t1s == Literal.DefaultNS && t2s == Literal.DefaultNS)
            {
                return(true);
            }

            // Compares namespaces of t1s and t2s
            t1s = t1s.GetNS();
            t2s = t2s.GetNS();
            // Faster than UnifiesNoUndo
            if (t1s.Equals(t2s))
            {
                return(true);
            }
            return(UnifiesNoUndo(t1s, t2s));
        }
Esempio n. 10
0
        public void testEquals()
        {
            Literal literal1 = new Literal(SYMBOL_P);
            Literal literal2 = new Literal(SYMBOL_P);

            Assert.IsTrue(literal1.Equals(literal2));

            literal1 = new Literal(SYMBOL_P, false);
            literal2 = new Literal(SYMBOL_P, false);
            Assert.IsTrue(literal1.Equals(literal2));

            literal1 = new Literal(SYMBOL_P);
            literal2 = new Literal(SYMBOL_P, false);
            Assert.IsFalse(literal1.Equals(literal2));

            literal1 = new Literal(SYMBOL_P);
            literal2 = new Literal(SYMBOL_Q);
            Assert.IsFalse(literal1.Equals(literal2));

            literal1 = new Literal(SYMBOL_P);
            Assert.IsFalse(literal1.Equals(SYMBOL_P));
        }
Esempio n. 11
0
    private void MenuClick(Object sender, EventArgs e)
    {
        MenuItem m       = (MenuItem)sender;
        String   command = m.Text.Replace("&", "");

        if (command.Equals("New"))
        {
            New();
        }
        else if (command.Equals("Open"))
        {
            Open();
        }
        else if (command.Equals("Save"))
        {
            if ((fullPath == null) || (fullPath.Length == 0))
            {
                SaveAs();
            }
            else
            {
                Save();
            }
        }
        else if (command.Equals("Save As"))
        {
            SaveAs();
        }
        else if (command.Equals("Exit"))
        {
            Exit();
        }
        else if (command.Equals("Undo"))
        {
            ControlActive().Undo();
        }
        else if (command.Equals("Redo"))
        {
            ControlActive().Redo();
        }
        else if (command.Equals("Cut"))
        {
            ControlActive().Cut();
        }
        else if (command.Equals("Copy"))
        {
            ControlActive().Copy();
        }
        else if (command.Equals("Paste"))
        {
            ControlActive().Paste();
        }
        else if (command.Equals("Delete"))
        {
            ControlActive().Delete();
        }
        else if (command.Equals("Select All"))
        {
            ControlActive().SelectAll();
        }
        else if (command.Equals("Fold"))
        {
            ControlActive().ToggleFold();
        }
        else if (command.Equals("Fold All"))
        {
            ControlActive().FoldAll(ControlActive().fcFold);
        }
        else if (command.Equals("Show All"))
        {
            ControlActive().FoldAll(ControlActive().fcShow);
        }
        else if (command.Equals("Find"))
        {
            SearchFind();
        }
        else if (command.Equals("Find Next"))
        {
            if (findWhat.Equals(""))
            {
                SearchFind();
            }
            else
            {
                SearchFindNext();
            }
        }
        else if (command.Equals("Replace"))
        {
            SearchReplace();
        }
        else if (command.Equals("Hide"))
        {
            SelectPane(0);
        }
        else if (command.Equals("Wrap"))
        {
            ControlActive().ToggleWrap();
            CheckMenus();
        }
        else if (command.Equals("Switch Pane"))
        {
            if (tc[0].textArea.hasFocus())
            {
                tc[1].GrabFocus();
            }
            else
            {
                tc[0].GrabFocus();
            }
        }
    }