コード例 #1
0
        public void SetBrightness(double value, IOwner owner)
        {
            if (value == 0)
            {
                // Reset owner
                owner = null;
            }

            if (this.owner != null && owner != this.owner)
            {
                if (owner != null)
                {
                    if (owner.Priority <= this.owner.Priority)
                    {
                        return;
                    }
                }
                else
                {
                    return;
                }
            }

            this.owner      = owner;
            this.Brightness = value;
        }
コード例 #2
0
    private void ReplaceMemberOnAllTeam()
    {
        IOwner selectedMember   = null;
        string selectedMemberId = string.Empty;
        IOwner replaceMember    = null;
        string replaceMemberId  = string.Empty;

        if (lueSelectedMember.LookupResultValue != null)
        {
            selectedMemberId = lueSelectedMember.LookupResultValue.ToString();
            selectedMember   = Sage.Platform.EntityFactory.GetById <IOwner>(selectedMemberId);
        }

        if (lueReplaceMember.LookupResultValue != null)
        {
            replaceMemberId = lueReplaceMember.LookupResultValue.ToString();
            replaceMember   = Sage.Platform.EntityFactory.GetById <IOwner>(replaceMemberId);
        }

        if ((selectedMember != null) && (replaceMember != null))
        {
            IList <ITeam> teams = Sage.SalesLogix.Team.Rules.GetTeams();
            foreach (ITeam team in teams)
            {
                if (team.ContainsMember(selectedMember))
                {
                    IOwnerJoin member = Sage.Platform.EntityFactory.GetByCompositeId(typeof(IOwnerJoin), new[] { "ParentOwnerId", "ChildOwnerId" }, new[] { team.Id, selectedMember.Id }) as IOwnerJoin;
                    team.RemoveMember(member);
                    // keep the security profile from the original member
                    team.AddMemberWithSecurityProfile(replaceMember, member.OwnerSecurityProfile);
                }
            }
            RedirectTo(replaceMember);
        }
    }
コード例 #3
0
 protected void CallDisconnected(IOwner owner)
 {
     if (Disconnected != null)
     {
         Disconnected(this, owner);
     }
 }
コード例 #4
0
 /// <summary>
 /// 设置添加项的部分属性成功返回true。如果Filtration也返回true 则 将value加到集合中去
 /// </summary>
 /// <param name="value"></param>
 protected virtual bool SetItemAttribute(int value)
 {
     if (value >= 0 && value < this.m_Owner.List.Count)
     {
         ISetViewItemHelper pSetViewItemHelper;
         if (this.innerList.Count > 0)
         {
             pSetViewItemHelper = this.m_Owner.List[this.innerList[this.innerList.Count - 1]] as ISetViewItemHelper;
             if (pSetViewItemHelper != null)
             {
                 pSetViewItemHelper.SetViewParameterStyle(ViewParameterStyle.eSelected);
             }
         }
         //
         pSetViewItemHelper = this.m_Owner.List[value] as ISetViewItemHelper;
         if (pSetViewItemHelper != null &&
             pSetViewItemHelper.SetViewParameterStyle(ViewParameterStyle.eFocused) &&
             value >= this.m_Owner.TopViewItemIndex && value <= this.m_Owner.BottomViewItemIndex)
         {
             IOwner pOwner = this.m_Owner as IOwner;
             if (pOwner != null)
             {
                 ViewItem viewItem = this.m_Owner.List[value] as ViewItem;
                 if (viewItem != null)
                 {
                     Rectangle rectangle = viewItem.DisplayRectangle;
                     rectangle.Inflate(1, 1);
                     pOwner.Invalidate(rectangle);
                 }
             }
         }
     }
     return(true);
 }
コード例 #5
0
ファイル: FieldOption.cs プロジェクト: bQvle/Sqline
 public FieldOption(IOwner owner, XElement element)
 {
     FOwner = owner;
     if (element.Attribute("field") == null)
     {
         FOwner.Throw(element, "The required attribute 'field' is missing.");
     }
     FFor = element.Attribute("field").Value;
     if (element.Attribute("default") != null)
     {
         FDefault = element.Attribute("default").Value;
     }
     else
     {
         XElement ODefaultElem = element.Element(ItemFile.XmlNamespace + "default");
         if (ODefaultElem != null)
         {
             FDefault = ODefaultElem.Value;
         }
     }
     if (element.Attribute("transform") != null)
     {
         FTransform = element.Attribute("transform").Value;
     }
     else
     {
         XElement OTransformElem = element.Element(ItemFile.XmlNamespace + "transform");
         if (OTransformElem != null)
         {
             FTransform = OTransformElem.Value;
         }
     }
 }
