System.Guid.GetHashCode()

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

539 Examples 7

19 Source : SampleMovies.cs
with GNU General Public License v3.0
from hitchao

public void Create()
        {
            int max = number;
            string savepath = System.IO.Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "database", $"sample_{max}.sqlite");
            MySqlite db = new MySqlite(savepath, true);
            db.CreateTable(DataBase.SQLITETABLE_MOVIE);
            db.CreateTable(DataBase.SQLITETABLE_ACTRESS);
            db.CreateTable(DataBase.SQLITETABLE_LIBRARY);
            db.CreateTable(DataBase.SQLITETABLE_JAVDB);
            db.CloseDB();

            List<string> ID = GetID(max);

            using (MySqlite mySqlite = new MySqlite(savepath, true))
            {
                for (int i = 0; i < max; i++)
                {
                    Movie movie = new Movie()
                    {
                        id = ID[i],
                        favorites = new Random(Guid.NewGuid().GetHashCode()).Next(0, 6),
                        visits = new Random(Guid.NewGuid().GetHashCode()).Next(0, 100),
                        replacedle = GetSomeText(30, i),
                        runtime= new Random(Guid.NewGuid().GetHashCode()).Next(0, 300),
                        rating = (float)(new Random(Guid.NewGuid().GetHashCode()).Next(0, 100))/10,
                        filesize =Math.Abs( 5 * 1024 * new Random(Guid.NewGuid().GetHashCode()).Next(0, 1024 * 1024)),
                        subsection = i % 100 == 0 ? "path1;path2" : "",
                        scandate = DateTime.Now.AddDays(-new Random(Guid.NewGuid().GetHashCode()).Next(-500,500)).ToString("yyyy-MM-dd HH:mm:ss"),
                        otherinfo = DateTime.Now.AddDays(-new Random(Guid.NewGuid().GetHashCode()).Next(-500, 500)). ToString("yyyy-MM-dd HH:mm:ss"),
                        releasedate= DateTime.Now.AddDays(-new Random(Guid.NewGuid().GetHashCode()).Next(-500, 500)).ToString("yyyy-MM-dd"),
                        vediotype = new Random(Guid.NewGuid().GetHashCode()).Next(1, 4),
                        tag = "系列" + new Random(Guid.NewGuid().GetHashCode()).Next(defaultmax),
                        director = "导演" + new Random(Guid.NewGuid().GetHashCode()).Next(defaultmax),
                        studio = "发行商" + new Random(Guid.NewGuid().GetHashCode()).Next(defaultmax)
                    };
                    movie.genre = GetGenre(movie);
                    movie.actor = GetActor(max);
                    movie.label = GetLabel(max);
                    mySqlite.InsertFullMovie(movie, "movie");
                    Console.WriteLine(i);
                }
            }
        }

19 Source : SampleMovies.cs
with GNU General Public License v3.0
from hitchao

private List<string> GetID(int maxcount)
        {
            List<string> result = new List<string>();
            List<string> eng = GetEng();
            List<string> num = GetNumber();
            List<int> engidx = new List<int>();
            while (engidx.Count < maxcount)
            {
                int idx=new Random(Guid.NewGuid().GetHashCode()).Next(0, eng.Count);
                if (!engidx.Contains(idx)) engidx.Add(idx);
            }

            for (int i = 0; i < maxcount; i++)
            {
                result.Add(eng[engidx[i]] + "-"+ num[ new Random(Guid.NewGuid().GetHashCode()).Next(0, 1000)]);
            }
            return result;
        }

19 Source : Identity.cs
with MIT License
from hossambarakat

public override int GetHashCode()
        {
            return (this.GetType().GetHashCode() * 907) + this.Value.GetHashCode();
        }

19 Source : RelationContext.cs
with MIT License
from impworks

public override int GetHashCode()
            {
                return Id.GetHashCode();
            }

19 Source : FormClient.cs
with Apache License 2.0
from int2e

private void BtnTest_Click(object sender, EventArgs e)
        {
            var txt = txtContent.Text.Trim();
            Send(PacketType.Echo, txt);
            Send(PacketType.Echo, txt + new Random(Guid.NewGuid().GetHashCode()).NextDouble());
            Send(PacketType.Echo, txt + new Random(Guid.NewGuid().GetHashCode()).Next(1000, 1000000));
            Send(PacketType.Echo, txt + Guid.NewGuid());
        }

19 Source : Extensions.cs
with Apache License 2.0
from int2e

internal static string GetRandomWebSocketKey(this string str)
        {
            var bytes = new byte[16];
            new Random(Guid.NewGuid().GetHashCode()).NextBytes(bytes);
            return Convert.ToBase64String(bytes);
        }

19 Source : FormAgent.cs
with Apache License 2.0
from int2e

private void BtnTest_Click(object sender, EventArgs e)
        {
            var txt = txtContent.Text.Trim();
            var connIds = _agent.GetAllConnectionIds();
            foreach (var connId in connIds)
            {
                Send(_agent, connId, PacketType.Echo, txt);
                Send(_agent, connId, PacketType.Echo, txt + new Random(Guid.NewGuid().GetHashCode()).NextDouble());
                Send(_agent, connId, PacketType.Echo, txt + new Random(Guid.NewGuid().GetHashCode()).Next(1000, 1000000));
                Send(_agent, connId, PacketType.Echo, txt + Guid.NewGuid());
            }
        }

19 Source : FormAgent.cs
with Apache License 2.0
from int2e

