public static ScheduledCommand Create(IActiveObject obj) { ScheduledCommand cmd = new ScheduledCommand(); cmd.Type = obj.DataManager.Settings.BaseActiveObjectType.FullName; cmd.ActiveObjectID = (Guid)obj.DataManager.PrimaryKeyValue; return cmd; }
public GetStatus(IActiveObject bidItem, string bidder, out Task <string> future) : base(bidItem) { _bidder = bidder; _future = _bidItem.GetStatus(_bidder); future = _future; }
private void Reset() { foreach (var property in properties) { TweenDataHolder.pool.PutObject(property.Value); } properties.Clear(); prev = null; next = null; chain = null; target = null; manager = null; _startHandler = null; _startParamHandler = null; _updateHandler = null; _updateParamHandler = null; _completeHandler = null; _completeParamHandler = null; _easing = null; _targetAsIReusable = null; _targetAsIActiveObject = null; }
public static ActiveCollection<ScheduledCommand> Find(IActiveObject obj) { Dictionary<string, object> parameters = new Dictionary<string, object>(); parameters.Add("Type", obj.DataManager.Settings.BaseActiveObjectType.FullName); parameters.Add("ActiveObjectID", obj.DataManager.PrimaryKeyValue); return Find(parameters); }
static PermissionsCollection GetPermissionSettings(IActiveObject ao) { LockedDown ld = ao.DataManager.ActsAs(typeof(LockedDown)) as LockedDown; if (ld == null) return null; return ao.DataManager[ld.FieldName] as PermissionsCollection; }
public static bool HasFlag(IActiveObject ao, string flag) { PermissionsCollection permissions = GetPermissionSettings(ao); if (permissions == null) return false; return permissions.HasFlag(flag, GetRoles()); }
public static ScheduledCommand Schedule(IActiveObject obj, string command, DateTime runAt) { ScheduledCommand task = ScheduledCommand.Create(obj); task.Command = command; task.RunAt = runAt; task.Save(); return task; }
static void Main(string[] args) { IActiveObject activeObject = ActiveObjectFactory.CreateActiveObject(); Task.Run(() => new MakerClientThread("Alice", activeObject).Run()); Task.Run(() => new MakerClientThread("Bobby", activeObject).Run()); Task.Run(() => new DisplayClientThread("Chirs", activeObject).Run()); Console.ReadKey(); }
public static void ClearPendingCommands(IActiveObject obj, string command) { ActiveCollection<ScheduledCommand> tasks = ScheduledCommand.Find(obj); for (int i = 0; i < tasks.Count; i++) { ScheduledCommand task = tasks[i]; if (task.Command.Equals(command, StringComparison.CurrentCultureIgnoreCase)) { task.DataManager.Delete(); } } }
public static bool HasPermission(IActiveObject ao, params PermissionType[] types) { PermissionsCollection permissions = GetPermissionSettings(ao); if (permissions == null) return false; string[] groups = GetRoles(); foreach (PermissionType type in types) { if (permissions.HasPermission(type, groups)) return true; } return false; }
public BuildProfiler(EnvDTE.Project proj, int stackMaxSize, IVsOutputWindowPane bpane, IVsOutputWindowPane ppane, Action onFinished, string singleFile = null) { if (singleFile != null) onlyFile = singleFile; project = proj; clTool = new VCCompilerHelper(project); profilePane = ppane; buildPane = bpane; profiler = new ActiveObject(stackMaxSize); signalFinished = onFinished; Initialize(); profiler.Signal(); }
public static void BindActiveObjectEditors(System.Web.UI.Control control, IActiveObject contentObject) { foreach (System.Web.UI.Control c in control.Controls) { ActiveObjectFieldEditor editor = c as ActiveObjectFieldEditor; if (editor != null) { editor.ActiveObject = contentObject; } else { BindActiveObjectEditors(c, contentObject); } } }
internal void Initialize(TweenManager manager, object target) { this.manager = manager; this.target = target; _duration = Mathf.Min(this.manager.defaultDuration, 1); _elapsed = 0; _targetAsIActiveObject = target as IActiveObject; _targetAsIReusable = target as IReusable; _targetVersion = (_targetAsIReusable != null) ? _targetAsIReusable.version : 0; isActive = false; isCompleted = false; isRemoved = false; }
public TemplateProfiler(EnvDTE.Project proj, string file, int stackMaxSize, IVsOutputWindowPane pane, Action onFinished) { project = proj; clTool = new VCCompilerHelper(project); filename = file; profilePane = pane; try { profiler = new ActiveObject(stackMaxSize); } catch (System.OutOfMemoryException /*ex*/) { string message = "The Tools->Meta->Options page specifies a " + stackMaxSize + " byte stack reserve size. This exceeds available memory." + Environment.NewLine + "Please try again with a lower stack size reserve value."; string caption = "Stack Reserve Size Too Large..."; MessageBox.Show(message, caption, MessageBoxButtons.OK, MessageBoxIcon.Error); cancelProfile = true; return; } signalFinished = onFinished; Initialize(); profiler.Signal(); }
protected void AddCachedObjectDependency(IActiveObject obj) { AddCacheKeyDependency(CacheBroker.GetKey(obj)); }
public static string GetObjectID(IActiveObject obj) { DataManager manager = obj.DataManager; return string.Format("{0}-{1}", manager.Settings.ActiveObjectType.FullName, manager.PrimaryKeyValue); }
public void DeactivateObject(IActiveObject o) => activeObjects.Remove(o);
public void ActivateObject(IActiveObject o) => activeObjects.Add(o);
private static void Cache(IActiveObject obj, params string[] aliases) { Cache(obj, true, aliases); }
public IActiveObject GetOwner() { if (owner == null) { Type ownerType = Type.GetType(this.ActiveObjectType); if (this.DataManager.SingleObjectLoader == null) { owner = DataManager.ActiveObjectLoader(ownerType, this.ActiveObjectID); } else { owner = this.DataManager.SingleObjectLoader(ownerType, this.ActiveObjectID); } } return owner; }
static string[] AliasBuilder(IActiveObject obj) { if (obj is Post) { Post p = obj as Post; return new string[] { string.Concat("Post", GetControllerItemKey(p.ControllerID, p.Slug)) }; } if (obj is Controller) { return new string[] { string.Concat("Controller[", obj.DataManager["Path"], "]") }; } if (obj is File) { File file = obj as File; return new string[] { string.Concat("File", GetControllerItemKey(file.ControllerID, file.FileName)) }; } if (obj is Author) { Author a = obj as Author; if (a.UserName != null) { return new string[] { string.Concat("Author[", a.UserName.ToLower(), "]") }; } } return null; }
public Daemon(string daemonName) { daemon = new DaemonActiveObject(); name = daemonName; }
public DisplayClientThread(string name, IActiveObject activeObject) { this.name = name; this.activeObject = activeObject; }
public SetBidPrice(IActiveObject bidItem, string bidder, double bid) : base(bidItem) { _bidder = bidder; _bid = bid; }
private static void RegisterSingleObjectLoader(IActiveObject obj) { if (obj == null) return; obj.DataManager.SingleObjectLoader = GetActiveObject; }
public static string GetKey(IActiveObject obj) { return GetKey(obj.GetType(), obj.DataManager.PrimaryKeyValue); }
private static void Cache(IActiveObject obj) { Cache(obj, true, AliasBuilder(obj)); }
private void OnObjectMoved(IActiveObject sender, Vector3 newPos) { Debug.Log("UIManager detected " + sender.displayName + " moving to new location: " + newPos.ToString()); }
public MakerClientThread(string name, IActiveObject activeObject) { this.name = name; this.activeObject = activeObject; this.fillchar = name[0]; }
public EntityAgent() { m_PickupActiveObject = new ActiveObject.ActiveObject(); }
private static void Cache(IActiveObject obj, bool overwrite, params string[] aliases) { if (obj == null) return; RegisterSingleObjectLoader(obj); string cacheKey = CacheBroker.GetKey(obj); if (!overwrite && obj.GetType().IsInstanceOfType(CacheBroker.Get(cacheKey))) { if (aliases != null) CacheAliases(cacheKey, aliases); return; } CacheWithAliases(obj, cacheKey, aliases); }
private static void Cache(IActiveObject obj, bool overwrite) { Cache(obj, overwrite, AliasBuilder(obj)); }
static void CacheWithAliases(IActiveObject obj, string key, params string[] aliases) { CacheBroker.Set(key, obj, null, Config.Caching.Current.GetSlidingExpiration(), aliases); }
protected MethodRequest(IActiveObject bidItem) { _bidItem = bidItem; }