Exemplo n.º 1
0
        public int Compare(object x, object y)
        {
            TreeNode nx = x as TreeNode;
            TreeNode ny = y as TreeNode;

            SharedScriptsItemData dx = SharedScriptsItemDataFactory.GetNodeData(nx);
            SharedScriptsItemData dy = SharedScriptsItemDataFactory.GetNodeData(ny);

            if (dx == null && dy == null)
            {
                return(0);
            }
            else if (dx != null && dy == null)
            {
                return(-1);
            }
            else if (dx == null && dy != null)
            {
                return(1);
            }
            else if ((dx.Type ?? -1) == (dy.Type ?? -1))
            {
                return(nx.Text.ToLowerInvariant().CompareTo(ny.Text.ToLowerInvariant()));
            }
            else
            {
                return((dx.Type ?? -1).CompareTo(dy.Type ?? -1));
            }
        }
Exemplo n.º 2
0
        public static SharedScriptsItemData Create(string name, int?type, int?id, int?parentID, string createdBy)
        {
            SharedScriptsItemData result = new SharedScriptsItemData(type);

            result.Name      = name;
            result.ID        = id;
            result.ParentID  = parentID;
            result.CreatedBy = createdBy;
            result.CreatedOn = DateTime.Now;
            return(result);
        }
Exemplo n.º 3
0
        public SharedScriptsItemData CreateCopy()
        {
            SharedScriptsItemData result = new SharedScriptsItemData(this.Type);

            result.Name         = this.Name;
            result.Populated    = this.Populated;
            result.ID           = this.ID;
            result.ParentID     = this.ParentID;
            result.CreatedBy    = this.CreatedBy;
            result.CreatedOn    = this.CreatedOn;
            result.UpdatedBy    = this.UpdatedBy;
            result.UpdatedOn    = this.UpdatedOn;
            result.Script       = this.Script;
            result.ServerName   = this.ServerName;
            result.DatabaseName = this.DatabaseName;
            result.HelpText     = this.HelpText;
            return(result);
        }