private void BtnTest_Click(object sender, EventArgs e)
        {
            var txt = txtContent.Text.Trim();
            var connIds = _agent.GetAllConnectionIds();
            foreach (var connId in connIds)
            {
                Send(connId, PacketType.Echo, txt);
                Send(connId, PacketType.Echo, txt + new Random(Guid.NewGuid().GetHashCode()).NextDouble());
                Send(connId, PacketType.Echo, txt + new Random(Guid.NewGuid().GetHashCode()).Next(1000, 1000000));
                Send(connId, PacketType.Echo, txt + Guid.NewGuid());
            }
        }

19 Source : Agent.cs
with Apache License 2.0
from int2e

private IProxy GetRandomProxyServer()
        {
            return ProxyList?[new Random(Guid.NewGuid().GetHashCode()).Next(0, ProxyList.Count)];
        }

19 Source : RfcommServiceId.cs
with MIT License
from inthehand

public override int GetHashCode()
        {
            return Uuid.GetHashCode();
        }

19 Source : CoinDetails.xaml.cs
with GNU General Public License v3.0
from ismaelestalayo

private void NewAlert(object sender, RoutedEventArgs e) {
            vm.Alerts.Add(new Alert() {
                Crypto = vm.Coin.Name,
                Currency = App.currency,
                CurrencySymbol = App.currencySymbol,
                Enabled = true,
                Id = Guid.NewGuid().GetHashCode(),
                Mode = "above"
            });
        }

19 Source : Account.cs
with Apache License 2.0
from jaboc83

public override int GetHashCode()
        {
            unchecked // Overflow is fine, just wrap
            {
                int hashCode = 41;
                if (this.Id != null)
                    hashCode = hashCode * 59 + this.Id.GetHashCode();
                if (this.Name != null)
                    hashCode = hashCode * 59 + this.Name.GetHashCode();
                hashCode = hashCode * 59 + this.Type.GetHashCode();
                hashCode = hashCode * 59 + this.OnBudget.GetHashCode();
                hashCode = hashCode * 59 + this.Closed.GetHashCode();
                if (this.Note != null)
                    hashCode = hashCode * 59 + this.Note.GetHashCode();
                hashCode = hashCode * 59 + this.Balance.GetHashCode();
                hashCode = hashCode * 59 + this.ClearedBalance.GetHashCode();
                hashCode = hashCode * 59 + this.UnclearedBalance.GetHashCode();
                if (this.TransferPayeeId != null)
                    hashCode = hashCode * 59 + this.TransferPayeeId.GetHashCode();
                hashCode = hashCode * 59 + this.DirectImportLinked.GetHashCode();
                hashCode = hashCode * 59 + this.DirectImportInError.GetHashCode();
                hashCode = hashCode * 59 + this.Deleted.GetHashCode();
                return hashCode;
            }
        }

19 Source : BudgetSummary.cs
with Apache License 2.0
from jaboc83

public override int GetHashCode()
        {
            unchecked // Overflow is fine, just wrap
            {
                int hashCode = 41;
                if (this.Id != null)
                    hashCode = hashCode * 59 + this.Id.GetHashCode();
                if (this.Name != null)
                    hashCode = hashCode * 59 + this.Name.GetHashCode();
                if (this.LastModifiedOn != null)
                    hashCode = hashCode * 59 + this.LastModifiedOn.GetHashCode();
                if (this.FirstMonth != null)
                    hashCode = hashCode * 59 + this.FirstMonth.GetHashCode();
                if (this.LastMonth != null)
                    hashCode = hashCode * 59 + this.LastMonth.GetHashCode();
                if (this.DateFormat != null)
                    hashCode = hashCode * 59 + this.DateFormat.GetHashCode();
                if (this.CurrencyFormat != null)
                    hashCode = hashCode * 59 + this.CurrencyFormat.GetHashCode();
                if (this.Accounts != null)
                    hashCode = hashCode * 59 + this.Accounts.GetHashCode();
                return hashCode;
            }
        }

19 Source : Category.cs
with Apache License 2.0
from jaboc83

public override int GetHashCode()
        {
            unchecked // Overflow is fine, just wrap
            {
                int hashCode = 41;
                if (this.Id != null)
                    hashCode = hashCode * 59 + this.Id.GetHashCode();
                if (this.CategoryGroupId != null)
                    hashCode = hashCode * 59 + this.CategoryGroupId.GetHashCode();
                if (this.Name != null)
                    hashCode = hashCode * 59 + this.Name.GetHashCode();
                hashCode = hashCode * 59 + this.Hidden.GetHashCode();
                if (this.OriginalCategoryGroupId != null)
                    hashCode = hashCode * 59 + this.OriginalCategoryGroupId.GetHashCode();
                if (this.Note != null)
                    hashCode = hashCode * 59 + this.Note.GetHashCode();
                hashCode = hashCode * 59 + this.Budgeted.GetHashCode();
                hashCode = hashCode * 59 + this.Activity.GetHashCode();
                hashCode = hashCode * 59 + this.Balance.GetHashCode();
                hashCode = hashCode * 59 + this.GoalType.GetHashCode();
                if (this.GoalCreationMonth != null)
                    hashCode = hashCode * 59 + this.GoalCreationMonth.GetHashCode();
                hashCode = hashCode * 59 + this.GoalTarget.GetHashCode();
                if (this.GoalTargetMonth != null)
                    hashCode = hashCode * 59 + this.GoalTargetMonth.GetHashCode();
                hashCode = hashCode * 59 + this.GoalPercentageComplete.GetHashCode();
                hashCode = hashCode * 59 + this.GoalMonthsToBudget.GetHashCode();
                hashCode = hashCode * 59 + this.GoalUnderFunded.GetHashCode();
                hashCode = hashCode * 59 + this.GoalOverallFunded.GetHashCode();
                hashCode = hashCode * 59 + this.GoalOverallLeft.GetHashCode();
                hashCode = hashCode * 59 + this.Deleted.GetHashCode();
                return hashCode;
            }
        }