コード例 #6
0
ファイル: ShapeCircle.cs プロジェクト: Paltr/SceneEditor
 public ShapeCircle(IOwner owner, ITransform transform, ISceneView sceneView)
 {
   m_Owner = owner;
   m_SceneView = sceneView;
   m_Transform = new TransformWrapper(transform, this.SceneView);
   m_Children = new List<ShapeCircle>();
 }
コード例 #7
0
ファイル: TreeHelper.cs プロジェクト: yjpark/dap.core.csharp
        public static T GetChild <T>(IOwner owner, string key, bool isDebug = false) where T : class, IElement
        {
            if (owner == null)
            {
                return(null);
            }

            T     child       = null;
            IDict ownerAsDict = owner as IDict;

            if (ownerAsDict != null)
            {
                child = ownerAsDict.Get <IInDictElement>(key, isDebug) as T;
            }
            else
            {
                ITable ownerAsTable = owner as ITable;
                if (ownerAsTable != null)
                {
                    child = ownerAsTable.GetByKey <IInTableElement>(key, isDebug) as T;
                }
            }
            if (child == null)
            {
                owner.ErrorOrDebug(isDebug, "Not Found: {0}", key);
            }
            return(child);
        }
コード例 #8
0
        public DataSet SelectOwnerTest(IOwner owner)
        {
            DataSet tableVerify = new DataSet();

            tableVerify = dbEntity.SelectObject(owner) as DataSet;
            return(tableVerify);
        }
コード例 #9
0
 public void Enter(IOwner owner, AIController controller)
 {
     foreach (var i in m_Elements)
     {
         i.Enter(owner, controller);
     }
 }
コード例 #10
0
ファイル: EntityManager.cs プロジェクト: Zerophase/DyMProject
        public void Add(Entities entityType, int value, IOwner owner)
        {
            if(!entities.ContainsKey(entityType))
                entities.Add(entityType, ids);

            ids.ObjectIds.Add(value, owner);
        }
コード例 #11
0
        protected override void InitializeObject(IGenericEntity ent)
        {
            if (ent is IOwner)
            {
                IOwner            Owner    = (IOwner)ent;
                DBStoredProcedure spInsert = new DBStoredProcedure();
                spInsert.ProcedureName = "catInsertOwner";
                spInsert.AddParameter(new DBParameter("@Code", DbType.String, ParameterDirection.Input, Owner.Code));
                spInsert.AddParameter(new DBParameter("@Name", DbType.String, ParameterDirection.Input, Owner.Name));
                spInsert.AddParameter(new DBParameter("@IdOwnerType", DbType.Int32, ParameterDirection.Input, Owner.IdOwnerType));
                spInsert.AddParameter(new DBParameter("@Rank", DbType.Int32, ParameterDirection.Input, Owner.Rank));

                DBStoredProcedure spUpdate = new DBStoredProcedure();
                spUpdate.ProcedureName = "catUpdateOwner";
                spUpdate.AddParameter(new DBParameter("@Id", DbType.Int32, ParameterDirection.Input, Owner.Id));
                spUpdate.AddParameter(new DBParameter("@Code", DbType.String, ParameterDirection.Input, Owner.Code));
                spUpdate.AddParameter(new DBParameter("@Name", DbType.String, ParameterDirection.Input, Owner.Name));
                spUpdate.AddParameter(new DBParameter("@IdOwnerType", DbType.Int32, ParameterDirection.Input, Owner.IdOwnerType));
                spUpdate.AddParameter(new DBParameter("@Rank", DbType.Int32, ParameterDirection.Input, Owner.Rank));

                DBStoredProcedure spDelete = new DBStoredProcedure();
                spDelete.ProcedureName = "catDeleteOwner";
                spDelete.AddParameter(new DBParameter("@Id", DbType.Int32, ParameterDirection.Input, Owner.Id));

                this.AddStoredProcedure("InsertObject", spInsert);
                this.AddStoredProcedure("UpdateObject", spUpdate);
                this.AddStoredProcedure("DeleteObject", spDelete);

                DBStoredProcedure spSelect = new DBStoredProcedure();
                spSelect.ProcedureName = "catSelectOwner";
                spSelect.AddParameter(new DBParameter("@Id", DbType.Int32, ParameterDirection.Input, Owner.Id));
                this.AddStoredProcedure("SelectObject", spSelect);
            }
        }
コード例 #12
0
 protected void CallAuthorizeReceived(IOwner owner, string name, ICallbacks callbacks)
 {
     if (AuthorizeReceived != null)
     {
         AuthorizeReceived(this, owner, name, callbacks);
     }
 }
