예제 #1
0
        ////////////////////////////////////////////////////////////////////////////////////////////////
        /*--------------------------------------------------------------------------------------------*/
        public static string BuildPropList <T>(IWeaverConfig pConfig, IWeaverQuery pQuery, T pElem,
                                               bool pIncludeId = false) where T : IWeaverElement
        {
            IList <WeaverPropPair> props = GetElementPropertyAttributes(typeof(T));
            var sb = new StringBuilder();

            foreach (WeaverPropPair wpp in props)
            {
                string dbName = wpp.Attrib.DbName;

                if (!pIncludeId && dbName == "id")
                {
                    continue;
                }

                object val = wpp.Info.GetValue(pElem, null);

                if (val != null)
                {
                    sb.Append((sb.Length > 0 ? "," : "") +
                              dbName + ":" + pQuery.AddParam(new WeaverQueryVal(val)));
                }
            }

            return(sb.ToString());
        }
예제 #2
0
 ////////////////////////////////////////////////////////////////////////////////////////////////
 /*--------------------------------------------------------------------------------------------*/
 public WeaverStepAsColumn(T pElem, IWeaverConfig pConfig, string pLabel,
                           Expression <Func <T, object> > pProperty = null) : base(pElem)
 {
     Label         = pLabel;
     PropName      = (pProperty == null ? null : pConfig.GetPropertyDbName(pProperty));
     AppendScript  = "";
     ReplaceScript = null;
 }
예제 #3
0
 ////////////////////////////////////////////////////////////////////////////////////////////////
 /*--------------------------------------------------------------------------------------------*/
 public WeaverPath(IWeaverConfig pConfig, IWeaverQuery pQuery)
 {
     Config = pConfig;
     Query  = pQuery;
     vItems = new List <IWeaverPathItem>();
 }