19 Source : CategoryGroup.cs
with Apache License 2.0
from jaboc83

public override int GetHashCode()
        {
            unchecked // Overflow is fine, just wrap
            {
                int hashCode = 41;
                if (this.Id != null)
                    hashCode = hashCode * 59 + this.Id.GetHashCode();
                if (this.Name != null)
                    hashCode = hashCode * 59 + this.Name.GetHashCode();
                hashCode = hashCode * 59 + this.Hidden.GetHashCode();
                hashCode = hashCode * 59 + this.Deleted.GetHashCode();
                return hashCode;
            }
        }

19 Source : HybridTransaction.cs
with Apache License 2.0
from jaboc83

public override int GetHashCode()
        {
            unchecked // Overflow is fine, just wrap
            {
                int hashCode = 41;
                if (this.Id != null)
                    hashCode = hashCode * 59 + this.Id.GetHashCode();
                if (this.Date != null)
                    hashCode = hashCode * 59 + this.Date.GetHashCode();
                hashCode = hashCode * 59 + this.Amount.GetHashCode();
                if (this.Memo != null)
                    hashCode = hashCode * 59 + this.Memo.GetHashCode();
                hashCode = hashCode * 59 + this.Cleared.GetHashCode();
                hashCode = hashCode * 59 + this.Approved.GetHashCode();
                hashCode = hashCode * 59 + this.FlagColor.GetHashCode();
                if (this.AccountId != null)
                    hashCode = hashCode * 59 + this.AccountId.GetHashCode();
                if (this.PayeeId != null)
                    hashCode = hashCode * 59 + this.PayeeId.GetHashCode();
                if (this.CategoryId != null)
                    hashCode = hashCode * 59 + this.CategoryId.GetHashCode();
                if (this.TransferAccountId != null)
                    hashCode = hashCode * 59 + this.TransferAccountId.GetHashCode();
                if (this.TransferTransactionId != null)
                    hashCode = hashCode * 59 + this.TransferTransactionId.GetHashCode();
                if (this.MatchedTransactionId != null)
                    hashCode = hashCode * 59 + this.MatchedTransactionId.GetHashCode();
                if (this.ImportId != null)
                    hashCode = hashCode * 59 + this.ImportId.GetHashCode();
                hashCode = hashCode * 59 + this.Deleted.GetHashCode();
                hashCode = hashCode * 59 + this.Type.GetHashCode();
                if (this.ParentTransactionId != null)
                    hashCode = hashCode * 59 + this.ParentTransactionId.GetHashCode();
                if (this.AccountName != null)
                    hashCode = hashCode * 59 + this.AccountName.GetHashCode();
                if (this.PayeeName != null)
                    hashCode = hashCode * 59 + this.PayeeName.GetHashCode();
                if (this.CategoryName != null)
                    hashCode = hashCode * 59 + this.CategoryName.GetHashCode();
                return hashCode;
            }
        }

19 Source : Payee.cs
with Apache License 2.0
from jaboc83

public override int GetHashCode()
        {
            unchecked // Overflow is fine, just wrap
            {
                int hashCode = 41;
                if (this.Id != null)
                    hashCode = hashCode * 59 + this.Id.GetHashCode();
                if (this.Name != null)
                    hashCode = hashCode * 59 + this.Name.GetHashCode();
                if (this.TransferAccountId != null)
                    hashCode = hashCode * 59 + this.TransferAccountId.GetHashCode();
                hashCode = hashCode * 59 + this.Deleted.GetHashCode();
                return hashCode;
            }
        }

19 Source : PayeeLocation.cs
with Apache License 2.0
from jaboc83

public override int GetHashCode()
        {
            unchecked // Overflow is fine, just wrap
            {
                int hashCode = 41;
                if (this.Id != null)
                    hashCode = hashCode * 59 + this.Id.GetHashCode();
                if (this.PayeeId != null)
                    hashCode = hashCode * 59 + this.PayeeId.GetHashCode();
                if (this.Lareplacedude != null)
                    hashCode = hashCode * 59 + this.Lareplacedude.GetHashCode();
                if (this.Longitude != null)
                    hashCode = hashCode * 59 + this.Longitude.GetHashCode();
                hashCode = hashCode * 59 + this.Deleted.GetHashCode();
                return hashCode;
            }
        }

19 Source : SaveTransaction.cs
with Apache License 2.0
from jaboc83

public override int GetHashCode()
        {
            unchecked // Overflow is fine, just wrap
            {
                int hashCode = 41;
                if (this.AccountId != null)
                    hashCode = hashCode * 59 + this.AccountId.GetHashCode();
                if (this.Date != null)
                    hashCode = hashCode * 59 + this.Date.GetHashCode();
                hashCode = hashCode * 59 + this.Amount.GetHashCode();
                if (this.PayeeId != null)
                    hashCode = hashCode * 59 + this.PayeeId.GetHashCode();
                if (this.PayeeName != null)
                    hashCode = hashCode * 59 + this.PayeeName.GetHashCode();
                if (this.CategoryId != null)
                    hashCode = hashCode * 59 + this.CategoryId.GetHashCode();
                if (this.Memo != null)
                    hashCode = hashCode * 59 + this.Memo.GetHashCode();
                hashCode = hashCode * 59 + this.Cleared.GetHashCode();
                hashCode = hashCode * 59 + this.Approved.GetHashCode();
                hashCode = hashCode * 59 + this.FlagColor.GetHashCode();
                if (this.ImportId != null)
                    hashCode = hashCode * 59 + this.ImportId.GetHashCode();
                if (this.Subtransactions != null)
                    hashCode = hashCode * 59 + this.Subtransactions.GetHashCode();
                return hashCode;
            }
        }