コード例 #13
0
ファイル: CardTemplates.cs プロジェクト: facybenbook/Chess2
        public static ICardModel NewCardModel(IRegistry <IModel> reg, Guid id, IOwner owner)
        {
            var tmp  = _templates[id];
            var card = reg.New <CardModel>(tmp, owner);

            return(card);
        }
コード例 #14
0
 public VoidItem(IOwner owner, Configuration configuration, XElement element)
 {
     FOwner         = owner;
     FConfiguration = configuration;
     foreach (XElement OMethod in element.Elements(ItemFile.XmlNamespace + "method"))
     {
         FMethods.Add(new VoidMethod(this, FConfiguration, OMethod));
     }
     foreach (ItemBase OBase in FConfiguration.ViewItems.Bases)
     {
         FBases.Add(OBase);
     }
     foreach (XElement OBaseElement in element.Elements(ItemFile.XmlNamespace + "base"))
     {
         ItemBase OBase = new ItemBase(OBaseElement, ItemFile.XmlNamespace);
         if (!string.IsNullOrEmpty(OBase.Remove))
         {
             if (OBase.Remove.Equals("all", StringComparison.OrdinalIgnoreCase))
             {
                 FBases.Clear();
             }
             else
             {
                 FBases.RemoveAll(i => i.Name == OBase.Name);
             }
         }
         if (!string.IsNullOrEmpty(OBase.Name))
         {
             if (!HasBase(OBase.Name))
             {
                 FBases.Add(OBase);
             }
         }
     }
 }
コード例 #15
0
ファイル: DictContext.cs プロジェクト: yjpark/dap.core.csharp
        }                                                                                          //__SILP__

        //__SILP__
        public T GetAspect <T>(string aspectPath, bool isDebug = false) where T : class, IAspect   //__SILP__
        {
            string[] keys = aspectPath.Split(PathConsts.PathSeparator);                            //__SILP__
            if (keys.Length < 1)                                                                   //__SILP__
            {
                ErrorOrDebug(isDebug, "Invalid aspectPath: {0}", aspectPath);                      //__SILP__
                return(null);                                                                      //__SILP__
            }                                                                                      //__SILP__
            IAspect topAspect;                                                                     //__SILP__

            if (!_TopAspectsDict.TryGetValue(keys[0], out topAspect))                              //__SILP__
            {
                ErrorOrDebug(isDebug, "Not Found: {0}", aspectPath);                               //__SILP__
                return(null);                                                                      //__SILP__
            }                                                                                      //__SILP__
            if (keys.Length == 1)                                                                  //__SILP__
            {
                return(As <T>(topAspect, isDebug));                                                //__SILP__
            }
            else                                                                                   //__SILP__
            {
                IOwner asOwner = As <IOwner>(topAspect, isDebug);                                  //__SILP__
                if (asOwner != null)                                                               //__SILP__
                {
                    return(TreeHelper.GetDescendant <T>(asOwner, keys, 1, isDebug));               //__SILP__
                }                                                                                  //__SILP__
            }                                                                                      //__SILP__
            return(null);                                                                          //__SILP__
        }                                                                                          //__SILP__
コード例 #16
0
ファイル: ChatServer.cs プロジェクト: Niardan/ChatServer
        private void OnAuthorizeReceived(IUdpNetwork network, IOwner owner, string name, ICallbacks callbacks)
        {
            if (string.IsNullOrEmpty(name))
            {
                Console.WriteLine("Authorized failed, empty name, address {0}", owner.Id);
                callbacks.Fail(_incorrectUsername);
                _network.Authorize(owner, false);
                return;
            }

            foreach (var item in _clients.Values)
            {
                if (item == name)
                {
                    Console.WriteLine("Authorized failed, dublicate name, address {0}", owner.Id);
                    callbacks.Fail(_dublicateUsername);
                    _network.Authorize(owner, false);
                    return;
                }
            }
            Console.WriteLine("Authorized true, address: {0}", owner.Id);

            callbacks.Ack(_ok);
            _network.Authorize(owner, true);
            _clients.Add(owner, name);
        }
