string.Equals(string)

Here are the examples of the csharp api class string.Equals(string) taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.

200 Examples 7

1. Example

Project: TraceLab
Source File: EnumValue.cs
public bool Equals(EnumValue other)
        {
            if (other != null && Value != null)
            {
                return Value.Equals(other.Value);
            }
            else if (other != null && Value == null && other.Value == null)
            {
                return true;
            }

            return false;
        }

2. Example

Project: TraceLab
Source File: RecentExperimentReference.cs
public bool Equals(RecentExperimentReference other)
        {
            return this.m_fullPath.Equals(other.m_fullPath);
        }

3. Example

Project: TraceLab
Source File: SettingsPath.cs
public override bool Equals (Object other)
        {
            SettingsPath path = other as SettingsPath;

            if(path != null)
                return this.Path.Equals(path.Path);

            return false;
        }

4. Example

Project: TraceLab
Source File: EnumerationEditorCell.cs
private void setActiveComboBoxValue (Gtk.ComboBox cb, string s)
        {                      
            Gtk.TreeIter iter;
            cb.Model.GetIterFirst (out iter);
            do {
                    GLib.Value thisRow = new GLib.Value ();
                    cb.Model.GetValue (iter, 0, ref thisRow);
                    if ((thisRow.Val as string).Equals (s)) {
                        cb.SetActiveIter (iter);
                            break;
                }
            } while (cb.Model.IterNext (ref iter));          
        }

5. Example

Project: TraceLab
Source File: DecisionInfoPanel.cs
private void setActiveComboBoxValue (Gtk.ComboBox cb, string s)
        {                      
            Gtk.TreeIter iter;
            cb.Model.GetIterFirst (out iter);
            do {
                GLib.Value thisRow = new GLib.Value ();
                cb.Model.GetValue (iter, 0, ref thisRow);
                if ((thisRow.Val as string).Equals (s)) {
                    cb.SetActiveIter (iter);
                    break;
                }
            } while (cb.Model.IterNext (ref iter));          
        }

6. Example

Project: TraceLab
Source File: BasicNodeControl.cs
private void RedrawOnIsExecutingChange (object sender, System.ComponentModel.PropertyChangedEventArgs e)
        {
            if(e.PropertyName.Equals(isExecutingPropertyName))
            {
                Invalidate();
            }
        }

7. Example

Project: TraceLab
Source File: AboutExperimentDialog.cs
private void setActiveComboBoxValue (Gtk.ComboBox cb, string s)
        {                      
            Gtk.TreeIter iter;
            cb.Model.GetIterFirst (out iter);
            do {
                GLib.Value thisRow = new GLib.Value ();
                cb.Model.GetValue (iter, 0, ref thisRow);
                if ((thisRow.Val as string).Equals (s)) {
                    cb.SetActiveIter (iter);
                    break;
                }
            } while (cb.Model.IterNext (ref iter));          
        }

8. Example

Project: TraceLab
Source File: LoopDecisionInfoPanel.cs
private void setActiveComboBoxValue (Gtk.ComboBox cb, string s)
        {            
            Gtk.TreeIter iter;
            cb.Model.GetIterFirst (out iter);
            do {
                GLib.Value thisRow = new GLib.Value ();
                cb.Model.GetValue (iter, 0, ref thisRow);
                if ((thisRow.Val as string).Equals (s)) {
                    cb.SetActiveIter (iter);
                    break;
                }
            } while (cb.Model.IterNext (ref iter));  
        }

9. Example

Project: TraceLab
Source File: MainWindow.cs
private void HandleApplicationPropertyChanged (object sender, System.ComponentModel.PropertyChangedEventArgs e)
        {
            if (e.PropertyName.Equals ("ExperimentName")) {
                this.WindowShell.Title = (sender as ApplicationViewModel).ExperimentName;
            }
        }

10. Example

Project: TraceLab
Source File: ConfigPropertyTemplateSelector.cs
private DataTemplate FindDataTemplate(Property property, ResourceDictionary templates)
        {
            DataTemplate template = null;

            string propType = property.PropertyType.FullName;

            if (propType.Equals(typeof(TraceLabSDK.Component.Config.FilePath).FullName) == true ||
                propType.Equals(typeof(TraceLabSDK.Component.Config.DirectoryPath).FullName) == true)
            {
                  object dataTempalteKey = new DataTemplateKey(property.PropertyType);
                  template = templates[dataTempalteKey] as DataTemplate;
            }
            return template;
        }