19 Source : CategoryGroupWithCategories.cs
with Apache License 2.0
from jaboc83

public override int GetHashCode()
        {
            unchecked // Overflow is fine, just wrap
            {
                int hashCode = 41;
                if (this.Id != null)
                    hashCode = hashCode * 59 + this.Id.GetHashCode();
                if (this.Name != null)
                    hashCode = hashCode * 59 + this.Name.GetHashCode();
                hashCode = hashCode * 59 + this.Hidden.GetHashCode();
                hashCode = hashCode * 59 + this.Deleted.GetHashCode();
                if (this.Categories != null)
                    hashCode = hashCode * 59 + this.Categories.GetHashCode();
                return hashCode;
            }
        }

19 Source : ScheduledSubTransaction.cs
with Apache License 2.0
from jaboc83

public override int GetHashCode()
        {
            unchecked // Overflow is fine, just wrap
            {
                int hashCode = 41;
                if (this.Id != null)
                    hashCode = hashCode * 59 + this.Id.GetHashCode();
                if (this.ScheduledTransactionId != null)
                    hashCode = hashCode * 59 + this.ScheduledTransactionId.GetHashCode();
                hashCode = hashCode * 59 + this.Amount.GetHashCode();
                if (this.Memo != null)
                    hashCode = hashCode * 59 + this.Memo.GetHashCode();
                if (this.PayeeId != null)
                    hashCode = hashCode * 59 + this.PayeeId.GetHashCode();
                if (this.CategoryId != null)
                    hashCode = hashCode * 59 + this.CategoryId.GetHashCode();
                if (this.TransferAccountId != null)
                    hashCode = hashCode * 59 + this.TransferAccountId.GetHashCode();
                hashCode = hashCode * 59 + this.Deleted.GetHashCode();
                return hashCode;
            }
        }

19 Source : ScheduledTransactionDetail.cs
with Apache License 2.0
from jaboc83

public override int GetHashCode()
        {
            unchecked // Overflow is fine, just wrap
            {
                int hashCode = 41;
                if (this.Id != null)
                    hashCode = hashCode * 59 + this.Id.GetHashCode();
                if (this.DateFirst != null)
                    hashCode = hashCode * 59 + this.DateFirst.GetHashCode();
                if (this.DateNext != null)
                    hashCode = hashCode * 59 + this.DateNext.GetHashCode();
                hashCode = hashCode * 59 + this.Frequency.GetHashCode();
                hashCode = hashCode * 59 + this.Amount.GetHashCode();
                if (this.Memo != null)
                    hashCode = hashCode * 59 + this.Memo.GetHashCode();
                hashCode = hashCode * 59 + this.FlagColor.GetHashCode();
                if (this.AccountId != null)
                    hashCode = hashCode * 59 + this.AccountId.GetHashCode();
                if (this.PayeeId != null)
                    hashCode = hashCode * 59 + this.PayeeId.GetHashCode();
                if (this.CategoryId != null)
                    hashCode = hashCode * 59 + this.CategoryId.GetHashCode();
                if (this.TransferAccountId != null)
                    hashCode = hashCode * 59 + this.TransferAccountId.GetHashCode();
                hashCode = hashCode * 59 + this.Deleted.GetHashCode();
                if (this.AccountName != null)
                    hashCode = hashCode * 59 + this.AccountName.GetHashCode();
                if (this.PayeeName != null)
                    hashCode = hashCode * 59 + this.PayeeName.GetHashCode();
                if (this.CategoryName != null)
                    hashCode = hashCode * 59 + this.CategoryName.GetHashCode();
                if (this.Subtransactions != null)
                    hashCode = hashCode * 59 + this.Subtransactions.GetHashCode();
                return hashCode;
            }
        }

19 Source : BudgetDetail.cs
with Apache License 2.0
from jaboc83

public override int GetHashCode()
        {
            unchecked // Overflow is fine, just wrap
            {
                int hashCode = 41;
                if (this.Id != null)
                    hashCode = hashCode * 59 + this.Id.GetHashCode();
                if (this.Name != null)
                    hashCode = hashCode * 59 + this.Name.GetHashCode();
                if (this.LastModifiedOn != null)
                    hashCode = hashCode * 59 + this.LastModifiedOn.GetHashCode();
                if (this.FirstMonth != null)
                    hashCode = hashCode * 59 + this.FirstMonth.GetHashCode();
                if (this.LastMonth != null)
                    hashCode = hashCode * 59 + this.LastMonth.GetHashCode();
                if (this.DateFormat != null)
                    hashCode = hashCode * 59 + this.DateFormat.GetHashCode();
                if (this.CurrencyFormat != null)
                    hashCode = hashCode * 59 + this.CurrencyFormat.GetHashCode();
                if (this.Accounts != null)
                    hashCode = hashCode * 59 + this.Accounts.GetHashCode();
                if (this.Payees != null)
                    hashCode = hashCode * 59 + this.Payees.GetHashCode();
                if (this.PayeeLocations != null)
                    hashCode = hashCode * 59 + this.PayeeLocations.GetHashCode();
                if (this.CategoryGroups != null)
                    hashCode = hashCode * 59 + this.CategoryGroups.GetHashCode();
                if (this.Categories != null)
                    hashCode = hashCode * 59 + this.Categories.GetHashCode();
                if (this.Months != null)
                    hashCode = hashCode * 59 + this.Months.GetHashCode();
                if (this.Transactions != null)
                    hashCode = hashCode * 59 + this.Transactions.GetHashCode();
                if (this.Subtransactions != null)
                    hashCode = hashCode * 59 + this.Subtransactions.GetHashCode();
                if (this.ScheduledTransactions != null)
                    hashCode = hashCode * 59 + this.ScheduledTransactions.GetHashCode();
                if (this.ScheduledSubtransactions != null)
                    hashCode = hashCode * 59 + this.ScheduledSubtransactions.GetHashCode();
                return hashCode;
            }
        }