コード例 #17
0
        public static UIElement ToElement(this IOwner owner)
        {
            if (owner == null)
            {
                return(new Label()
                {
                    Content = ExtensionHelper.ValueUnset
                });
            }

            Expander expander = new Expander()
            {
                Header   = owner.Login.ToDisplayValue(),
                Template = Application.Current.Resources["NiceExpanderTemplate"] as ControlTemplate,
            };

            PropertyInfo[] properties = typeof(IOwner).GetProperties(BindingFlags.Instance | BindingFlags.Public);

            if (properties == null || !properties.Any())
            {
                return(new UIElement());
            }

            Grid grid = new Grid();

            grid.ColumnDefinitions.Add(new ColumnDefinition()
            {
                Width = GridLength.Auto
            });
            grid.ColumnDefinitions.Add(new ColumnDefinition()
            {
                Width = GridLength.Auto
            });

            Int32 rows = properties.Length;

            for (Int32 row = 0; row < rows; row++)
            {
                grid.RowDefinitions.Add(new RowDefinition()
                {
                    Height = GridLength.Auto
                });

                PropertyInfo property = properties[row];

                Label label = owner.ToLabel(property);
                grid.Children.Add(label);
                Grid.SetRow(label, row);
                Grid.SetColumn(label, 0);

                UIElement value = owner.ToValue(property);
                grid.Children.Add(value);
                Grid.SetRow(value, row);
                Grid.SetColumn(value, 1);
            }

            expander.Content = grid;

            return(expander);
        }
コード例 #18
0
 public Car AddItems(IOwner owner)
 {
     return(new Car
     {
         Owners = Owners.Append(owner).ToList()
     });
 }
        public static void OnLoad1Step(IEditSecurityProfile form, EventArgs args)
        {
            // child is the member of a team or department
            // parent is the team or department
            IOwner child = form.CurrentEntity as IOwner;

            form.HiddenChildId.Value   = child.Id.ToString();
            form.NameTextBox.Text      = child.OwnerDescription;
            form.OwnerTypeTextBox.Text = child.Type.ToString();

            IWebDialogService dialogService = form.Services.Get <IWebDialogService>();

            string parentId = dialogService.DialogParameters["parentId"].ToString();

            form.HiddenParentId.Value = parentId;
            IOwner parent = EntityFactory.GetById <IOwner>(parentId);

            form.ParentTextBox.Text = parent.OwnerDescription;

            string profileId = dialogService.DialogParameters["profileId"].ToString();

            form.HiddenProfileId.Value = profileId;
            IOwnerSecurityProfile profile = EntityFactory.GetById <IOwnerSecurityProfile>(profileId);

            form.SecurityProfileLookup.LookupResultValue = profile;
        }
コード例 #20
0
ファイル: CardModel.cs プロジェクト: facybenbook/Chess2
        public CardModel(IOwner owner, ICardTemplate template)
            : base(owner)
        {
            Template = template;

            _player   = new ReactiveProperty <IPlayerModel>(owner as IPlayerModel);
            _power    = new IntReactiveProperty(Template.Power);
            _health   = new IntReactiveProperty(Template.Health);
            _manaCost = new IntReactiveProperty(Template.ManaCost);

            _items     = new ReactiveCollection <IItemModel>(Template.Items);
            _abilities = new ReactiveCollection <EAbility>(Template.Abilities);
            _effects   = new ReactiveCollection <IEffectModel>(Template.Effects);

            _health.Subscribe(h => { if (h <= 0)
                                     {
                                         Die();
                                     }
                              });
            _effects.ObserveAdd().Subscribe(e => Info($"Added Effect {e} from {this}")).AddTo(this);
            _items.ObserveAdd().Subscribe(e => Info($"Added Item {e} from {this}")).AddTo(this);
            _abilities.ObserveAdd().Subscribe(e => Info($"Added Ability {e} from {this}")).AddTo(this);
            _effects.ObserveRemove().Subscribe(e => Info($"Removed Effect {e} from {this}")).AddTo(this);
            _items.ObserveRemove().Subscribe(e => Info($"Removed Item {e} from {this}")).AddTo(this);
            _abilities.ObserveRemove().Subscribe(e => Info($"Removed Ability {e} from {this}")).AddTo(this);
        }
