/// <summary /> public virtual int CoreWhereHashCode() { var hash = new StringBuilder(); if (this.DimensionValueList == null || this.DimensionValueList.Count == 0) { hash.Append("NULL|"); } else { hash.Append(string.Join("-", this.DimensionValueList.OrderBy(x => x).ToArray()) + "|"); } hash.Append(this.Keyword + "|"); if (this.FieldFilters == null || this.FieldFilters.Count == 0) { hash.Append("NULL|"); } else { foreach (var o in this.FieldFilters.OrderBy(x => x.Name)) { hash.Append(o.GetHashCode() + "~|"); } } if (this.UserList != null) { hash.Append(string.Join("-", this.UserList.OrderBy(x => x)) + "|"); } return(EncryptionDomain.Hash(hash.ToString())); }
/// <summary /> public override int GetHashCode() { var hash = string.Empty; //IF there is a name then use it and ignore SpliceDIdx if (!string.IsNullOrEmpty(this.SpliceDName)) { hash += this.SpliceDName + "|"; } else { hash += this.SpliceDIdx + "|"; } if (this.GroupFields == null || this.GroupFields.Length == 0) { hash += "NULL|"; } else { hash += string.Join("-", this.GroupFields.ToArray()) + "|"; } if (this.Query != null) { hash += this.Query.GetHashCode() + "|"; } return(EncryptionDomain.Hash(hash)); }
/// <summary /> public static string DecryptFromDisk(string fileName) { try { var cryptText = File.ReadAllText(fileName); return(EncryptionDomain.Decrypt(cryptText, GetMachineId())); } catch (Exception ex) { throw; } }
/// <summary /> public static bool EncryptToDisk(string fileName, string data) { try { var cryptText = EncryptionDomain.Encrypt(data, SecurityHelper.GetMachineId()); File.WriteAllText(fileName, cryptText); return(true); } catch (Exception ex) { throw; } }
/// <summary /> public override int GetHashCode() { var newO = this.Clone(); newO.FieldList = newO.FieldList.OrderBy(x => x.Name).ToList(); newO.ObjectAlias = null; newO.CreatedDate = new DateTime(2000, 1, 1); newO.Name = null; newO.Description = null; var h = newO.ToXml(); return((int)EncryptionDomain.HashFast(h)); }
/// <summary /> public override int GetHashCode() { var h = EncryptionDomain.Hash(this.Comparer.ToString()) + "." + this.Name + "."; if (((IFieldFilter)this).Value == null) { h += "NULL"; } else if (((IFieldFilter)this).Value.GetType().IsArray) { var list = ((System.Collections.IEnumerable)((IFieldFilter)this).Value); foreach (var oo in list) { h += oo?.ToString() + "|"; } } else if (((IFieldFilter)this).Value.GetType().IsAssignableFrom(typeof(System.Collections.Generic.List <int>))) { var list = ((System.Collections.Generic.List <int>)((IFieldFilter)this).Value); foreach (var oo in list) { h += oo.ToString() + "|"; } } else if (((IFieldFilter)this).Value.GetType().IsAssignableFrom(typeof(System.Collections.Generic.List <int?>))) { var list = ((System.Collections.Generic.List <int?>)((IFieldFilter)this).Value); foreach (var oo in list) { h += oo?.ToString() + "|"; } } else if (((IFieldFilter)this).Value.GetType().IsAssignableFrom(typeof(System.Collections.Generic.List <long>))) { var list = ((System.Collections.Generic.List <long>)((IFieldFilter)this).Value); foreach (var oo in list) { h += oo.ToString() + "|"; } } else if (((IFieldFilter)this).Value.GetType().IsAssignableFrom(typeof(System.Collections.Generic.List <long?>))) { var list = ((System.Collections.Generic.List <long?>)((IFieldFilter)this).Value); foreach (var oo in list) { h += oo?.ToString() + "|"; } } else if (((IFieldFilter)this).Value.GetType().IsAssignableFrom(typeof(System.Collections.Generic.List <string>))) { var list = ((System.Collections.Generic.List <string>)((IFieldFilter)this).Value); foreach (var oo in list) { h += oo?.ToString() + "|"; } } else { h += ((IFieldFilter)this).Value.ToString(); } return(EncryptionDomain.Hash(h)); }
/// <summary /> public virtual int CoreHashCode() { var hash = new StringBuilder(); if (this.DimensionValueList == null || this.DimensionValueList.Count == 0) { hash.Append("NULL|"); } else { hash.Append(string.Join("-", this.DimensionValueList.OrderBy(x => x).ToArray()) + "|"); } hash.Append(this.Keyword + "|"); if (this.FieldFilters == null || this.FieldFilters.Count == 0) { hash.Append("NULL|"); } else { foreach (var o in this.FieldFilters.OrderBy(x => x.Name)) { hash.Append(o.GetHashCode() + "~|"); } } if (this.FieldSelects == null || this.FieldSelects.Count == 0) { hash.Append("NULL|"); } else { foreach (var o in this.FieldSelects) { hash.Append(o.GetHashCode() + "@|"); } } if (this.GroupFields == null || this.GroupFields.Count == 0) { hash.Append("NULL|"); } else { foreach (var o in this.GroupFields) { hash.Append(o.GetHashCode() + "#|"); } } if (this.IncludeEmptyDimensions) { hash.Append("_ied|"); } if (this.ExcludeDimensionCount) { hash.Append("_edc|"); } hash.Append((this.IncludeDimensions ? "1" : "0") + "|"); hash.Append((this.IncludeAllDimensions ? "1" : "0") + "|"); hash.Append((this.IncludeRecords ? "1" : "0") + "|"); hash.Append((this.IncludeEmptyDimensions ? "1" : "0") + "|"); hash.Append((this.ExcludeDimensionCount ? "1" : "0") + "|"); hash.Append((this.ExcludeCount ? "1" : "0") + "|"); if (this.UserList != null) { hash.Append(string.Join("-", this.UserList.OrderBy(x => x)) + "|"); } if (this.SkipDimensions != null) { hash.Append(string.Join("-", this.SkipDimensions.OrderBy(x => x).Select(x => x.ToString()))); } hash.Append("|"); if (this.DerivedFieldList != null) { this.DerivedFieldList.OrderBy(x => x.Field).ToList().ForEach(x => hash.Append(x.Field + "|" + x.Action + "|")); } return(EncryptionDomain.Hash(hash.ToString())); }
/// <summary /> public override int GetHashCode() { return(EncryptionDomain.Hash(this.SortDirection.ToString() + "·" + this.Name)); }
/// <summary /> public override int GetHashCode() { return(EncryptionDomain.Hash(this.Comparer.ToString() + "·" + this.Latitude + "·" + this.Longitude + "·" + this.Radius)); }