19 Source : TransactionDetail.cs
with Apache License 2.0
from jaboc83

public override int GetHashCode()
        {
            unchecked // Overflow is fine, just wrap
            {
                int hashCode = 41;
                if (this.Id != null)
                    hashCode = hashCode * 59 + this.Id.GetHashCode();
                if (this.Date != null)
                    hashCode = hashCode * 59 + this.Date.GetHashCode();
                hashCode = hashCode * 59 + this.Amount.GetHashCode();
                if (this.Memo != null)
                    hashCode = hashCode * 59 + this.Memo.GetHashCode();
                hashCode = hashCode * 59 + this.Cleared.GetHashCode();
                hashCode = hashCode * 59 + this.Approved.GetHashCode();
                hashCode = hashCode * 59 + this.FlagColor.GetHashCode();
                if (this.AccountId != null)
                    hashCode = hashCode * 59 + this.AccountId.GetHashCode();
                if (this.PayeeId != null)
                    hashCode = hashCode * 59 + this.PayeeId.GetHashCode();
                if (this.CategoryId != null)
                    hashCode = hashCode * 59 + this.CategoryId.GetHashCode();
                if (this.TransferAccountId != null)
                    hashCode = hashCode * 59 + this.TransferAccountId.GetHashCode();
                if (this.TransferTransactionId != null)
                    hashCode = hashCode * 59 + this.TransferTransactionId.GetHashCode();
                if (this.MatchedTransactionId != null)
                    hashCode = hashCode * 59 + this.MatchedTransactionId.GetHashCode();
                if (this.ImportId != null)
                    hashCode = hashCode * 59 + this.ImportId.GetHashCode();
                hashCode = hashCode * 59 + this.Deleted.GetHashCode();
                if (this.AccountName != null)
                    hashCode = hashCode * 59 + this.AccountName.GetHashCode();
                if (this.PayeeName != null)
                    hashCode = hashCode * 59 + this.PayeeName.GetHashCode();
                if (this.CategoryName != null)
                    hashCode = hashCode * 59 + this.CategoryName.GetHashCode();
                if (this.Subtransactions != null)
                    hashCode = hashCode * 59 + this.Subtransactions.GetHashCode();
                return hashCode;
            }
        }

19 Source : SaveSubTransaction.cs
with Apache License 2.0
from jaboc83

public override int GetHashCode()
        {
            unchecked // Overflow is fine, just wrap
            {
                int hashCode = 41;
                hashCode = hashCode * 59 + this.Amount.GetHashCode();
                if (this.PayeeId != null)
                    hashCode = hashCode * 59 + this.PayeeId.GetHashCode();
                if (this.PayeeName != null)
                    hashCode = hashCode * 59 + this.PayeeName.GetHashCode();
                if (this.CategoryId != null)
                    hashCode = hashCode * 59 + this.CategoryId.GetHashCode();
                if (this.Memo != null)
                    hashCode = hashCode * 59 + this.Memo.GetHashCode();
                return hashCode;
            }
        }

19 Source : ScheduledTransactionSummary.cs
with Apache License 2.0
from jaboc83

public override int GetHashCode()
        {
            unchecked // Overflow is fine, just wrap
            {
                int hashCode = 41;
                if (this.Id != null)
                    hashCode = hashCode * 59 + this.Id.GetHashCode();
                if (this.DateFirst != null)
                    hashCode = hashCode * 59 + this.DateFirst.GetHashCode();
                if (this.DateNext != null)
                    hashCode = hashCode * 59 + this.DateNext.GetHashCode();
                hashCode = hashCode * 59 + this.Frequency.GetHashCode();
                hashCode = hashCode * 59 + this.Amount.GetHashCode();
                if (this.Memo != null)
                    hashCode = hashCode * 59 + this.Memo.GetHashCode();
                hashCode = hashCode * 59 + this.FlagColor.GetHashCode();
                if (this.AccountId != null)
                    hashCode = hashCode * 59 + this.AccountId.GetHashCode();
                if (this.PayeeId != null)
                    hashCode = hashCode * 59 + this.PayeeId.GetHashCode();
                if (this.CategoryId != null)
                    hashCode = hashCode * 59 + this.CategoryId.GetHashCode();
                if (this.TransferAccountId != null)
                    hashCode = hashCode * 59 + this.TransferAccountId.GetHashCode();
                hashCode = hashCode * 59 + this.Deleted.GetHashCode();
                return hashCode;
            }
        }

19 Source : SubTransaction.cs
with Apache License 2.0
from jaboc83