コード例 #21
0
    public void SetOwner(IOwner owner)
    {
        this.owner = owner;
        ai.owner   = owner;
        owner.GetUnitsCommanding().Add(this);
        if (owner as AirCarrier || owner as GroundCarrier)
        {
            // GET THE DRONES TO MOVE
            ai.setMode(AirCraftAI.AIMode.Path);
            var path = ScriptableObject.CreateInstance <Path>();
            path.waypoints = new List <Path.Node>();
            var vec = Vector2.zero;
            if (owner as AirCarrier)
            {
                foreach (var ent in BattleZoneManager.getTargets())
                {
                    if (ent && ent is ICarrier && !FactionManager.IsAllied(ent.faction, owner.GetFaction()) && ent.transform)
                    {
                        vec = ent.transform.position;
                    }
                }
            }
            // otherwise this is a ground carrier, drones are defensive for them so set a path to the drone position currently
            else
            {
                var angle = Random.Range(0F, 360);
                vec = owner.GetTransform().position + new Vector3(5 * Mathf.Sin(angle), 5 * Mathf.Cos(angle));
            }

            // TODO: jank, fix this eventually
            var node = new Path.Node();
            node.position = vec;
            node.ID       = 0;
            node.children = new List <int>();
            if (vec != Vector2.zero)
            {
                path.waypoints.Add(node);
            }
            if (owner as AirCarrier)
            {
                ai.setPath(path);
            }
            else
            {
                NodeEditorFramework.Standard.PathData data = new NodeEditorFramework.Standard.PathData();
                data.waypoints = new List <NodeEditorFramework.Standard.PathData.Node>();
                // TODO: LOL THESE TWO ARE DIFFERENT, unify them
                foreach (var point in path.waypoints)
                {
                    var node2 = new NodeEditorFramework.Standard.PathData.Node();
                    node2.ID       = point.ID;
                    node2.children = point.children;
                    node2.position = point.position;
                    data.waypoints.Add(node2);
                }

                ai.setPath(data, null, true);
            }
        }
    }
コード例 #22
0
 protected void CallRequestReceived(IOwner owner, IValue request, ICallbacks callbacks)
 {
     if (RequestReceived != null)
     {
         RequestReceived(this, owner, request, callbacks);
     }
 }
コード例 #23
0
 protected void CallConnected(IOwner owner)
 {
     if (Connected != null)
     {
         Connected(this, owner);
     }
 }
        /// <summary>
        /// Saves the new team entity and adds the owner to the team.  Optionally will
        /// add the owner's manager to the team is the add owner's manager checkbox is checked.
        /// </summary>
        /// <param name="form"></param>
        /// <param name="args"></param>
        public static void SaveButton_OnClickStep(IInsertTeam form, EventArgs args)
        {
            IWebDialogService dialogService = form.Services.Get <IWebDialogService>();
            // create the new team
            IOwner ownerTeam = EntityFactory.Create <IOwner>();

            ownerTeam.OwnerDescription = form.OwnerDescription.Text;
            ownerTeam.Type             = OwnerType.Team;

            if (!ownerTeam.IsValidName(form.OwnerDescription.Text))
            {
                string msg = form.GetResource("InvalidNameMessage").ToString();
                if (dialogService != null && !string.IsNullOrEmpty(msg))
                {
                    dialogService.ShowMessage(msg, form.GetResource("InvalidNameMessageTitle").ToString());
                }

                return;
            }

            if (ownerTeam.OwnerNameExists(form.OwnerDescription.Text))
            {
                string msg = form.GetResource("DuplicateOwnerMessage").ToString();
                if (dialogService != null && !string.IsNullOrEmpty(msg))
                {
                    dialogService.ShowMessage(msg, form.GetResource("DuplicateOwnerTitle").ToString());
                }

                return;
            }

            ownerTeam.Save();

            // set a default profile
            IOwnerSecurityProfile securityProfile = EntityFactory.GetById <IOwnerSecurityProfile>("PROF00000001");

            if (form.securityProfileLookup.LookupResultValue != null)
            {
                securityProfile = form.securityProfileLookup.LookupResultValue as IOwnerSecurityProfile;
            }

            // get a team object.  This is a view of the owner object
            ITeam team = EntityFactory.GetById <ITeam>(ownerTeam.Id);

            // add an ownerJoin record for the new team.  Both the parent and the
            // child ids will point to the team
            team.AddMemberWithSecurityProfile(ownerTeam, securityProfile);

            // get the selected owner of the team.  This will be a user
            IUser teamOwnerUser = form.DefaultOwner.LookupResultValue as IUser;

            if (teamOwnerUser != null)
            {
                // add the team owner as a member of the team
                IOwnerSecurityProfile ownerSecurityProfile = EntityFactory.GetById <IOwnerSecurityProfile>("PROF00000003");
                team.AddMemberWithSecurityProfile(teamOwnerUser.DefaultOwner, ownerSecurityProfile);
            }
            MySlx.MainView.Show <ITeam>(ownerTeam.Id.ToString());
        }