11. Example

Project: TraceLab
Source File: TLArtifact.cs
public override bool Equals(object obj)
        {
            TLArtifact other = obj as TLArtifact;

            if (other != null)
            {
                return Id.Equals(other.Id) && Text.Equals(other.Text);
            }
            return false;
        }

12. Example

Project: commandline
Source File: NameInfo.cs
public bool Equals(NameInfo other)
        {
            if (other == null)
            {
                return false;
            }

            return ShortName.Equals(other.ShortName) && LongName.Equals(other.LongName);
        }

13. Example

Project: concordion-net
Source File: ExceptionsTest.cs
public object countsFromExecutingSnippetWithSimulatedEvaluationResult(string snippet, string simulatedResult)
        {
            TestRig harness = new TestRig();
            if (simulatedResult.Equals("(An exception)"))
            {
                harness.WithStubbedEvaluationResult(new Exception("simulated exception"));
            }
            else
            {
                harness.WithStubbedEvaluationResult(simulatedResult);
            }
            return harness.ProcessFragment(snippet);
        }

14. Example

Project: ContinuousTests
Source File: Money.cs
public IMoney AddMoney(Money m) 
		{
			if (m.Currency.Equals(Currency) )
				return new Money(Amount+m.Amount, Currency);
			return new MoneyBag(this, m);
		}

15. Example

Project: ContinuousTests
Source File: Money.cs
public override bool Equals(Object anObject) 
		{
			if (IsZero)
				if (anObject is IMoney)
					return ((IMoney)anObject).IsZero;
			if (anObject is Money) 
			{
				Money aMoney= (Money)anObject;
				return aMoney.Currency.Equals(Currency)
					&& Amount == aMoney.Amount;
			}
			return false;
		}

16. Example

Project: ContinuousTests
Source File: Addin.cs
public override bool Equals(object obj)
        {
            Addin addin = obj as Addin;
            if (addin == null)
                return false;

            return this.typeName.Equals(addin.typeName);
        }

17. Example

Project: ContinuousTests
Source File: Money.cs
public IMoney AddMoney(Money m) 
		{
			if (m.Currency.Equals(Currency) )
				return new Money(Amount+m.Amount, Currency);
			return new MoneyBag(this, m);
		}

18. Example

Project: ContinuousTests
Source File: Money.cs
public override bool Equals(Object anObject) 
		{
			if (IsZero)
				if (anObject is IMoney)
					return ((IMoney)anObject).IsZero;
			if (anObject is Money) 
			{
				Money aMoney= (Money)anObject;
				return aMoney.Currency.Equals(Currency)
					&& Amount == aMoney.Amount;
			}
			return false;
		}

19. Example

Project: ContinuousTests
Source File: Addin.cs
public override bool Equals(object obj)
        {
            Addin addin = obj as Addin;
            if (addin == null)
                return false;

            return this.typeName.Equals(addin.typeName);
        }

20. Example

Project: ContinuousTests
Source File: Money.cs
public IMoney AddMoney(Money m) 
		{
			if (m.Currency.Equals(Currency) )
				return new Money(Amount+m.Amount, Currency);
			return new MoneyBag(this, m);
		}

21. Example

Project: ContinuousTests
Source File: Money.cs
public override bool Equals(Object anObject) 
		{
			if (IsZero)
				if (anObject is IMoney)
					return ((IMoney)anObject).IsZero;
			if (anObject is Money) 
			{
				Money aMoney= (Money)anObject;
				return aMoney.Currency.Equals(Currency)
					&& Amount == aMoney.Amount;
			}
			return false;
		}

22. Example

Project: ContinuousTests
Source File: Addin.cs
public override bool Equals(object obj)
        {
            Addin addin = obj as Addin;
            if (addin == null)
                return false;

            return this.typeName.Equals(addin.typeName);
        }

23. Example

Project: ContinuousTests
Source File: TestItem.cs
public bool IsTheSameTestAs(TestItem item)
        {
            if (item.Value == null)
                return false; // WTF!!?? == Fail
            return Key.Equals(item.Key) && Value.Runner.Equals(item.Value.Runner) && Value.Name.Equals(item.Value.Name) && Value.DisplayName.Equals(item.Value.DisplayName);
        }

