bool CanUseAsImpl( AttrInfo info, AttrCase channel, TermFlavor flavor) { return(info.IsFactor(flavor, channel)); }
D3D11_BLEND GetSubFactorBlendDescImpl( AttrInfo left, AttrInfo right, AttrCase channel) { throw OperationTooComplexError(right.Range); }
D3D11_BLEND GetTermBlendDescImpl( TermInfo info, AttrCase channel, TermFlavor flavor) { // Need to look for a match on our target type var left = info._left; var right = info._right; AttrInfo factor = null; if (left.IsFactor(flavor, channel)) { factor = right; } else if (right.IsFactor(flavor, channel)) { factor = left; } else { throw OperationTooComplexError(info.Range); } return(GetFactorBlendDesc( factor, channel)); }
private void DecomposeAttr( MidAttributeDecl midAttrDecl, int index) { DecomposeAttrContext context; context.index = index; context.flavor = AttrCase.Combined; AttrInfo info = DecomposeAttr(midAttrDecl, context); try { var blendDesc = GetTargetBlendDesc(info); _renderTargetBlendDescs[index] = blendDesc; // Do validation stuff - basically, we need to // be sure that whatever expressions get put into // the _renderTargetSources[index] entry are more // or less the "same" source... } catch (D3D11PixelShaderOperationTooComplex) { // error should have been reported when // the exception was thrown } }
static private List <AttrInfo> GetAttrInfosInGameObjectByBind(GameObject obj) { AutoBind[] uiBinds = obj.GetComponentsInChildren <AutoBind>(); List <AttrInfo> attrInfos = new List <AttrInfo>(); foreach (AutoBind uiBind in uiBinds) { Transform targetTrans = uiBind.transform; string path = ""; while (targetTrans.parent != obj.transform) { targetTrans = targetTrans.parent; path = targetTrans.name + "/" + path; } path += uiBind.transform.name; AttrInfo attrInfo = new AttrInfo(); if (!string.IsNullOrEmpty(uiBind.attrName)) { attrInfo.attrName = AutoBindHelper.AutoName(uiBind); } else { string fieldName = uiBind.transform.name; fieldName = GetFieldName(fieldName); attrInfo.attrName = fieldName; } attrInfo.typeName = uiBind.type.ToString(); attrInfo.objName = uiBind.transform.name; attrInfo.path = path.ToString(); attrInfos.Add(attrInfo); } return(attrInfos); }
private void parseShenGeExtraInfo(string str) { ShenGeExtra = new List <ShenGeExtraEffect>(); string[] sttr = str.Split('#'); for (int i = 0; i < sttr.Length; i++) { string tmp = sttr[i]; string[] strrStrings = tmp.Split('&'); ShenGeExtraEffect shenGeExtra = new ShenGeExtraEffect(); shenGeExtra.level = StringKit.toInt(strrStrings[0]); string tempStr = strrStrings[1]; string[] str2 = tempStr.Split('*'); List <AttrInfo> newAttrInfos = new List <AttrInfo>(); for (int k = 0; k < str2.Length; k++) { string tempp = str2[k]; string[] str3 = tempp.Split(','); AttrInfo attrInfo = new AttrInfo(); attrInfo.type = StringKit.toInt(str3[0]); attrInfo.value = StringKit.toInt(str3[1]); newAttrInfos.Add(attrInfo); } shenGeExtra.AttrInfos = newAttrInfos; ShenGeExtra.Add(shenGeExtra); } }
D3D11_BLEND GetTermBlendDesc( AttrInfo info, AttrCase channel, TermFlavor flavor) { return(GetTermBlendDescImpl((dynamic)info, channel, flavor)); }
private static void InitOpacity() { // --- var info = new AttrInfo { SvgAttributeType = SvgAttributes.AttrOpacityOpacity, SvgAttributeGroup = SvgAttributeGroup.GroupOpacity, Name = "opacity" }; mapAttributeInfo.Add(info.SvgAttributeType, info); // --- // --- info = new AttrInfo { SvgAttributeType = SvgAttributes.AttrOpacityFillOpacity, SvgAttributeGroup = SvgAttributeGroup.GroupOpacity, Name = "fill-opacity" }; mapAttributeInfo.Add(info.SvgAttributeType, info); // --- // --- info = new AttrInfo { SvgAttributeType = SvgAttributes.AttrOpacityStrokeOpacity, SvgAttributeGroup = SvgAttributeGroup.GroupOpacity, Name = "stroke-opacity" }; mapAttributeInfo.Add(info.SvgAttributeType, info); // --- }
internal static P6how Thaw(ThawBuffer tb) { P6how n = new P6how(); tb.Register(n); n.stable = (STable)tb.ObjRef(); int state = tb.Byte(); n.isComposing = state >= 1; n.isComposed = state >= 2; n.rtype = tb.String(); n.type = n.rtype == "package" ? P6how.PACKAGE : n.rtype == "module" ? P6how.MODULE : n.rtype == "class" ? P6how.CLASS : n.rtype == "grammar" ? P6how.GRAMMAR : n.rtype == "role" ? P6how.ROLE : n.rtype == "prole" ? P6how.PARAMETRIZED_ROLE : n.rtype == "subset" ? P6how.SUBSET : n.rtype == "crole" ? P6how.CURRIED_ROLE : -1; n.roleFactory = (P6any)tb.ObjRef(); n.subsetWhereThunk = (P6any)tb.ObjRef(); n.subsetFilter = (Variable)tb.ObjRef(); n.curriedArgs = tb.RefsA <Variable>(); n.rolePun = tb.ObjRef(); int mcount = tb.Int(); while (mcount-- > 0) { MethodInfo mi = default(MethodInfo); mi.short_name = tb.String(); mi.long_name = tb.String(); mi.impl = (P6any)tb.ObjRef(); mi.flags = tb.Byte(); n.lmethods.Add(mi); } int acount = tb.Int(); while (acount-- > 0) { AttrInfo ai = default(AttrInfo); ai.name = tb.String(); ai.init = (P6any)tb.ObjRef(); ai.flags = tb.Byte(); ai.type = (STable)tb.ObjRef(); n.local_attr.Add(ai); } n.superclasses = tb.RefsL <STable>(); n.local_roles = tb.RefsL <STable>(); n.role_typecheck_list = tb.RefsL <STable>(); n.mro = tb.RefsA <STable>(); tb.PushFixup(n); return(n); }
public SubInfo( SourceRange range, AttrInfo left, AttrInfo right) : base(range) { _left = left; _right = right; }
bool CanUseAs( AttrInfo info, AttrCase channel, TermFlavor flavor) { if (info.IsFactor(flavor, channel)) { return(true); } return(CanUseAsImpl((dynamic)info, channel, flavor)); }
public OpInfo( SourceRange range, D3D11_BLEND_OP op, AttrInfo left, AttrInfo right) : base(range) { _op = op; _left = left; _right = right; }
D3D11_BLEND GetTermBlendDescImpl( AttrInfo info, AttrCase channel, TermFlavor flavor) { if (info.IsFactor(flavor, channel)) { return(D3D11_BLEND.D3D11_BLEND_ONE); } throw OperationTooComplexError(info.Range); }
private static void InitCore() { // --- var info = new AttrInfo { SvgAttributeType = SvgAttributes.AttrCoreId, SvgAttributeGroup = SvgAttributeGroup.GroupCore, Name = "id" }; mapAttributeInfo.Add(info.SvgAttributeType, info); // --- // --- info = new AttrInfo { SvgAttributeType = SvgAttributes.AttrCoreXmlBase, SvgAttributeGroup = SvgAttributeGroup.GroupCore, Name = "xml:base" }; mapAttributeInfo.Add(info.SvgAttributeType, info); // --- // --- info = new AttrInfo { SvgAttributeType = SvgAttributes.AttrCoreXmlLang, SvgAttributeGroup = SvgAttributeGroup.GroupCore, Name = "xml:lang" }; mapAttributeInfo.Add(info.SvgAttributeType, info); // --- // --- info = new AttrInfo { SvgAttributeType = SvgAttributes.AttrCoreXmlSpace, SvgAttributeGroup = SvgAttributeGroup.GroupCore, Name = "xml:space", SvgAttributeDataType = SvgAttributeDataType.DataTypeEnum }; info.EnumValues.Add("default"); info.EnumValues.Add("preserve"); mapAttributeInfo.Add(info.SvgAttributeType, info); // --- }
internal static P6how Thaw(ThawBuffer tb) { P6how n = new P6how(); tb.Register(n); n.stable = (STable)tb.ObjRef(); int state = tb.Byte(); n.isComposing = state >= 1; n.isComposed = state >= 2; n.rtype = tb.String(); n.isRole = n.rtype == "role" || n.rtype == "prole"; n.isSubset = n.rtype == "subset"; n.isPackage = n.rtype == "package"; n.roleFactory = (P6any)tb.ObjRef(); n.subsetWhereThunk = (P6any)tb.ObjRef(); n.subsetFilter = (Variable)tb.ObjRef(); // local_does not yet used int mcount = tb.Int(); while (mcount-- > 0) { MethodInfo mi = default(MethodInfo); mi.short_name = tb.String(); mi.long_name = tb.String(); mi.impl = (P6any)tb.ObjRef(); mi.flags = tb.Byte(); n.lmethods.Add(mi); } int acount = tb.Int(); while (acount-- > 0) { AttrInfo ai = default(AttrInfo); ai.name = tb.String(); ai.init = (P6any)tb.ObjRef(); ai.flags = tb.Byte(); ai.type = (STable)tb.ObjRef(); n.local_attr.Add(ai); } n.superclasses = tb.RefsL <STable>(); n.mro = tb.RefsA <STable>(); tb.PushFixup(n); return(n); }
static string CreateInfoText(string tag) { if (string.IsNullOrEmpty(tag) || !mTagInfo.ContainsKey(tag[0])) { return(tag); } PosInfo posInfo = mTagInfo[tag[0]]; string infoText = tag[0] + " = " + posInfo.mPosCat; for (int i = 1; i < tag.Length; i++) { AttrInfo attrInfo = posInfo.mAttrInfo[i - 1]; if (attrInfo.mAttrValInfo.ContainsKey(tag[i])) { infoText += string.Format("\n{0} = {1} = {2}", tag[i], attrInfo.mAttrName, attrInfo.mAttrValInfo[tag[i]]); } } return(infoText); }
D3D11_BLEND GetSubFactorBlendDescImpl( LitInfo left, AttrInfo right, AttrCase channel) { var value = left._value; if (value != 1.0f) { throw OperationTooComplexError(right.Range); } var factor = GetFactorBlendDesc(right, channel); switch (factor) { case D3D11_BLEND.D3D11_BLEND_SRC_COLOR: return(D3D11_BLEND.D3D11_BLEND_INV_SRC_COLOR); case D3D11_BLEND.D3D11_BLEND_SRC_ALPHA: return(D3D11_BLEND.D3D11_BLEND_INV_SRC_ALPHA); case D3D11_BLEND.D3D11_BLEND_DEST_ALPHA: return(D3D11_BLEND.D3D11_BLEND_INV_DEST_ALPHA); case D3D11_BLEND.D3D11_BLEND_DEST_COLOR: return(D3D11_BLEND.D3D11_BLEND_INV_DEST_COLOR); case D3D11_BLEND.D3D11_BLEND_BLEND_FACTOR: return(D3D11_BLEND.D3D11_BLEND_INV_BLEND_FACTOR); case D3D11_BLEND.D3D11_BLEND_SRC1_COLOR: return(D3D11_BLEND.D3D11_BLEND_INV_SRC1_COLOR); case D3D11_BLEND.D3D11_BLEND_SRC1_ALPHA: return(D3D11_BLEND.D3D11_BLEND_INV_SRC1_ALPHA); default: throw OperationTooComplexError(right.Range); } }
static private List <AttrInfo> GetAttrInfosInGameObject(GameObject obj) { string name = obj.name; Transform[] childs = obj.GetComponentsInChildren <Transform>(); List <AttrInfo> attrInfos = new List <AttrInfo>(); foreach (Transform child in childs) { if (child.name.Contains("_")) { string key = child.name.Split('_')[0]; string value; if (dicType.TryGetValue(key, out value)) { string fieldName = child.name; fieldName = GetFieldName(fieldName); Transform targetTrans = child; string path = ""; while (targetTrans.parent != obj.transform) { targetTrans = targetTrans.parent; path = targetTrans.name + "/" + path; } path += child.name; AttrInfo attrInfo = new AttrInfo(); attrInfo.attrName = fieldName; attrInfo.typeName = value; attrInfo.objName = child.name; attrInfo.path = path.ToString(); attrInfos.Add(attrInfo); } } } return(attrInfos); }
static void LoadTagInfo() { string[] lines = File.ReadAllLines(Global.mServer.MapPath("~\\App_Data\\tagExpl.txt")); foreach (string line in lines) { string[] data = line.Split('\t'); if (!mTagInfo.ContainsKey(data[0][0])) { mTagInfo.Add(data[0][0], new PosInfo(data[1])); } PosInfo posInfo = mTagInfo[data[0][0]]; if (data[3] != "") { int idx = Convert.ToInt32(data[3]) - 1; if (posInfo.mAttrInfo.Count - 1 < idx) { posInfo.mAttrInfo.Add(new AttrInfo(data[4])); } AttrInfo attrInfo = posInfo.mAttrInfo.Last; attrInfo.mAttrValInfo.Add(data[2][0], data[5]); } } }
private static void InitSvg() { // --- var info = new AttrInfo { SvgAttributeType = SvgAttributes.AttrSvgXmlNs, SvgAttributeGroup = SvgAttributeGroup.GroupSvg, Name = "xmlns" }; mapAttributeInfo.Add(info.SvgAttributeType, info); // --- // --- info = new AttrInfo { SvgAttributeType = SvgAttributes.AttrSvgVersion, SvgAttributeGroup = SvgAttributeGroup.GroupSvg, Name = "version" }; mapAttributeInfo.Add(info.SvgAttributeType, info); // --- }
private void InitStyle() { // --- var info = new AttrInfo { SvgAttributeType = SvgAttributes.AttrStyleClass, SvgAttributeGroup = SvgAttributeGroup.GroupStyle, Name = "class" }; mapAttributeInfo.Add(info.SvgAttributeType, info); // --- // --- info = new AttrInfo { SvgAttributeType = SvgAttributes.AttrStyleStyle, SvgAttributeGroup = SvgAttributeGroup.GroupStyle, Name = "style" }; mapAttributeInfo.Add(info.SvgAttributeType, info); // --- }
void GrowAttributes() { int newcount = this.attributes.Length * 2; AttrInfo[] n = new AttrInfo[newcount]; System.Array.Copy(this.attributes, 0, n, 0, this.attrCount); this.attributes = n; }
ChannelBlendDesc GetChannelBlendDesc( AttrInfo info, AttrCase channel) { return(GetChannelBlendDescImpl((dynamic)info, channel)); }
TargetBlendDesc GetTargetBlendDescImpl(AttrInfo info) { throw OperationTooComplexError(info.Range); }
D3D11_BLEND GetTermBlendDescImpl( AttrInfo info, AttrCase channel, TermFlavor flavor) { if (info.IsFactor(flavor, channel)) { return D3D11_BLEND.D3D11_BLEND_ONE; } throw OperationTooComplexError(info.Range); }
public TermInfo( SourceRange range, AttrInfo left, AttrInfo right ) : base(range) { _left = left; _right = right; }
static private void BindPropertie(object obj, GameObject go, FieldInfo info, AttrInfo attrInfo) { var child = go.transform.Find(attrInfo.path); info.SetValue(obj, GetObjByAttrType(child, attrInfo.typeName)); }
bool CanUseAsImpl( AttrInfo info, AttrCase channel, TermFlavor flavor) { return info.IsFactor(flavor, channel); }
private static void InitPaint() { // --- var info = new AttrInfo { SvgAttributeType = SvgAttributes.AttrPaintColor, SvgAttributeGroup = SvgAttributeGroup.GroupPaint, Name = "color", SvgAttributeDataType = SvgAttributeDataType.DataTypeColor }; mapAttributeInfo.Add(info.SvgAttributeType, info); // --- // --- info = new AttrInfo { SvgAttributeType = SvgAttributes.AttrPaintFill, SvgAttributeGroup = SvgAttributeGroup.GroupPaint, Name = "fill", SvgAttributeDataType = SvgAttributeDataType.DataTypeColor }; mapAttributeInfo.Add(info.SvgAttributeType, info); // --- // --- info = new AttrInfo { SvgAttributeType = SvgAttributes.AttrPaintFillRule, SvgAttributeGroup = SvgAttributeGroup.GroupPaint, Name = "fill-rule", SvgAttributeDataType = SvgAttributeDataType.DataTypeEnum }; info.EnumValues.Add("nonzero"); info.EnumValues.Add("evenodd"); info.EnumValues.Add("inherit"); mapAttributeInfo.Add(info.SvgAttributeType, info); // --- // --- info = new AttrInfo { SvgAttributeType = SvgAttributes.AttrPaintStroke, SvgAttributeGroup = SvgAttributeGroup.GroupPaint, Name = "stroke", SvgAttributeDataType = SvgAttributeDataType.DataTypeColor }; mapAttributeInfo.Add(info.SvgAttributeType, info); // --- // --- info = new AttrInfo { SvgAttributeType = SvgAttributes.AttrPaintStrokeWidth, SvgAttributeGroup = SvgAttributeGroup.GroupPaint, Name = "stroke-width" }; mapAttributeInfo.Add(info.SvgAttributeType, info); // --- // --- info = new AttrInfo { SvgAttributeType = SvgAttributes.AttrPaintStrokeDashArray, SvgAttributeGroup = SvgAttributeGroup.GroupPaint, Name = "stroke-dasharray" }; mapAttributeInfo.Add(info.SvgAttributeType, info); // --- // --- info = new AttrInfo { SvgAttributeType = SvgAttributes.AttrPaintStrokeDashOffSet, SvgAttributeGroup = SvgAttributeGroup.GroupPaint, Name = "stroke-dashoffset" }; mapAttributeInfo.Add(info.SvgAttributeType, info); // --- // --- info = new AttrInfo { SvgAttributeType = SvgAttributes.AttrPaintStrokeLineCap, SvgAttributeGroup = SvgAttributeGroup.GroupPaint, Name = "stroke-linecap", SvgAttributeDataType = SvgAttributeDataType.DataTypeEnum }; info.EnumValues.Add("butt"); info.EnumValues.Add("round"); info.EnumValues.Add("square"); info.EnumValues.Add("inherit"); mapAttributeInfo.Add(info.SvgAttributeType, info); // --- // --- info = new AttrInfo { SvgAttributeType = SvgAttributes.AttrPaintStrokeLineJoin, SvgAttributeGroup = SvgAttributeGroup.GroupPaint, Name = "stroke-linejoin", SvgAttributeDataType = SvgAttributeDataType.DataTypeEnum }; info.EnumValues.Add("miter"); info.EnumValues.Add("round"); info.EnumValues.Add("bevel"); info.EnumValues.Add("inherit"); mapAttributeInfo.Add(info.SvgAttributeType, info); // --- // --- info = new AttrInfo { SvgAttributeType = SvgAttributes.AttrPaintStrokeMiterLimit, SvgAttributeGroup = SvgAttributeGroup.GroupPaint, Name = "stroke-miterlimit" }; mapAttributeInfo.Add(info.SvgAttributeType, info); // --- // --- info = new AttrInfo { SvgAttributeType = SvgAttributes.AttrPaintColorInterpolation, SvgAttributeGroup = SvgAttributeGroup.GroupPaint, Name = "color-interpolation", SvgAttributeDataType = SvgAttributeDataType.DataTypeEnum }; info.EnumValues.Add("auto"); info.EnumValues.Add("sRGB"); info.EnumValues.Add("linearRGB"); info.EnumValues.Add("inherit"); mapAttributeInfo.Add(info.SvgAttributeType, info); // --- // --- info = new AttrInfo { SvgAttributeType = SvgAttributes.AttrPaintColorInterpolationFilters, SvgAttributeGroup = SvgAttributeGroup.GroupPaint, Name = "color-interpolation-filters", SvgAttributeDataType = SvgAttributeDataType.DataTypeEnum }; info.EnumValues.Add("auto"); info.EnumValues.Add("sRGB"); info.EnumValues.Add("linearRGB"); info.EnumValues.Add("inherit"); mapAttributeInfo.Add(info.SvgAttributeType, info); // --- // --- info = new AttrInfo { SvgAttributeType = SvgAttributes.AttrPaintColorRendering, SvgAttributeGroup = SvgAttributeGroup.GroupPaint, Name = "color-rendering", SvgAttributeDataType = SvgAttributeDataType.DataTypeEnum }; info.EnumValues.Add("auto"); info.EnumValues.Add("optimizeSpeed"); info.EnumValues.Add("optimizeQuality"); info.EnumValues.Add("inherit"); mapAttributeInfo.Add(info.SvgAttributeType, info); // --- }
D3D11_BLEND GetFactorBlendDescImpl( AttrInfo info, AttrCase channel) { throw OperationTooComplexError(info.Range); }
D3D11_BLEND GetFactorBlendDesc( AttrInfo info, AttrCase channel) { return(GetFactorBlendDescImpl((dynamic)info, channel)); }
protected void Application_Start(object sender, EventArgs e) { //应用程序启动 //定义IOC容器key为类名,value为key所对应类的实例化对象 Dictionary <string, object> containers = new Dictionary <string, object>(); //取得DAL层的程序集名(已在Web.config的ConnectionStrings中预定义好) string dalassname = System.Configuration.ConfigurationManager.ConnectionStrings["dal"].ToString(); //扫描DAL并注入实例化对象 Assembly dalass = Assembly.Load(dalassname); foreach (Type daltype in dalass.GetExportedTypes()) { //if (!daltype.FullName.ToLower().Contains("privateimplementation")) //{ //DAL层没有依赖,直接实例化后注入 object dalobj = daltype.Assembly.CreateInstance(daltype.FullName); containers.Add(daltype.FullName, dalobj); //} } //扫描BLL并注入实例化对象 string bllassname = System.Configuration.ConfigurationManager.ConnectionStrings["bll"].ToString(); Assembly bllass = Assembly.Load(bllassname); foreach (Type blltype in bllass.GetExportedTypes()) { //if (!blltype.FullName.ToLower().Contains("privateimplementation")) //{ object bllobj = blltype.Assembly.CreateInstance(blltype.FullName); //BLL层依赖DAL层的实例化对象 List <PropertyInfo> blltypepropts = blltype.GetTypeInfo().DeclaredProperties.ToList(); foreach (PropertyInfo bpp in blltypepropts) { string bppfullname = bpp.PropertyType.FullName; //遍历已存入DAL实例化对象的容器,取得相应的DAL层对象,给BLL对象的依赖属性赋值 foreach (string key in containers.Keys) { if (bppfullname == key) { bpp.SetValue(bllobj, containers[key]); break; } } } containers.Add(blltype.FullName, bllobj); //} } //获得controllers文件夹中的文件名(类名) string path = Server.MapPath("/controllers/"); DirectoryInfo di = new DirectoryInfo(path); FileInfo[] fis = di.GetFiles(); //定义controllers实例化容器和方法type容器 Dictionary <string, object> fileNameClass = new Dictionary <string, object>(); Dictionary <string, MethodInfo> urlMethod = new Dictionary <string, MethodInfo>(); foreach (FileInfo fi in fis) { //获得类名 string fn = fi.Name.Substring(0, fi.Name.IndexOf(".")); //获得命名空间名(已在Web.config的ConnectionStrings中预定义好) string np = System.Configuration.ConfigurationManager.ConnectionStrings["namespace"].ToString(); Type x = Type.GetType(np + ".controllers." + fn); //遍历类中是否定义特性,如无特性则用类名 if (x.IsSealed)//判断是否为静态类(C#编译器会自动把静态类标记为sealed) { continue; } //遍历类中是否定义特性,如无特性则用类名 List <Attribute> xattrs = x.GetCustomAttributes().ToList(); foreach (object fnattr in x.GetCustomAttributes()) { AttrInfo attr = fnattr as AttrInfo; if (attr != null) { fn = attr.ClassName.Length > 0 ? attr.ClassName : fn; } } //实例化controller对象 object obj = x.Assembly.CreateInstance(x.FullName); //controller对象依赖BLL对象,扫描IOC容器,给依赖属性赋值 List <PropertyInfo> xpropts = x.GetTypeInfo().DeclaredProperties.ToList(); foreach (PropertyInfo xp in xpropts) { string xppfullname = xp.PropertyType.FullName; foreach (string kk in containers.Keys) { if (xppfullname == kk) { xp.SetValue(obj, containers[kk]); break; } } } fileNameClass.Add(fn.ToLower(), obj); //获得方法信息 List <MethodInfo> m = x.GetTypeInfo().DeclaredMethods.ToList(); foreach (MethodInfo mt in m) { string mna = mt.Name + ".action"; foreach (object mtattr in mt.GetCustomAttributes(false)) { AttrInfo mta = mtattr as AttrInfo; if (mta != null) { mna = mta.MethodName.Length > 0 ? (mta.MethodName + ".action") : mna; } } urlMethod.Add(fn.ToLower() + "/" + mna.ToLower(), mt); } } Application["fileNameClass"] = fileNameClass; Application["urlMethod"] = urlMethod; }
private void GrowAttributes() { int newcount = _attributes.Length * 2; AttrInfo[] n = new AttrInfo[newcount]; System.Array.Copy(_attributes, 0, n, 0, _attrCount); _attributes = n; }
TargetBlendDesc GetTargetBlendDesc(AttrInfo info) { return(GetTargetBlendDescImpl((dynamic)info)); }
private static void InitFont() { // --- var info = new AttrInfo { SvgAttributeType = SvgAttributes.AttrFontFamily, SvgAttributeGroup = SvgAttributeGroup.GroupFont, Name = "font-family" }; mapAttributeInfo.Add(info.SvgAttributeType, info); // --- // --- info = new AttrInfo { SvgAttributeType = SvgAttributes.AttrFontSize, SvgAttributeGroup = SvgAttributeGroup.GroupFont, Name = "font-size" }; mapAttributeInfo.Add(info.SvgAttributeType, info); // --- // --- info = new AttrInfo { SvgAttributeType = SvgAttributes.AttrFontSizeAdjust, SvgAttributeGroup = SvgAttributeGroup.GroupFont, Name = "font-size-adjust" }; mapAttributeInfo.Add(info.SvgAttributeType, info); // --- // --- info = new AttrInfo { SvgAttributeType = SvgAttributes.AttrFontStretch, SvgAttributeGroup = SvgAttributeGroup.GroupFont, Name = "font-stretch", SvgAttributeDataType = SvgAttributeDataType.DataTypeEnum }; info.EnumValues.Add("normal"); info.EnumValues.Add("wider"); info.EnumValues.Add("narrower"); info.EnumValues.Add("ultra-condensed"); info.EnumValues.Add("extra-condensed"); info.EnumValues.Add("condensed"); info.EnumValues.Add("semi-condensed"); info.EnumValues.Add("semi-expanded"); info.EnumValues.Add("expanded"); info.EnumValues.Add("extra-expanded"); info.EnumValues.Add("ultra-expanded"); info.EnumValues.Add("inherit"); mapAttributeInfo.Add(info.SvgAttributeType, info); // --- // --- info = new AttrInfo { SvgAttributeType = SvgAttributes.AttrFontStyle, SvgAttributeGroup = SvgAttributeGroup.GroupFont, Name = "font-style", GroupName = "font", Help = "This property specifies whether the text is to be rendered using a normal, italic or oblique face.", SvgAttributeDataType = SvgAttributeDataType.DataTypeEnum }; info.EnumValues.Add("normal"); info.EnumValues.Add("italic"); info.EnumValues.Add("oblique"); info.EnumValues.Add("inherit"); mapAttributeInfo.Add(info.SvgAttributeType, info); // --- // --- info = new AttrInfo { SvgAttributeType = SvgAttributes.AttrFontVariant, SvgAttributeGroup = SvgAttributeGroup.GroupFont, Name = "font-variant", GroupName = "font", Help = "This property indicates whether the text is to be rendered using the normal glyphs for lowercase characters or using small-caps glyphs for lowercase characters.", SvgAttributeDataType = SvgAttributeDataType.DataTypeEnum }; info.EnumValues.Add("normal"); info.EnumValues.Add("small-caps"); info.EnumValues.Add("inherit"); mapAttributeInfo.Add(info.SvgAttributeType, info); // --- // --- info = new AttrInfo { SvgAttributeType = SvgAttributes.AttrFontWeight, SvgAttributeGroup = SvgAttributeGroup.GroupFont, Name = "font-weight", GroupName = "font", Help = "This property refers to the boldness or lightness of the glyphs used to render the text, relative to other fonts in the same font family.", SvgAttributeDataType = SvgAttributeDataType.DataTypeEnum }; info.EnumValues.Add("normal"); info.EnumValues.Add("bold"); info.EnumValues.Add("bolder"); info.EnumValues.Add("lighter"); info.EnumValues.Add("100"); info.EnumValues.Add("200"); info.EnumValues.Add("300"); info.EnumValues.Add("400"); info.EnumValues.Add("500"); info.EnumValues.Add("600"); info.EnumValues.Add("700"); info.EnumValues.Add("800"); info.EnumValues.Add("900"); info.EnumValues.Add("inherit"); mapAttributeInfo.Add(info.SvgAttributeType, info); // --- }
ChannelBlendDesc GetChannelBlendDescImpl( AttrInfo info, AttrCase channel) { throw OperationTooComplexError(info.Range); }
bool CanUseAs( AttrInfo info, AttrCase channel, TermFlavor flavor) { if (info.IsFactor(flavor, channel)) return true; return CanUseAsImpl((dynamic)info, channel, flavor); }
ChannelBlendDesc GetChannelBlendDesc( AttrInfo info, AttrCase channel) { return GetChannelBlendDescImpl((dynamic)info, channel); }
private void GrowAttributes() { int num = this.attributes.Length * 2; AttrInfo[] destinationArray = new AttrInfo[num]; Array.Copy(this.attributes, 0, destinationArray, 0, this.attrCount); this.attributes = destinationArray; }
D3D11_BLEND GetFactorBlendDesc( AttrInfo info, AttrCase channel ) { return GetFactorBlendDescImpl((dynamic)info, channel); }
D3D11_BLEND GetSubFactorBlendDescImpl( LitInfo left, AttrInfo right, AttrCase channel) { var value = left._value; if (value != 1.0f) { throw OperationTooComplexError(right.Range); } var factor = GetFactorBlendDesc(right, channel); switch( factor ) { case D3D11_BLEND.D3D11_BLEND_SRC_COLOR: return D3D11_BLEND.D3D11_BLEND_INV_SRC_COLOR; case D3D11_BLEND.D3D11_BLEND_SRC_ALPHA: return D3D11_BLEND.D3D11_BLEND_INV_SRC_ALPHA; case D3D11_BLEND.D3D11_BLEND_DEST_ALPHA: return D3D11_BLEND.D3D11_BLEND_INV_DEST_ALPHA; case D3D11_BLEND.D3D11_BLEND_DEST_COLOR: return D3D11_BLEND.D3D11_BLEND_INV_DEST_COLOR; case D3D11_BLEND.D3D11_BLEND_BLEND_FACTOR: return D3D11_BLEND.D3D11_BLEND_INV_BLEND_FACTOR; case D3D11_BLEND.D3D11_BLEND_SRC1_COLOR: return D3D11_BLEND.D3D11_BLEND_INV_SRC1_COLOR; case D3D11_BLEND.D3D11_BLEND_SRC1_ALPHA: return D3D11_BLEND.D3D11_BLEND_INV_SRC1_ALPHA; default: throw OperationTooComplexError(right.Range); } }
private static void InitXLink() { // --- var info = new AttrInfo { SvgAttributeType = SvgAttributes.AttrXLinkActuate, SvgAttributeGroup = SvgAttributeGroup.GroupXLink, Name = "xlink:actuate" }; mapAttributeInfo.Add(info.SvgAttributeType, info); // --- // --- info = new AttrInfo { SvgAttributeType = SvgAttributes.AttrXLinkHRef, SvgAttributeGroup = SvgAttributeGroup.GroupXLink, Name = "xlink:href" }; mapAttributeInfo.Add(info.SvgAttributeType, info); // --- // --- info = new AttrInfo { SvgAttributeType = SvgAttributes.AttrXLinkRole, SvgAttributeGroup = SvgAttributeGroup.GroupXLink, Name = "xlink:role" }; mapAttributeInfo.Add(info.SvgAttributeType, info); // --- // --- info = new AttrInfo { SvgAttributeType = SvgAttributes.AttrXLinkShow, SvgAttributeGroup = SvgAttributeGroup.GroupXLink, Name = "xlink:show" }; mapAttributeInfo.Add(info.SvgAttributeType, info); // --- // --- info = new AttrInfo { SvgAttributeType = SvgAttributes.AttrXLinkTarget, SvgAttributeGroup = SvgAttributeGroup.GroupXLink, Name = "target" }; mapAttributeInfo.Add(info.SvgAttributeType, info); // --- // --- info = new AttrInfo { SvgAttributeType = SvgAttributes.AttrXLinkTitle, SvgAttributeGroup = SvgAttributeGroup.GroupXLink, Name = "xlink:title" }; mapAttributeInfo.Add(info.SvgAttributeType, info); // --- // --- info = new AttrInfo { SvgAttributeType = SvgAttributes.AttrXLinkType, SvgAttributeGroup = SvgAttributeGroup.GroupXLink, Name = "xlink:type" }; mapAttributeInfo.Add(info.SvgAttributeType, info); // --- }
TargetBlendDesc GetTargetBlendDesc(AttrInfo info) { return GetTargetBlendDescImpl((dynamic)info); }
private void InitGraphics() { // --- var info = new AttrInfo { SvgAttributeType = SvgAttributes.AttrGraphicsDisplay, SvgAttributeGroup = SvgAttributeGroup.GroupGraphics, Name = "display", SvgAttributeDataType = SvgAttributeDataType.DataTypeEnum }; info.EnumValues.Add("auto"); info.EnumValues.Add("block"); info.EnumValues.Add("list-item"); info.EnumValues.Add("run-in"); info.EnumValues.Add("compact"); info.EnumValues.Add("marker"); info.EnumValues.Add("table"); info.EnumValues.Add("inline-table"); info.EnumValues.Add("table-row-group"); info.EnumValues.Add("table-header-group"); info.EnumValues.Add("table-footer-group"); info.EnumValues.Add("table-row"); info.EnumValues.Add("table-column-group"); info.EnumValues.Add("table-column"); info.EnumValues.Add("table-cell"); info.EnumValues.Add("table-caption"); info.EnumValues.Add("none"); info.EnumValues.Add("inherit"); mapAttributeInfo.Add(info.SvgAttributeType, info); // --- // --- info = new AttrInfo { SvgAttributeType = SvgAttributes.AttrGraphicsImageRendering, SvgAttributeGroup = SvgAttributeGroup.GroupGraphics, Name = "image-rendering", SvgAttributeDataType = SvgAttributeDataType.DataTypeEnum }; info.EnumValues.Add("auto"); info.EnumValues.Add("optimizeSpeed"); info.EnumValues.Add("optimizeQuality"); info.EnumValues.Add("inherit"); mapAttributeInfo.Add(info.SvgAttributeType, info); // --- // --- info = new AttrInfo { SvgAttributeType = SvgAttributes.AttrGraphicsPointerEvents, SvgAttributeGroup = SvgAttributeGroup.GroupGraphics, Name = "pointer-events", SvgAttributeDataType = SvgAttributeDataType.DataTypeEnum }; info.EnumValues.Add("visiblePainted"); info.EnumValues.Add("visibleFill"); info.EnumValues.Add("visibleStroke"); info.EnumValues.Add("visible"); info.EnumValues.Add("painted"); info.EnumValues.Add("fill"); info.EnumValues.Add("stroke"); info.EnumValues.Add("all"); info.EnumValues.Add("none"); info.EnumValues.Add("inherit"); mapAttributeInfo.Add(info.SvgAttributeType, info); // --- // --- info = new AttrInfo { SvgAttributeType = SvgAttributes.AttrGraphicsShapeRendering, SvgAttributeGroup = SvgAttributeGroup.GroupGraphics, Name = "shape-rendering", SvgAttributeDataType = SvgAttributeDataType.DataTypeEnum }; info.EnumValues.Add("auto"); info.EnumValues.Add("optimizeSpeed"); info.EnumValues.Add("crispEdges"); info.EnumValues.Add("geometricPrecision"); info.EnumValues.Add("inherit"); mapAttributeInfo.Add(info.SvgAttributeType, info); // --- // --- info = new AttrInfo { SvgAttributeType = SvgAttributes.AttrGraphicsTextRendering, SvgAttributeGroup = SvgAttributeGroup.GroupGraphics, Name = "text-rendering", SvgAttributeDataType = SvgAttributeDataType.DataTypeEnum }; info.EnumValues.Add("auto"); info.EnumValues.Add("optimizeSpeed"); info.EnumValues.Add("optimizeLegibility"); info.EnumValues.Add("geometricPrecision"); info.EnumValues.Add("inherit"); mapAttributeInfo.Add(info.SvgAttributeType, info); // --- // --- info = new AttrInfo { SvgAttributeType = SvgAttributes.AttrGraphicsVisiblity, SvgAttributeGroup = SvgAttributeGroup.GroupGraphics, Name = "visibility", SvgAttributeDataType = SvgAttributeDataType.DataTypeEnum }; info.EnumValues.Add("visible"); info.EnumValues.Add("hidden"); info.EnumValues.Add("collapse"); info.EnumValues.Add("inherit"); mapAttributeInfo.Add(info.SvgAttributeType, info); // --- }
D3D11_BLEND GetTermBlendDesc( AttrInfo info, AttrCase channel, TermFlavor flavor) { return GetTermBlendDescImpl((dynamic)info, channel, flavor); }
private static void InitElementSpecific() { // --- var info = new AttrInfo { SvgAttributeType = SvgAttributes.AttrSpecificWidth, SvgAttributeGroup = SvgAttributeGroup.GroupElementSpecific, Name = "width" }; mapAttributeInfo.Add(info.SvgAttributeType, info); // --- // --- info = new AttrInfo { SvgAttributeType = SvgAttributes.AttrSpecificHeight, SvgAttributeGroup = SvgAttributeGroup.GroupElementSpecific, Name = "height" }; mapAttributeInfo.Add(info.SvgAttributeType, info); // --- // --- info = new AttrInfo { SvgAttributeType = SvgAttributes.AttrSpecificX, SvgAttributeGroup = SvgAttributeGroup.GroupElementSpecific, Name = "x" }; mapAttributeInfo.Add(info.SvgAttributeType, info); // --- // --- info = new AttrInfo { SvgAttributeType = SvgAttributes.AttrSpecificY, SvgAttributeGroup = SvgAttributeGroup.GroupElementSpecific, Name = "y" }; mapAttributeInfo.Add(info.SvgAttributeType, info); // --- // --- info = new AttrInfo { SvgAttributeType = SvgAttributes.AttrSpecificCx, SvgAttributeGroup = SvgAttributeGroup.GroupElementSpecific, Name = "cx" }; mapAttributeInfo.Add(info.SvgAttributeType, info); // --- // --- info = new AttrInfo { SvgAttributeType = SvgAttributes.AttrSpecificCy, SvgAttributeGroup = SvgAttributeGroup.GroupElementSpecific, Name = "cy" }; mapAttributeInfo.Add(info.SvgAttributeType, info); // --- // --- info = new AttrInfo { SvgAttributeType = SvgAttributes.AttrSpecificR, SvgAttributeGroup = SvgAttributeGroup.GroupElementSpecific, Name = "r" }; mapAttributeInfo.Add(info.SvgAttributeType, info); // --- // --- info = new AttrInfo { SvgAttributeType = SvgAttributes.AttrSpecificRx, SvgAttributeGroup = SvgAttributeGroup.GroupElementSpecific, Name = "rx" }; mapAttributeInfo.Add(info.SvgAttributeType, info); // --- // --- info = new AttrInfo { SvgAttributeType = SvgAttributes.AttrSpecificRy, SvgAttributeGroup = SvgAttributeGroup.GroupElementSpecific, Name = "ry", GroupName = "specific", Help = "For rounded rectangles, the y-axis radius of the ellipse used to round off the corners of the rectangle." }; mapAttributeInfo.Add(info.SvgAttributeType, info); // --- // --- info = new AttrInfo { SvgAttributeType = SvgAttributes.AttrSpecificDx, SvgAttributeGroup = SvgAttributeGroup.GroupElementSpecific, Name = "dx" }; mapAttributeInfo.Add(info.SvgAttributeType, info); // --- // --- info = new AttrInfo { SvgAttributeType = SvgAttributes.AttrSpecificDy, SvgAttributeGroup = SvgAttributeGroup.GroupElementSpecific, Name = "dy" }; mapAttributeInfo.Add(info.SvgAttributeType, info); // --- // --- info = new AttrInfo { SvgAttributeType = SvgAttributes.AttrSpecificRotate, SvgAttributeGroup = SvgAttributeGroup.GroupElementSpecific, Name = "rotate" }; mapAttributeInfo.Add(info.SvgAttributeType, info); // --- // --- info = new AttrInfo { SvgAttributeType = SvgAttributes.AttrSpecificTextLength, SvgAttributeGroup = SvgAttributeGroup.GroupElementSpecific, Name = "textLength" }; mapAttributeInfo.Add(info.SvgAttributeType, info); // --- // --- info = new AttrInfo { SvgAttributeType = SvgAttributes.AttrSpecificLengthAdjust, SvgAttributeGroup = SvgAttributeGroup.GroupElementSpecific, Name = "lengthAdjust", SvgAttributeDataType = SvgAttributeDataType.DataTypeEnum }; info.EnumValues.Add("spacing"); info.EnumValues.Add("spacingAndGlyphs"); mapAttributeInfo.Add(info.SvgAttributeType, info); // --- // --- info = new AttrInfo { SvgAttributeType = SvgAttributes.AttrSpecificX1, SvgAttributeGroup = SvgAttributeGroup.GroupElementSpecific, Name = "x1" }; mapAttributeInfo.Add(info.SvgAttributeType, info); // --- // --- info = new AttrInfo { SvgAttributeType = SvgAttributes.AttrSpecificY1, SvgAttributeGroup = SvgAttributeGroup.GroupElementSpecific, Name = "y1" }; mapAttributeInfo.Add(info.SvgAttributeType, info); // --- // --- info = new AttrInfo { SvgAttributeType = SvgAttributes.AttrSpecificX2, SvgAttributeGroup = SvgAttributeGroup.GroupElementSpecific, Name = "x2" }; mapAttributeInfo.Add(info.SvgAttributeType, info); // --- // --- info = new AttrInfo { SvgAttributeType = SvgAttributes.AttrSpecificY2, SvgAttributeGroup = SvgAttributeGroup.GroupElementSpecific, Name = "y2" }; mapAttributeInfo.Add(info.SvgAttributeType, info); // --- // --- info = new AttrInfo { SvgAttributeType = SvgAttributes.AttrSpecificPathData, SvgAttributeGroup = SvgAttributeGroup.GroupElementSpecific, Name = "d" }; mapAttributeInfo.Add(info.SvgAttributeType, info); // --- // --- info = new AttrInfo { SvgAttributeType = SvgAttributes.AttrSpecificPathLength, SvgAttributeGroup = SvgAttributeGroup.GroupElementSpecific, Name = "pathLength" }; mapAttributeInfo.Add(info.SvgAttributeType, info); // --- // --- info = new AttrInfo { SvgAttributeType = SvgAttributes.AttrSpecificPoints, SvgAttributeGroup = SvgAttributeGroup.GroupElementSpecific, Name = "points" }; mapAttributeInfo.Add(info.SvgAttributeType, info); // --- }
protected void AddGraphic(Geometry geo, string attr, string value, Symbol symbol) { GraphicsLayer.Graphics.Add(new Graphic(geo, AttrInfo.GenAttr(attr, value), symbol)); }