コード例 #25
0
ファイル: ChatServer.cs プロジェクト: Niardan/ChatServer
        private void OnRequestReceived(IUdpNetwork network, IOwner owner, IValue request, ICallbacks callbacks)
        {
            var chatValue = (ChatValue)request;

            Console.WriteLine("Server receive chat message, address: {0}, name: {1}, message: {2}", owner.Id, chatValue.Name, chatValue.Message);

            _request.Enqueue(new Tuple <IOwner, IValue, ICallbacks>(owner, request, callbacks));
        }
 public TokenAuthenticationHandler(
     IOwner owner, DatabaseContext databaseContext, IOptionsMonitor <TokenAuthenticationOptions> options, ILoggerFactory logger, UrlEncoder encoder, ISystemClock clock)
     : base(options, logger, encoder, clock)
 {
     _logger          = logger.CreateLogger <TokenAuthenticationHandler>();
     _databaseContext = databaseContext;
     _owner           = owner;
 }
コード例 #27
0
 /// <summary>
 /// </summary>
 /// <param name="gymnasium"></param>
 /// <param name="owner"></param>
 public Card(Gymnasium gymnasium, IOwner owner) : base(0, owner)
 {
     if (gymnasium == null)
     {
         throw new ArgumentNullException("gymnasium");
     }
     Gymnasium = gymnasium;
 }
コード例 #28
0
        private void NetworkOnRequestReceived(IUdpNetwork network, IOwner owner, IValue request, Network.Callbacks.ICallbacks callbacks)
        {
            callbacks.Ack("Ok");
            var    value   = (ChatValue)request;
            string message = value.Name + ": " + value.Message;

            CallMessage(message, false);
        }
コード例 #29
0
 public static OwnerEntity CreateEntity(IOwner owner)
 {
     return(new OwnerEntity()
     {
         PartitionKey = Key,
         Address = owner.Address?.ToLower()
     });
 }
コード例 #30
0
 public void Authorize(IOwner owner, bool success)
 {
     _authorizing.Remove(owner.Id);
     if (success)
     {
         _toAutorized.Add(owner.Id);
     }
 }
コード例 #31
0
        public void TestPrototype()
        {
            IOwner owner       = new Owner("Vlad", "Demyanov", "Ruslanovich", DateTime.Now, "GH92OL88II99PP");
            IOwner clonedOwner = owner.Clone();

            Console.WriteLine("оригинал: " + owner.GetInfo());
            Console.WriteLine("клон: " + clonedOwner.GetInfo());
        }
コード例 #32
0
ファイル: AirCraftAI.cs プロジェクト: AndreasStier/shellcore
 public void Init(Craft craft, IOwner owner = null)
 {
     this.owner = owner;
     this.craft = craft;
     movement   = new AIMovement(this);
     movement.SetMoveTarget(craft.transform.position);
     abilityControl = new AIAbilityController(this);
 }
コード例 #33
0
 public static bool CanRead(System.Security.Principal.IPrincipal user, IAccessControl accessControl, IOwner entity)
 {
     if (MatchUser(user, entity))
         return true;
     else if (accessControl != null)
         return MatchPermissions(user, accessControl.ReadPermissions);
     else
         return true;
 }
コード例 #34
0
ファイル: ProjectRepository.cs プロジェクト: farean/FARonR
        public IList<IProject> GetProjectsbyAdministrator(IOwner owner)
        {
            if (owner == null)
                return null;

            var listprojects = projects.Where(p => p.Owners.Any(o => o.ID == owner.ID)).ToList();

            return (IList<IProject>)listprojects;
        }
コード例 #35
0
ファイル: OwnedItem.cs プロジェクト: gilind/workshop
        public virtual void Remove()
        {
            if (_owner != null)
            {
                _owner.RemoveItem(this);
            }

            _owner = null;

            if (Removed != null)
            {
                Removed(this, EventArgs.Empty);
            }
        }
コード例 #36
0
ファイル: Dimmer.cs プロジェクト: budude/animatroller
        public virtual void SetBrightness(double value, IOwner owner)
        {
            if (this.owner != null && owner != this.owner)
            {
                if (owner != null)
                {
                    if (owner.Priority <= this.owner.Priority)
                        return;
                }
                else
                    return;
            }

            this.owner = owner;
            this.Brightness = value;
        }
コード例 #37
0
 /// <summary>
 /// Recursively retrieve all users under that team and add their emails
 /// </summary>
 /// <param name="parent"></param>
 /// <param name="buf"></param>
 private void GetAllTeamMemberEmails(IOwner parent, StringBuilder buf)
 {
     foreach (IOwnerJoin join in Sage.SalesLogix.Owner.Rules.GetTeamMembers(parent))
     {
         if (join.Child.Type == OwnerType.User)
         {
             String email = join.Child.User.UserInfo.Email;
             if (!String.IsNullOrEmpty(email))
             {
                 if (buf.Length != 0)
                     buf.Append(", ");
                 buf.Append(email);
             }
         }
         else
         {
             GetAllTeamMemberEmails(join.Child, buf);
         }
     }
 }