public override int GetHashCode()
        {
            unchecked // Overflow is fine, just wrap
            {
                int hashCode = 41;
                if (this.Id != null)
                    hashCode = hashCode * 59 + this.Id.GetHashCode();
                if (this.TransactionId != null)
                    hashCode = hashCode * 59 + this.TransactionId.GetHashCode();
                hashCode = hashCode * 59 + this.Amount.GetHashCode();
                if (this.Memo != null)
                    hashCode = hashCode * 59 + this.Memo.GetHashCode();
                if (this.PayeeId != null)
                    hashCode = hashCode * 59 + this.PayeeId.GetHashCode();
                if (this.PayeeName != null)
                    hashCode = hashCode * 59 + this.PayeeName.GetHashCode();
                if (this.CategoryId != null)
                    hashCode = hashCode * 59 + this.CategoryId.GetHashCode();
                if (this.CategoryName != null)
                    hashCode = hashCode * 59 + this.CategoryName.GetHashCode();
                if (this.TransferAccountId != null)
                    hashCode = hashCode * 59 + this.TransferAccountId.GetHashCode();
                if (this.TransferTransactionId != null)
                    hashCode = hashCode * 59 + this.TransferTransactionId.GetHashCode();
                hashCode = hashCode * 59 + this.Deleted.GetHashCode();
                return hashCode;
            }
        }

19 Source : TransactionSummary.cs
with Apache License 2.0
from jaboc83

public override int GetHashCode()
        {
            unchecked // Overflow is fine, just wrap
            {
                int hashCode = 41;
                if (this.Id != null)
                    hashCode = hashCode * 59 + this.Id.GetHashCode();
                if (this.Date != null)
                    hashCode = hashCode * 59 + this.Date.GetHashCode();
                hashCode = hashCode * 59 + this.Amount.GetHashCode();
                if (this.Memo != null)
                    hashCode = hashCode * 59 + this.Memo.GetHashCode();
                hashCode = hashCode * 59 + this.Cleared.GetHashCode();
                hashCode = hashCode * 59 + this.Approved.GetHashCode();
                hashCode = hashCode * 59 + this.FlagColor.GetHashCode();
                if (this.AccountId != null)
                    hashCode = hashCode * 59 + this.AccountId.GetHashCode();
                if (this.PayeeId != null)
                    hashCode = hashCode * 59 + this.PayeeId.GetHashCode();
                if (this.CategoryId != null)
                    hashCode = hashCode * 59 + this.CategoryId.GetHashCode();
                if (this.TransferAccountId != null)
                    hashCode = hashCode * 59 + this.TransferAccountId.GetHashCode();
                if (this.TransferTransactionId != null)
                    hashCode = hashCode * 59 + this.TransferTransactionId.GetHashCode();
                if (this.MatchedTransactionId != null)
                    hashCode = hashCode * 59 + this.MatchedTransactionId.GetHashCode();
                if (this.ImportId != null)
                    hashCode = hashCode * 59 + this.ImportId.GetHashCode();
                hashCode = hashCode * 59 + this.Deleted.GetHashCode();
                return hashCode;
            }
        }

19 Source : UpdateTransaction.cs
with Apache License 2.0
from jaboc83

public override int GetHashCode()
        {
            unchecked // Overflow is fine, just wrap
            {
                int hashCode = 41;
                if (this.Id != null)
                    hashCode = hashCode * 59 + this.Id.GetHashCode();
                if (this.AccountId != null)
                    hashCode = hashCode * 59 + this.AccountId.GetHashCode();
                if (this.Date != null)
                    hashCode = hashCode * 59 + this.Date.GetHashCode();
                hashCode = hashCode * 59 + this.Amount.GetHashCode();
                if (this.PayeeId != null)
                    hashCode = hashCode * 59 + this.PayeeId.GetHashCode();
                if (this.PayeeName != null)
                    hashCode = hashCode * 59 + this.PayeeName.GetHashCode();
                if (this.CategoryId != null)
                    hashCode = hashCode * 59 + this.CategoryId.GetHashCode();
                if (this.Memo != null)
                    hashCode = hashCode * 59 + this.Memo.GetHashCode();
                hashCode = hashCode * 59 + this.Cleared.GetHashCode();
                hashCode = hashCode * 59 + this.Approved.GetHashCode();
                hashCode = hashCode * 59 + this.FlagColor.GetHashCode();
                if (this.ImportId != null)
                    hashCode = hashCode * 59 + this.ImportId.GetHashCode();
                if (this.Subtransactions != null)
                    hashCode = hashCode * 59 + this.Subtransactions.GetHashCode();
                return hashCode;
            }
        }

19 Source : User.cs
with Apache License 2.0
from jaboc83

public override int GetHashCode()
        {
            unchecked // Overflow is fine, just wrap
            {
                int hashCode = 41;
                if (this.Id != null)
                    hashCode = hashCode * 59 + this.Id.GetHashCode();
                return hashCode;
            }
        }

19 Source : Program.cs
with MIT License
from JadynWong

static string GetRandomIp(IIpSearch ipSearch)
        {
            while (true)
            {
                var sj = new Random(Guid.NewGuid().GetHashCode());
                var s = "";
                for (var i = 0; i <= 3; i++)
                {
                    var q = sj.Next(0, 255).ToString();
                    if (i < 3)
                    {
                        s += (q + ".").ToString();
                    }
                    else
                    {
                        s += q.ToString();
                    }
                }
                if (ipSearch.CheckIp(s))
                {
                    return s;
                }
            }
        }

19 Source : Test.cs
with MIT License
from JadynWong

