Пример #1
0
 /// <summary>
 ///     <para>
 ///       Adds the contents of another <see cref='InputBindingsCollection'/> to the end of the collection.
 ///    </para>
 /// </summary>
 /// <param name='value'>
 ///    A <see cref='InputBindingsCollection'/> containing the objects to add to the collection.
 /// </param>
 /// <returns>
 ///   <para>None.</para>
 /// </returns>
 public void AddRange(InputBindingsCollection value)
 {
     for (int i = 0; (i < value.Count); i = (i + 1))
     {
         this.Add(value[i]);
     }
 }
Пример #2
0
 public void AddRange(InputBindingsCollection value)
 {
     for (int index = 0; index < value.Count; ++index)
     {
         this.Add(value[index]);
     }
 }
Пример #3
0
        protected virtual InputBinding FindChordPattern(InputBindingsCollection list)
        {
            Chord runtimeChord = CreateRuntimeChord();

            for (int i = 0; i < list.Count; i++)
            {
                if (runtimeChord.CompareTo(list[i].Chord) == 0)
                {
                    if (list[i].CommandContext != null)
                    {
                        if (typeof(Control).IsAssignableFrom(list[i].CommandContext.GetType()))
                        {
                            if (!(list[i].CommandContext as Control).Disposing)                              //&&(list[i].CommandContext as Control).FindForm() != null
                            {
                                return(list[i]);
                            }
                        }
                        if (typeof(RadItem).IsAssignableFrom(list[i].CommandContext.GetType()))
                        {
                            return(list[i]);
                        }
                    }
                }
            }
            return(null);
        }
Пример #4
0
        public void RemoveBindingByComponent(IComponent component)
        {
            InputBindingsCollection tempColection = this.GetBindingByComponent(component);

            if (tempColection != null)
            {
                for (int i = 0; i < tempColection.Count; i++)
                {
                    this.Remove(tempColection[i]);
                }
            }
        }
Пример #5
0
        protected virtual InputBinding FindChordPattern(InputBindingsCollection list)
        {
            Chord runtimeChord = this.CreateRuntimeChord();

            for (int index = 0; index < list.Count; ++index)
            {
                if (runtimeChord.CompareTo((object)list[index].Chord) == 0 && list[index].CommandContext != null && (typeof(Control).IsAssignableFrom(list[index].CommandContext.GetType()) && !(list[index].CommandContext as Control).Disposing || typeof(RadItem).IsAssignableFrom(list[index].CommandContext.GetType())))
                {
                    return(list[index]);
                }
            }
            return((InputBinding)null);
        }
Пример #6
0
        public void RemoveBindingByComponent(IComponent component)
        {
            InputBindingsCollection bindingByComponent = this.GetBindingByComponent(component);

            if (bindingByComponent == null)
            {
                return;
            }
            for (int index = 0; index < bindingByComponent.Count; ++index)
            {
                this.Remove(bindingByComponent[index]);
            }
        }
Пример #7
0
        public InputBinding GetCommandBinding(IComponent component)
        {
            InputBindingsCollection bindingByComponent = this.inputBindings.GetBindingByComponent(component);

            if (bindingByComponent != null && bindingByComponent != null)
            {
                int count = bindingByComponent.Count;
            }
            if (bindingByComponent != null && bindingByComponent.Count > 0)
            {
                return(bindingByComponent[0]);
            }
            return((InputBinding)null);
        }
Пример #8
0
        public InputBinding GetCommandBinding(IComponent component)
        {
            InputBindingsCollection collection = this.inputBindings.GetBindingByComponent(component);

            if (collection == null ||
                (collection != null && collection.Count == 0))
            {
                //return new InputBinding();
            }
            if (collection != null && collection.Count > 0)
            {
                return(collection[0]);
            }
            return(null);
        }
Пример #9
0
        public InputBindingsCollection GetBindingByComponent(IComponent component)
        {
            InputBindingsCollection bindingsCollection = new InputBindingsCollection();

            for (int index = 0; index < this.List.Count; ++index)
            {
                IComponent commandContext = ((InputBinding)this.List[index]).CommandContext as IComponent;
                if (commandContext != null && commandContext == component)
                {
                    bindingsCollection.Add((InputBinding)this.List[index]);
                }
            }
            if (bindingsCollection.Count > 0)
            {
                return(bindingsCollection);
            }
            return((InputBindingsCollection)null);
        }
Пример #10
0
        public InputBindingsCollection GetBindingByComponent(IComponent component)
        {
            InputBindingsCollection tempColection = new InputBindingsCollection();

            for (int i = 0; i < List.Count; i++)
            {
                IComponent tempComponent = ((InputBinding)List[i]).CommandContext as IComponent;
                if (tempComponent != null &&
                    (tempComponent == component))
                {
                    tempColection.Add((InputBinding)List[i]);
                }
            }
            if (tempColection.Count > 0)
            {
                return(tempColection);
            }
            return(null);
        }
Пример #11
0
 /// <summary>
 /// Adds commands bindings.
 /// </summary>
 /// <param name="bindings"></param>
 public void AddCommandBindings(InputBindingsCollection bindings)
 {
     //this.commandBindings.AddRange(bindings.ToArray());
     this.inputBindings.AddRange(bindings);
 }
Пример #12
0
        ///// <summary>
        /////     <para>
        /////       Initializes a new instance of <see cref='Telerik.WinControls.InputBindingCollection'/>.
        /////    </para>
        ///// </summary>
        //public InputBindingsCollection(InputBinding owner)
        //{
        //    this.owner = owner;
        //}

        /// <summary>
        ///     <para>
        ///       Initializes a new instance of <see cref='InputBindingsCollection'/> based on another <see cref='InputBindingsCollection'/>.
        ///    </para>
        /// </summary>
        /// <param name='value'>
        ///       A <see cref='InputBindingsCollection'/> from which the contents are copied
        /// </param>
        public InputBindingsCollection(/*InputBinding owner, */ InputBindingsCollection value)
        {
            //this.owner = owner;
            this.AddRange(value);
        }
Пример #13
0
 public InputBindingsCollection(InputBindingsCollection value)
 {
     this.AddRange(value);
 }
Пример #14
0
 public void AddCommandBindings(InputBindingsCollection bindings)
 {
     this.inputBindings.AddRange(bindings);
 }