24. Example

Project: ContinuousTests
Source File: FakeFileSystemService.cs
public string[] GetFiles(string path, string searchPattern)
        {
            _getFilesCalled = true;
            if (searchPattern.Equals(_searchPattern))
                return _projectFiles;
            return new string[] {};
        }

25. Example

Project: ContinuousTests
Source File: Money.cs
public IMoney AddMoney(Money m) 
		{
			if (m.Currency.Equals(Currency) )
				return new Money(Amount+m.Amount, Currency);
			return new MoneyBag(this, m);
		}

26. Example

Project: ContinuousTests
Source File: Money.cs
public override bool Equals(Object anObject) 
		{
			if (IsZero)
				if (anObject is IMoney)
					return ((IMoney)anObject).IsZero;
			if (anObject is Money) 
			{
				Money aMoney= (Money)anObject;
				return aMoney.Currency.Equals(Currency)
					&& Amount == aMoney.Amount;
			}
			return false;
		}

27. Example

Project: ContinuousTests
Source File: Money.cs
public IMoney AddMoney(Money m) 
		{
			if (m.Currency.Equals(Currency) )
				return new Money(Amount+m.Amount, Currency);
			return new MoneyBag(this, m);
		}

28. Example

Project: ContinuousTests
Source File: Money.cs
public override bool Equals(Object anObject) 
		{
			if (IsZero)
				if (anObject is IMoney)
					return ((IMoney)anObject).IsZero;
			if (anObject is Money) 
			{
				Money aMoney= (Money)anObject;
				return aMoney.Currency.Equals(Currency)
					&& Amount == aMoney.Amount;
			}
			return false;
		}

29. Example

Project: IL-boss
Source File: Helpers.cs
public static int TypeIndex( this List<string> typelist, string typename )
		{
			for( int i = 0; i < typelist.Count; i++ )
			{
				if( typelist[i].Equals( typename ) )
				{
					return i;
				}
			}
			return -1;
		}

30. Example

Project: saml-http-post-reference
Source File: IdPLauncher.aspx.cs
private void LoadAttributes(List<KeyValuePair<string, string>> AttributeValues)
        {
            foreach (KeyValuePair<string, string> AttributeValue in AttributeValues)
            {
                foreach (System.Web.UI.HtmlControls.HtmlTableRow tr in tblAttrs.Rows)
                {
                    if (tr.Cells[1].Controls.Count > 1)
                    {
                        if (((TextBox)tr.Cells[0].Controls[1]).Text.Equals(AttributeValue.Key))
                        {
                            TextBox AttrValue = (TextBox)tr.Cells[1].Controls[1];
                            AttrValue.Text = AttributeValue.Value;
                        }
                    }
                }
            }
        }

31. Example

Project: SF-Boilerplate
Source File: AppTenant.cs
public bool Equals(AppTenant other)
        {
            if (other == null)
            {
                return false;
            }

            return other.Name.Equals(Id);
        }

32. Example

Project: SF-Boilerplate
Source File: Guard.cs
public static void NotNullOrEmpty(string value, string paramName = "")
            {
                if (value == null)
                {
                    throw new ArgumentNullException(paramName, "String value cannot be null");
                }

                if (string.Empty.Equals(value))
                {
                    throw new ArgumentException("String value cannot be empty", paramName);
                }
            }

33. Example

Project: BoC
Source File: User.cs
virtual public bool ChangePassword(string oldPassword, string newPassword)
        {
            if (this.Password.Equals(oldPassword))
            {
                this.Password = newPassword;
                this.LastPasswordChange = DateTime.Now;
                return true;
            }
            else
            {
                return false;
            }
        }

34. Example

Project: SourceLink
Source File: Program.cs
public static bool HashesMatch(string fileHash, string gitHash)
        {
            if (fileHash == null || fileHash == null) return false;
            return fileHash.Equals(gitHash);
        }

35. Example