public static string GetRandomIp(IIpSearch ipSearch)
        {
            while (true)
            {
                var sj = new Random(Guid.NewGuid().GetHashCode());
                var s = "";
                for (var i = 0; i <= 3; i++)
                {
                    var q = sj.Next(0, 255).ToString();
                    if (i < 3)
                    {
                        s += (q + ".").ToString();
                    }
                    else
                    {
                        s += q.ToString();
                    }
                }
                if (ipSearch.CheckIp(s))
                {
                    return s;
                }
            }
        }

19 Source : QQWryIpSearchTest.cs
with MIT License
from JadynWong

protected string GetRandomIp(IIpSearch ipSearch)
        {
            while (true)
            {
                var sj = new Random(Guid.NewGuid().GetHashCode());
                var s = "";
                for (var i = 0; i <= 3; i++)
                {
                    var q = sj.Next(0, 255).ToString();
                    if (i < 3)
                    {
                        s += (q + ".").ToString();
                    }
                    else
                    {
                        s += q.ToString();
                    }
                }
                if (ipSearch.CheckIp(s))
                {
                    return s;
                }
            }
        }

19 Source : Entity.cs
with MIT License
from Jamaxack

public override int GetHashCode()
        {
            if (IsTransient()) return base.GetHashCode();

            if (_requestedHashCode.HasValue)
                return _requestedHashCode.Value;

            _requestedHashCode = Id.GetHashCode() ^ 31; // XOR for random distribution
            return _requestedHashCode.Value;
        }

19 Source : Utils.cs
with GNU General Public License v3.0
from janfokke

public static Color RandomColor()
        {
            var rnd = new Random(Guid.NewGuid().GetHashCode());
            return new Color(rnd.Next(0, 256), rnd.Next(0, 256), rnd.Next(0, 256));
        }

19 Source : MiniGuid.cs
with MIT License
from jasonholloway

public override int GetHashCode()
            => _guid.GetHashCode() + 1;

19 Source : InventoryItem.cs
with MIT License
from JeremyLikness

public override int GetHashCode()
        {
            // credit: http://stackoverflow.com/a/263416/677735
            unchecked // Overflow is fine, just wrap
            {
                int hash = 41;
                // Suitable nullity checks etc, of course :)
                if (this.Id != null)
                    hash = hash * 59 + this.Id.GetHashCode();
                if (this.Name != null)
                    hash = hash * 59 + this.Name.GetHashCode();
                if (this.ReleaseDate != null)
                    hash = hash * 59 + this.ReleaseDate.GetHashCode();
                if (this.Manufacturer != null)
                    hash = hash * 59 + this.Manufacturer.GetHashCode();
                return hash;
            }
        }

19 Source : MockConnection.cs
with MIT License
from jirenius

public string NewInbox()
        {
            if (r == null)
            {
                r = new Random(Guid.NewGuid().GetHashCode());
            }
            byte[] buf = new byte[13];
            r.NextBytes(buf);
            return "_INBOX." + BitConverter.ToString(buf).Replace("-", "");
        }

19 Source : EditorController.cs
with Apache License 2.0
from jiyuwu

public async Task<IActionResult> KindSaveFiles(string dir, string replacedle, long ContextId = 0, long ArticleTypeId = 0)
        {
            if (Request.Form.Files.Count() == 0)
            {
                return showError("请选择上传的文件");
            }

            var file = Request.Form.Files[0];//kindeditor的上传文件控件,一次只传一个文件

            //定义允许上传的文件扩展名
            Hashtable extTable = new Hashtable();
            extTable.Add("image", "gif,jpg,jpeg,png,bmp");
            extTable.Add("flash", "swf,flv");
            extTable.Add("media", "swf,flv,mp3,wav,wma,wmv,mid,avi,mpg,asf,rm,rmvb,mp4");
            extTable.Add("file", "doc,docx,xls,xlsx,ppt,htm,html,txt,zip,rar,gz,bz2");

            if (String.IsNullOrEmpty(dir))
            {
                dir = "image";
            }
            string fName = "";
            string fileName = "";
            string md5 = CommonHelper.CalcMD5(file.OpenReadStream());
            String fileExt = Path.GetExtension(file.FileName).ToLower();

            if (String.IsNullOrEmpty(fileExt) || Array.IndexOf(((String)extTable[dir]).Split(','), fileExt.Substring(1).ToLower()) == -1)
            {
                return showError("上传文件扩展名是不允许的扩展名。\n只允许" + ((String)extTable[dir]) + "格式。");
            }

            //创建文件夹
            string dirPath = ConfigHelper.GetSectionValue("FileMap:FilePath") + "/"+ KindStr + "/" + dir + "/";
            string webPath = "/" + KindStr + "/" + dir + "/";
            if (!Directory.Exists(dirPath))
            {
                Directory.CreateDirectory(dirPath);
            }

            String ymd = DateTime.Now.ToString("yyyyMMdd", DateTimeFormatInfo.InvariantInfo);
            dirPath += ymd + "/";
            webPath += ymd + "/";
            if (!Directory.Exists(dirPath))
            {
                Directory.CreateDirectory(dirPath);
            }

            string suijishu = Math.Abs(Guid.NewGuid().GetHashCode()).ToString();
            String newFileName = DateTime.Now.ToString("yyyyMMddHHmmss_" + suijishu, DateTimeFormatInfo.InvariantInfo) + fileExt;

            fileName = dirPath + $@"{newFileName}";
            using (FileStream fs = System.IO.File.Create(fileName))
            {
                await file.CopyToAsync(fs);
                fs.Flush();
            }
            fName = ConfigHelper.GetSectionValue("FileMap:FileWeb") + webPath + newFileName;

            Hashtable hash = new Hashtable();
            hash["error"] = 0;
            hash["url"] = fName;
            return Json(hash);
        }