コード例 #38
0
		public ItemPaintArgs(IOwner owner, System.Windows.Forms.Control control, System.Drawing.Graphics g, ColorScheme scheme)
		{
			this.Graphics=g;
			this.Colors=scheme;
			this.ContainerControl=control;
			this.Owner=owner;
            if(control!=null)
                this.RightToLeft = (control.RightToLeft == System.Windows.Forms.RightToLeft.Yes);
            if (control is MenuPanel || this.ContainerControl is ItemsListBox)
                this.IsOnMenu = true;
            else if (control is Bar && ((Bar)control).MenuBar)
                this.IsOnMenuBar = true;
            else if (control is Bar && ((Bar)control).BarState == eBarState.Popup)
                this.IsOnPopupBar = true;
            else if (control is RibbonBar)
                this.IsOnRibbonBar = true;
            else if (control is NavigationBar)
                this.IsOnNavigationBar = true;
            if(control!=null)
			    this.Font=control.Font;
			CreateStringFormat();
		}
コード例 #39
0
ファイル: Pixel1D.cs プロジェクト: HakanL/animatroller
 public void ReleaseOwner()
 {
     this.owner = null;
 }
コード例 #40
0
		internal static void RegisterOwnerParentMsgHandler(IOwner owner, Form parentForm)
		{
			if(m_MdiChildParentHandlers.Contains(parentForm))
			{
				ParentMsgHandler handler=m_MdiChildParentHandlers[parentForm] as ParentMsgHandler;
				if(!handler.IsOwnerRegistered(owner))
					handler.RegisterOwner(owner);
			}
			else
			{
				ParentMsgHandler handler=new ParentMsgHandler(true);
				handler.AssignHandle(parentForm.Handle);
				handler.RegisterOwner(owner);
				m_MdiChildParentHandlers[parentForm]=handler;
			}
		}
コード例 #41
0
 ///// <summary>
 ///// Gets the list of all CommandLinks objects associated with this manager.
 ///// </summary>
 //internal ArrayList CommandLinks
 //{
 //    get { return m_CommandLinks; }
 //}
 internal static bool IsManagerRegistered(IOwner manager, Form parentForm)
 {
     if (m_MdiChildParentHandlers.Contains(parentForm))
     {
         ParentMsgHandler handler = m_MdiChildParentHandlers[parentForm] as ParentMsgHandler;
         return handler.IsRegistered(manager);
     }
     return false;
 }
コード例 #42
0
ファイル: GamePlay.cs プロジェクト: iivchenko/SandBox
 public GamePlay(IOwner<IGameComponent> owner)
 {
     _owner = owner;
 }
コード例 #43
0
		internal static void UnRegisterOwnerParentMsgHandler(IOwner owner,Form parentForm)
		{
			if(parentForm==null)
				return;

			if(m_MdiChildParentHandlers.Contains(parentForm))
			{
				ParentMsgHandler handler=m_MdiChildParentHandlers[parentForm] as ParentMsgHandler;
				if(handler.IsOwnerRegistered(owner))
				{
					handler.UnregisterOwner(owner);
					if(handler.RegisteredCount==0 && handler.RegisteredOwnersCount==0)
					{
						handler.ReleaseHandle();
						m_MdiChildParentHandlers.Remove(parentForm);
					}
					return;
				}
			}
			else
			{
				foreach(DictionaryEntry item in m_MdiChildParentHandlers)
				{
					ParentMsgHandler handler=item.Value as ParentMsgHandler;
					if(handler.IsOwnerRegistered(owner))
					{
						handler.UnregisterOwner(owner);
						if(handler.RegisteredCount==0 && handler.RegisteredOwnersCount==0)
						{
							handler.ReleaseHandle();
							m_MdiChildParentHandlers.Remove(parentForm);
						}
						break;
					}
				}
			}
		}
コード例 #44
0
 public static bool MatchUser(System.Security.Principal.IPrincipal user, IOwner entity)
 {
     return entity != null && MatchUser(user, entity.Owner);
 }
コード例 #45
0
		public void UnregisterOwner(IOwner owner)
		{
			m_Owners.Remove(owner);
		}
コード例 #46
0
 private string GetTeamId(IOwner owner)
 {
     return owner.Id.ToString();
 }
コード例 #47
0
 private string GetUserId(IOwner owner)
 {
     return owner.User.Id.ToString();
 }
