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;
 }
Exemple #2
0
 public GetStatus(IActiveObject bidItem, string bidder, out Task <string> future)
     : base(bidItem)
 {
     _bidder = bidder;
     _future = _bidItem.GetStatus(_bidder);
     future  = _future;
 }
Exemple #3
0
        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);
 }
Exemple #5
0
        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;
        }
Exemple #6
0
        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;
 }
Exemple #8
0
        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();
         }
     }
 }
Exemple #10
0
        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;
        }
Exemple #11
0
 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);
         }
     }
 }
Exemple #13
0
        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;
        }
Exemple #14
0
        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));
 }
Exemple #16
0
 public static string GetObjectID(IActiveObject obj)
 {
     DataManager manager = obj.DataManager;
     return string.Format("{0}-{1}", manager.Settings.ActiveObjectType.FullName, manager.PrimaryKeyValue);
 }
Exemple #17
0
 public void DeactivateObject(IActiveObject o) => activeObjects.Remove(o);
Exemple #18
0
 public void ActivateObject(IActiveObject o) => activeObjects.Add(o);
Exemple #19
0
 private static void Cache(IActiveObject obj, params string[] aliases)
 {
     Cache(obj, true, aliases);
 }
Exemple #20
0
 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;
 }
Exemple #21
0
 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;
 }
Exemple #22
0
 public Daemon(string daemonName)
 {
     daemon = new DaemonActiveObject();
     name   = daemonName;
 }
Exemple #23
0
 public DisplayClientThread(string name, IActiveObject activeObject)
 {
     this.name         = name;
     this.activeObject = activeObject;
 }
Exemple #24
0
 public SetBidPrice(IActiveObject bidItem, string bidder, double bid) : base(bidItem)
 {
     _bidder = bidder;
     _bid    = bid;
 }
Exemple #25
0
 private static void RegisterSingleObjectLoader(IActiveObject obj)
 {
     if (obj == null) return;
     obj.DataManager.SingleObjectLoader = GetActiveObject;
 }
Exemple #26
0
 public static string GetKey(IActiveObject obj)
 {
     return GetKey(obj.GetType(), obj.DataManager.PrimaryKeyValue);
 }
Exemple #27
0
 private static void Cache(IActiveObject obj)
 {
     Cache(obj, true, AliasBuilder(obj));
 }
Exemple #28
0
 private void OnObjectMoved(IActiveObject sender, Vector3 newPos)
 {
     Debug.Log("UIManager detected " + sender.displayName + " moving to new location: " + newPos.ToString());
 }
Exemple #29
0
 public MakerClientThread(string name, IActiveObject activeObject)
 {
     this.name         = name;
     this.activeObject = activeObject;
     this.fillchar     = name[0];
 }
Exemple #30
0
 public Daemon(string daemonName)
 {
     daemon = new DaemonActiveObject();
     name = daemonName;
 }
Exemple #31
0
 public EntityAgent()
 {
     m_PickupActiveObject = new ActiveObject.ActiveObject();
 }
Exemple #32
0
        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);
        }
Exemple #33
0
 private static void Cache(IActiveObject obj, bool overwrite)
 {
     Cache(obj, overwrite, AliasBuilder(obj));
 }
Exemple #34
0
 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;
 }