19 Source : Ver2.cs
with MIT License
from JosefNemec

public override int GetHashCode()
        {
            if (Id == Guid.Empty)
            {
                return 0;
            }
            else
            {
                return Id.GetHashCode();
            }
        }

19 Source : NP.cs
with MIT License
from KIWI-ST

public static int Random(int maxValue)
        {
            return new Random(Guid.NewGuid().GetHashCode()).Next(0, maxValue);
        }

19 Source : NP.cs
with MIT License
from KIWI-ST

public static double Random()
        {
            return new Random(Guid.NewGuid().GetHashCode()).NextDouble();
        }

19 Source : TypedIdValueBase.cs
with MIT License
from ktutak1337

public override int GetHashCode()
            => Value.GetHashCode();

19 Source : OtherUtils.cs
with MIT License
from leestar54

public static string GetRandomNumber(int length)
        {
            char[] Pattern = new char[] { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9' };
            //, 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z' };
            string randcode = "";
            int n = Pattern.Length;
            Random random = new Random(Guid.NewGuid().GetHashCode());
            for (int i = 0; i < length; i++)
            {
                int rnd;
                if (i != 0)
                    rnd = random.Next(0, n);
                else
                    rnd = random.Next(1, n);
                randcode += Pattern[rnd];
            }
            return randcode;
        }

19 Source : AnnotationBatchRequest.cs
with GNU Affero General Public License v3.0
from LexPredict

public override int GetHashCode()
        {
            unchecked // Overflow is fine, just wrap
            {
                int hashCode = 41;
                if (this.OperationUid != null)
                    hashCode = hashCode * 59 + this.OperationUid.GetHashCode();
                if (this.Action != null)
                    hashCode = hashCode * 59 + this.Action.GetHashCode();
                if (this.Id != null)
                    hashCode = hashCode * 59 + this.Id.GetHashCode();
                if (this.Data != null)
                    hashCode = hashCode * 59 + this.Data.GetHashCode();
                return hashCode;
            }
        }

19 Source : AnnotationBatchResponse.cs
with GNU Affero General Public License v3.0
from LexPredict

public override int GetHashCode()
        {
            unchecked // Overflow is fine, just wrap
            {
                int hashCode = 41;
                if (this.OperationUid != null)
                    hashCode = hashCode * 59 + this.OperationUid.GetHashCode();
                if (this.Status != null)
                    hashCode = hashCode * 59 + this.Status.GetHashCode();
                if (this.Data != null)
                    hashCode = hashCode * 59 + this.Data.GetHashCode();
                return hashCode;
            }
        }

19 Source : AnnotationInDocument.cs
with GNU Affero General Public License v3.0
from LexPredict

public override int GetHashCode()
        {
            unchecked // Overflow is fine, just wrap
            {
                int hashCode = 41;
                if (this.Pk != null)
                    hashCode = hashCode * 59 + this.Pk.GetHashCode();
                if (this.Doreplacedent != null)
                    hashCode = hashCode * 59 + this.Doreplacedent.GetHashCode();
                if (this.Value != null)
                    hashCode = hashCode * 59 + this.Value.GetHashCode();
                if (this.Field != null)
                    hashCode = hashCode * 59 + this.Field.GetHashCode();
                if (this.LocationStart != null)
                    hashCode = hashCode * 59 + this.LocationStart.GetHashCode();
                if (this.LocationEnd != null)
                    hashCode = hashCode * 59 + this.LocationEnd.GetHashCode();
                if (this.LocationText != null)
                    hashCode = hashCode * 59 + this.LocationText.GetHashCode();
                if (this.ModifiedBy != null)
                    hashCode = hashCode * 59 + this.ModifiedBy.GetHashCode();
                if (this.ModifiedDate != null)
                    hashCode = hashCode * 59 + this.ModifiedDate.GetHashCode();
                if (this.Uid != null)
                    hashCode = hashCode * 59 + this.Uid.GetHashCode();
                return hashCode;
            }
        }

19 Source : AnnotationSuggestRequest.cs
with GNU Affero General Public License v3.0
from LexPredict

public override int GetHashCode()
        {
            unchecked // Overflow is fine, just wrap
            {
                int hashCode = 41;
                if (this.Field != null)
                    hashCode = hashCode * 59 + this.Field.GetHashCode();
                if (this.Doreplacedent != null)
                    hashCode = hashCode * 59 + this.Doreplacedent.GetHashCode();
                if (this.Quite != null)
                    hashCode = hashCode * 59 + this.Quite.GetHashCode();
                return hashCode;
            }
        }

19 Source : CloneDocumentFieldRequest.cs
with GNU Affero General Public License v3.0
from LexPredict

public override int GetHashCode()
        {
            unchecked // Overflow is fine, just wrap
            {
                int hashCode = 41;
                if (this.Code != null)
                    hashCode = hashCode * 59 + this.Code.GetHashCode();
                if (this.DoreplacedentType != null)
                    hashCode = hashCode * 59 + this.DoreplacedentType.GetHashCode();
                return hashCode;
            }
        }

19 Source : ClusterProjectResponse.cs
with GNU Affero General Public License v3.0
from LexPredict

public override int GetHashCode()
        {
            unchecked // Overflow is fine, just wrap
            {
                int hashCode = 41;
                if (this.TaskId != null)
                    hashCode = hashCode * 59 + this.TaskId.GetHashCode();
                if (this.ProjectClusteringId != null)
                    hashCode = hashCode * 59 + this.ProjectClusteringId.GetHashCode();
                return hashCode;
            }
        }

See More Examples