コード例 #48
0
 /// <summary>
 /// Registers the MetroToolbar or any other DotNetBar container that implements IOwner interface so it can participate in Quick Access Toolbar serialization and customization.
 /// </summary>
 /// <param name="toolbar"></param>
 public void RegisterToolbar(IOwner toolbar)
 {
     if (toolbar == null)
         throw new ArgumentNullException("toolbar parameter cannot be null");
     if (IsToolbarRegistered(toolbar))
         throw new ArgumentException("toolbar is already registered");
     WeakReference toolbarRef = new WeakReference(toolbar);
     _Toolbars.Add(toolbarRef);
 }
コード例 #49
0
ファイル: SinglePixel.cs プロジェクト: HakanL/animatroller
        public void SetColor(Color value, IOwner owner)
        {
            if (this.owner != null && owner != this.owner)
            {
                if (owner != null)
                {
                    if (owner.Priority <= this.owner.Priority)
                        return;
                }
                else
                    return;
            }

            this.owner = owner;
            this.pixelDevice.SetColor(this.position, value);
        }
コード例 #50
0
ファイル: OwnedItem.cs プロジェクト: gilind/workshop
 public void SetOwner(IOwner ownerCollection)
 {
     _owner = ownerCollection;
 }
コード例 #51
0
        /// <summary>
        /// Registers the MetroToolbar or any other DotNetBar container that implements IOwner interface so it can participate in Quick Access Toolbar serialization and customization.
        /// </summary>
        /// <param name="toolbar"></param>
        public void UnregisterToolbar(IOwner toolbar)
        {
            if (toolbar == null)
                throw new ArgumentNullException("toolbar parameter cannot be null");

            foreach (WeakReference toolbarRef in _Toolbars)
            {
                if (toolbarRef.IsAlive && toolbarRef.Target == toolbar)
                {
                    _Toolbars.Remove(toolbarRef);
                    return;
                }
            }
        }
コード例 #52
0
ファイル: VirtualPixel1D.cs プロジェクト: HakanL/animatroller
        public void SetBrightness(double brightness, IControlToken token = null)
        {
            if (brightness == 0)
                // Reset owner
                owner = null;

            for (int i = 0; i < this.brightness.Length; i++)
            {
                this.brightness[i] = brightness;
            }

            RaiseMultiPixelChanged(0, this.brightness.Length);
        }
コード例 #53
0
ファイル: Pixel1D.cs プロジェクト: HakanL/animatroller
        public void SetBrightness(double value, IOwner owner)
        {
            if (value == 0)
                // Reset owner
                owner = null;

            if (this.owner != null && owner != this.owner)
            {
                if (owner != null)
                {
                    if (owner.Priority <= this.owner.Priority)
                        return;
                }
                else
                    return;
            }

            this.owner = owner;
            this.Brightness = value;
        }
コード例 #54
0
 private void RedirectTo(IOwner replaceMember)
 {
     string Id = string.Empty;
     if (replaceMember.Type == OwnerType.User)
     {
         Id = GetUserId(replaceMember);
         Response.Redirect(string.Format("~/{0}.aspx?entityId={1}", "User", Id), false);
     }
     else if (replaceMember.Type == OwnerType.Department)
     {
         Id = GetDepartmentId(replaceMember);
         Response.Redirect(string.Format("~/{0}.aspx?entityId={1}", "Department", Id), false);
     }
     else if (replaceMember.Type == OwnerType.Team)
     {
         Id = GetTeamId(replaceMember);
         Response.Redirect(string.Format("~/{0}.aspx?entityId={1}", "Team", Id), false);
     }
 }
コード例 #55
0
		public bool IsOwnerRegistered(IOwner owner)
		{
			return m_Owners.Contains(owner);
		}
コード例 #56
0
 private string GetDepartmentId(IOwner owner)
 {
     return owner.Id.ToString();
 }
コード例 #57
0
		public bool IsRegistered(IOwner manager)
		{
			return m_Managers.Contains(manager);
		}
コード例 #58
0
ファイル: Receiver.cs プロジェクト: Zerophase/DyMProject
 public Receiver(IMessageDispatcher messageDispatcher, IOwner owner)
 {
     this.messageDispatcher = messageDispatcher;
     this.owner = owner;
 }
コード例 #59
0
 private bool IsToolbarRegistered(IOwner toolbar)
 {
     foreach (WeakReference toolbarRef in _Toolbars)
     {
         if(toolbarRef.IsAlive && toolbarRef.Target == toolbar)
             return true;
     }
     return false;
 }
コード例 #60
0
		public void RegisterOwner(IOwner owner)
		{
			m_Owners.Add(owner);
		}