public void TexImage2D(BindTarget Target, int Level, InternalFormat InternalFormat, int Width, int Height, int Border, Format Format, Type Type, IntPtr Data) { if (Border != 0) { throw new Exception("Border value must be 0"); } _Parent.TexImage2D(this, Target, Level, InternalFormat, Width, Height, Format, Type, Data); }
public unsafe void TexImage2D(BindTarget Target, int Level, InternalFormat InternalFormat, int Width, int Height, int Border, Format Format, Type Type, byte[] Data) { if (Data == null) { TexImage2D(Target, Level, InternalFormat, Width, Height, Border, Format, Type, new IntPtr(0)); } else { fixed(byte *pData = &Data[0]) { TexImage2D(Target, Level, InternalFormat, Width, Height, Border, Format, Type, new IntPtr(pData)); } } }
public unsafe void BufferData(BindTarget Target, int Size, int[] Data, Usage Usage) { if (Data == null) { _Parent.BufferData(this, Target, Size, new IntPtr(0), Usage); } else { fixed(int *pData = &Data[0]) { _Parent.BufferData(this, Target, Size, new IntPtr(pData), Usage); } } }
protected virtual Node GetBindingRoot() { if (BindTarget != null) { var value = (SenseNet.Portal.UI.PortletFramework.BindTarget)Enum.Parse(typeof(SenseNet.Portal.UI.PortletFramework.BindTarget), BindTarget); switch (value) { case SenseNet.Portal.UI.PortletFramework.BindTarget.Unselected: return(Content.CreateNew("Folder", Repository.Root, "DummyNode").ContentHandler); case SenseNet.Portal.UI.PortletFramework.BindTarget.CurrentSite: //return PortalContext.Current.Site; return(SenseNet.Portal.Site.GetSiteByNode(PortalContext.Current.ContextNode)); case SenseNet.Portal.UI.PortletFramework.BindTarget.CurrentPage: return(PortalContext.Current.Page); case SenseNet.Portal.UI.PortletFramework.BindTarget.CurrentUser: return(HttpContext.Current.User.Identity as User); case SenseNet.Portal.UI.PortletFramework.BindTarget.CustomRoot: return(Node.LoadNode(this.CustomRootPath)); case SenseNet.Portal.UI.PortletFramework.BindTarget.CurrentStartPage: return(PortalContext.Current.Site.StartPage as Node ?? PortalContext.Current.Site as Node); case SenseNet.Portal.UI.PortletFramework.BindTarget.Breadcrumb: case SenseNet.Portal.UI.PortletFramework.BindTarget.CurrentContent: return(PortalContext.Current.ContextNode ?? Repository.Root); case SenseNet.Portal.UI.PortletFramework.BindTarget.CurrentWorkspace: return((Node)PortalContext.Current.ContextWorkspace ?? PortalContext.Current.Site); case SenseNet.Portal.UI.PortletFramework.BindTarget.CurrentList: return(ContentList.GetContentListByParentWalk(PortalContext.Current.ContextNode)); default: throw new NotImplementedException(BindTarget.ToString()); } } else { return(PortalContext.Current.ContextNode ?? Repository.Root); } }
//添加一个绑定目标 public BindHandler AddTarget(BindProperty property, string propertyName = null) { var bindTarget = new BindTarget() { target = property, action = e => { if (propertyName == null || propertyName == e.propertyName) { changeAction?.Invoke(e); } } }; bindTarget.Bind(); bindTargets.Add(bindTarget); return(this); }
private Node GetBindingRootPrivate() { switch (BindTarget) { case BindTarget.Unselected: return(Content.CreateNew("Folder", Repository.Root, "DummyNode").ContentHandler); case BindTarget.CurrentSite: //return PortalContext.Current.Site; return(Portal.Site.GetSiteByNode(PortalContext.Current.ContextNode)); case BindTarget.CurrentPage: return(PortalContext.Current.Page); case BindTarget.CurrentUser: return(HttpContext.Current.User.Identity as User); case BindTarget.CustomRoot: return(Node.LoadNode(this.CustomRootPath)); case BindTarget.CurrentStartPage: return(PortalContext.Current.Site.StartPage as Node ?? PortalContext.Current.Site as Node); case BindTarget.Breadcrumb: case BindTarget.CurrentContent: return(PortalContext.Current.ContextNode ?? Repository.Root); case BindTarget.CurrentWorkspace: return((Node)PortalContext.Current.ContextWorkspace ?? PortalContext.Current.Site); case BindTarget.CurrentList: return(PortalContext.Current.ContentList); default: throw new NotImplementedException(BindTarget.ToString()); } }
public ModelPropAttribute() { BindTarget = BindTarget.Template; }
protected override void OnParametersSet() { valueTarget = new BindTarget(ValueRoot, ValuePath); }
static void StartBinder(string[] args) { if (args.Length < 2) { return; } var configFile = args[0]; ToolsetPath = args[1]; if (args.Length >= 3) { Mode = (BindTarget)Enum.Parse(typeof(BindTarget), args[2]); } else { Mode = BindTarget.All; } Console.WriteLine("start binder.."); Directory.SetCurrentDirectory(Path.GetDirectoryName(configFile)); var json = File.ReadAllText(configFile); options = JsonConvert.DeserializeObject <BindOptions>(json); string managedDir = Path.Combine(options.ScriptEngineDir, "Managed"); string adapterDir = Path.Combine(options.ScriptEngineDir, "Adapter"); ReplaceMscorlib("lib", managedDir); Binder.Init(Path.Combine(adapterDir, "glue")); CSCGenerater.Init(ToolsetPath, adapterDir, managedDir, options.AdapterSet); CBinder.Init(Path.Combine(options.ScriptEngineDir, "generated")); AOTGenerater.Init(options.ScriptEngineDir); foreach (var filePath in Directory.GetFiles(managedDir)) { var file = Path.GetFileName(filePath); if (file.EndsWith(".dll") && !IgnoreAssemblySet.Contains(file)) { if (options.AdapterSet.Contains(file)) { Binder.Bind(filePath); } else if (Mode == BindTarget.All) { if (!options.InterpSet.Contains(file)) { Console.WriteLine("aot: " + file); AOTGenerater.AddAOTAssembly(filePath); } if (file.StartsWith("UnityEngine.")) { Console.WriteLine("bind icall: " + file); CBinder.Bind(filePath); } else { if (options.InterpSet.Contains(file)) { Console.WriteLine("Interpreter runtime: " + file); } } } } } Binder.End(); CSCGenerater.End(); if (Mode == BindTarget.All) { CBinder.End(); AOTGenerater.End(); } foreach (var file in options.AdapterSet) { var path = Path.Combine(managedDir, file); if (File.Exists(path)) { var tempDir = Path.Combine(managedDir, "..", "temp"); if (!Directory.Exists(tempDir)) { Directory.CreateDirectory(tempDir); } File.Copy(path, Path.Combine(tempDir, file), true); File.Delete(path); } } }
public void TexParameter(BindTarget Target, Parameter Parameter, ParameterValue ParameterValue) { _Parent.TexParameter(this, Target, (int)Parameter, (int)ParameterValue); }
public void UnbindTexture(BindTarget Target) { _Parent.BindTexture(null, Target); }
public void BindTexture(BindTarget Target) { _Parent.BindTexture(this, Target); }
public void UnbindFramebuffer(BindTarget Target) { _Parent.BindFramebuffer(null, Target); }
public void BindFramebuffer(BindTarget Target) { _Parent.BindFramebuffer(this, Target); }
public void AttachTexture(BindTarget Target, Attachment Attachment, glTexture texture, int Level) { _Parent.FramebufferTexture(this, Target, Attachment, texture, Level); }
public void BufferData(BindTarget Target, int Size, IntPtr Data, Usage Usage) { _Parent.BufferData(this, Target, Size, Data, Usage); }