Project: CypherCore
Source File: MMapsCommands.cs
[Command("path", RBACPermissions.CommandMmapPath)]
        static bool PathCommand(StringArguments a/n ..... /n //View Source file for more details /n }

36. Example

Project: CypherCore
Source File: NPCCommands.cs
[Command("evade", RBACPermissions.CommandNpcEvade)]
        static bool HandleNpcEvadeCommand(String/n ..... /n //View Source file for more details /n }

37. Example

Project: CypherCore
Source File: ServerCommands.cs
[Command("closed", RBACPermissions.CommandServerSetClosed, true)]
            static bool SetClosed(StringArguments args, CommandHandler handler)
            {
                string arg1 = args.NextString();
                if (arg1.Equals("on"))
                {
                    handler.SendSysMessage(CypherStrings.WorldClosed);
                    Global.WorldMgr.SetClosed(true);
                    return true;
                }
                else if (arg1.Equals("off"))
                {
                    handler.SendSysMessage(CypherStrings.WorldOpened);
                    Global.WorldMgr.SetClosed(false);
                    return true;
                }

                handler.SendSysMessage(CypherStrings.UseBol);
                return false;
            }

38. Example

Project: ImageGlass
Source File: PluginServices.cs
public Types.AvailablePlugin Find(string pluginNameOrPath)
            {
                Types.AvailablePlugin toReturn = null;

                //Loop through all the plugins
                foreach (Types.AvailablePlugin pluginOn in List)
                {
                    //Find the one with the matching name or filename
                    if ((pluginOn.Instance.Name.Equals(pluginNameOrPath)) || pluginOn.AssemblyPath.Equals(pluginNameOrPath))
                    {
                        toReturn = pluginOn;
                        break;
                    }
                }
                return toReturn;
            }

39. Example

Project: SQLoogle
Source File: GenerateExtendedProperties.cs
private static string GetTypeDescription(string type)
        {
            if (type.Equals("PC")) return "PROCEDURE";
            if (type.Equals("P")) return "PROCEDURE";
            if (type.Equals("V")) return "VIEW";
            if (type.Equals("U")) return "TABLE";
            if (type.Equals("TR")) return "TRIGGER";
            if (type.Equals("TA")) return "TRIGGER";
            if (type.Equals("FS")) return "FUNCTION";
            if (type.Equals("FN")) return "FUNCTION";
            if (type.Equals("IF")) return "FUNCTION";
            if (type.Equals("TF")) return "FUNCTION";
            return "";
        }

40. Example

Project: SQLoogle
Source File: Assembly.cs
public override string ToSql()
        {
            string access = PermissionSet;
            if (PermissionSet.Equals("UNSAFE_ACCESS")) access = "UNSAFE";
            if (PermissionSet.Equals("SAFE_ACCESS")) access = "SAFE";
            string toSql = "CREATE ASSEMBLY ";
            toSql += FullName + "\r\n";
            toSql += "AUTHORIZATION " + Owner + "\r\n";
            toSql += "FROM " + Text + "\r\n";
            toSql += "WITH PERMISSION_SET = " + access + "\r\n";
            toSql += "GO\r\n";
            toSql += Files.ToSql();            
            toSql += this.ExtendedProperties.ToSql();
            return toSql;
        }

41. Example

Project: SQLoogle
Source File: Assembly.cs
private string ToSQLAlter()
        {
            string access = PermissionSet;
            if (PermissionSet.Equals("UNSAFE_ACCESS")) access = "UNSAFE";
            if (PermissionSet.Equals("SAFE_ACCESS")) access = "SAFE";
            return "ALTER ASSEMBLY " + FullName + " WITH PERMISSION_SET = " + access + "\r\nGO\r\n";
        }

42. Example

Project: SQLoogle
Source File: Assembly.cs
public bool Compare(Assembly obj)
        {
            if (obj == null) throw new ArgumentNullException("obj");            
            if (!this.CLRName.Equals(obj.CLRName)) return false;
            if (!this.PermissionSet.Equals(obj.PermissionSet)) return false;
            if (!this.Owner.Equals(obj.Owner)) return false;
            if (!this.Text.Equals(obj.Text)) return false;
            if (this.Files.Count != obj.Files.Count) return false;
            for (int j = 0; j < this.Files.Count; j++)
                if (!this.Files[j].Content.Equals(obj.Files[j].Content)) return false;
            return true;            
        }

43. Example

Project: SQLoogle
Source File: ColumnConstraint.cs
public static Boolean Compare(ColumnConstraint origen, ColumnConstraint destino)
        {
            if (destino == null) throw new ArgumentNullException("destino");
            if (origen == null) throw new ArgumentNullException("origen");
            if (origen.NotForReplication != destino.NotForReplication) return false;
            if (origen.Disabled != destino.Disabled) return false;
            if ((!origen.Definition.Equals(destino.Definition)) && (!origen.Definition.Equals("(" + destino.Definition + ")"))) return false;
            return true;
        }

44. Example

Project: SQLoogle
Source File: FileGroup.cs
private string ToSQL(string action)
        {
            string sql = "ALTER DATABASE [" + Parent.Name + "] " + action + " ";
            sql += "FILEGROUP [" + Name + "]";
            if (action.Equals("MODIFY"))
            {
                if (IsDefaultFileGroup) sql += " DEFAULT";
            }
            else
                if (IsFileStream) sql += " CONTAINS FILESTREAM";
            if (IsReadOnly) sql += " READONLY";
            sql += "\r\nGO\r\n";
            return sql;
        }

45. Example

Project: SQLoogle
Source File: FileGroupFile.cs
public static Boolean Compare(FileGroupFile origen, FileGroupFile destino)
        {
            if (destino == null) throw new ArgumentNullException("destino");
            if (origen == null) throw new ArgumentNullException("origen");
            if (origen.Growth != destino.Growth) return false;
            if (origen.IsPercentGrowth != destino.IsPercentGrowth) return false;
            if (origen.IsSparse != destino.IsSparse) return false;
            if (origen.MaxSize != destino.MaxSize) return false;
            if (!origen.PhysicalName.Equals(destino.PhysicalName)) return false;
            return true;
        }

46. Example

Project: SQLoogle
Source File: Index.cs
private static Boolean CompareFileGroup(Index origen, Index destino)
        {
            if (destino == null) throw new ArgumentNullException("destino");
            if (origen == null) throw new ArgumentNullException("origen");
            if (origen.FileGroup != null)
            {
                if (!origen.FileGroup.Equals(destino.FileGroup)) return false;
            }
            return true;
        }

47. Example

Project: SQLoogle
Source File: PartitionFunction.cs
private int ValueItem(string typeName)
        {
            if ((typeName.Equals("nchar") || typeName.Equals("nvarchar") || typeName.Equals("varchar") || typeName.Equals("char")))
                return IS_STRING;
            if (typeName.Equals("uniqueidentifier"))
                return IS_UNIQUE;
            if (typeName.Equals("datetime") || typeName.Equals("smalldatetime") || typeName.Equals("datetime2") || typeName.Equals("time") || typeName.Equals("datetimeoffset"))
                return IS_DATE;
            if (typeName.Equals("numeric") || typeName.Equals("decimal") || typeName.Equals("float") || typeName.Equals("real") || typeName.Equals("money") || typeName.Equals("smallmoney"))
                return IS_NUMERIC;

            return IS_NUMERIC;
        }

48. Example

Project: SQLoogle
Source File: PartitionFunction.cs
public static Boolean Compare(PartitionFunction origen, PartitionFunction destino)
        {
            if (destino == null) throw new ArgumentNullException("destino");
            if (origen == null) throw new ArgumentNullException("origen");
            if (!origen.Type.Equals(destino.Type)) return false;
            if (origen.Size != destino.Size) return false;
            if (origen.Precision != destino.Precision) return false;
            if (origen.Scale != destino.Scale) return false;
            if (origen.IsBoundaryRight != destino.IsBoundaryRight) return false;
            return true;
        }

49. Example

Project: SQLoogle
Source File: PartitionScheme.cs
public static Boolean Compare(PartitionScheme origen, PartitionScheme destino)
        {
            if (destino == null) throw new ArgumentNullException("destino");
            if (origen == null) throw new ArgumentNullException("origen");
            if (!origen.PartitionFunction.Equals(destino.PartitionFunction)) return false;
            if (origen.FileGroups.Count != destino.FileGroups.Count) return false;
            for (int j = 0; j < origen.FileGroups.Count; j++)
            {
                if (origen.CompareFullNameTo(origen.FileGroups[j], destino.FileGroups[j]) != 0)
                    return false;
            }
            return true;
        }

50. Example

Project: SQLoogle
Source File: Role.cs
public Boolean Compare(Role obj)
        {
            if (obj == null) throw new ArgumentNullException("destino");
            if (this.Type != obj.Type) return false;
            if (!this.Password.Equals(obj.Password)) return false;
            if (!this.Owner.Equals(obj.Owner)) return false;
            return true;
        }