public SPList(XmlElement xParent)
        {
            _columns = new List<SPColumn>();
            XmlNode xTop = xParent["SPList"];
            this.Title = xTop.Attributes["Title"].Value;
            this.ID = new Guid(xTop.Attributes["ID"].Value);
            Hidden = Convert.ToBoolean(xTop.Attributes["Hidden"].Value);
            IsGallery = Convert.ToBoolean(xTop.Attributes["isGallery"].Value);
            IsAppList = Convert.ToBoolean(xTop.Attributes["isAppList"].Value);           

            this.siteUrl = xTop["url"].InnerText;
            XmlNode colNode = xTop["Columns"];
            foreach (XmlNode xChild in colNode.ChildNodes)
            {
                if (xChild.Name == "Column")
                {
                    SPColumn col = new SPColumn(xChild);
                    _columns.Add(col);
                }
            }
        }
 internal static void CopyColumnSettings(SPColumn newCol, SPColumn oldCol)
 {
     newCol.includeInCode = oldCol.includeInCode;
     newCol.SASOrder = oldCol.SASOrder;
     newCol.SASFormat = oldCol.SASFormat;
     newCol.SASInFormat = oldCol.SASInFormat;
     newCol.SASType = oldCol.SASType;
 }
 public static SPColumn Clone(SPColumn original)
 {
     SPColumn clone = new SPColumn();
     clone._sasName = original._sasName;
     clone.Description = original.Description;
     clone.Hidden = original.Hidden;
     clone.ID = original.ID;
     clone.includeInCode = original.includeInCode;
     clone.SASFormat = original.SASFormat;
     clone.SASInFormat = original.SASInFormat;
     clone.SASName = original.SASName;
     clone.SASOrder = original.SASOrder;
     clone.SASType = original.SASType;            
     clone.SPFieldType = original.SPFieldType;
     clone.SPName = original.SPName;
     clone.Title = original.Title;
     return clone;
 }
 public SPColumnProperties(SPColumn col,ISASTaskConsumer3 cons)
 {
     _column = col;
     consumer = cons;
     InitializeComponent();
 }
 public void AddColumnToCode(SPColumn col)
 {
     IList<SPColumn> cols = GetColumnsForCode();
     col.includeInCode = true;
     col.SASOrder = cols.Count;
 }
 public void RemoveColumnFromCode(SPColumn col)
 {
     IList<SPColumn> cols = GetColumnsForCode();
     for (int i = col.SASOrder + 1; i < cols.Count; i++)
     {
         SPColumn curCol = cols[i];
         --curCol.SASOrder;
     }
     col.includeInCode = false;
     col.SASOrder = -1;
 }
 public void MoveColumn(SPColumn column, bool up)
 {
     //find column to switch with
     int targetOrder = up ? column.SASOrder - 1 : column.SASOrder + 1;
     SPColumn targetCol = null;
     foreach (SPColumn curCol in GetColumns(false))
     {
         if (curCol.SASOrder == targetOrder)
         {
             targetCol = curCol;
             break;
         }
     }
     if (targetCol != null)
     {
         targetCol.SASOrder = column.SASOrder;
         column.SASOrder = targetOrder;
     }
 }