示例#1
0
文件: Editor.cs 项目: girish66/REM
        private void InitializeExpander(EditableExpander editableExpander)
        {
            var accessManagerBinding = new Binding();

            accessManagerBinding.Source = this;
            accessManagerBinding.Path   = new PropertyPath(PropertyUtil.ExtractPropertyName(() => AccessControlManager));
            editableExpander.SetBinding(SecureControl.AccessControlManagerProperty, accessManagerBinding);

            if (SaveCommand != null)
            {
                var saveBinding = new Binding();
                saveBinding.Source = this;
                saveBinding.Path   = new PropertyPath(PropertyUtil.ExtractPropertyName(() => SaveCommand));
                editableExpander.SetBinding(EditableExpander.SaveCommandProperty, saveBinding);
            }

            if (CancelCommand != null)
            {
                var cancelBinding = new Binding();
                cancelBinding.Source = this;
                cancelBinding.Path   = new PropertyPath(PropertyUtil.ExtractPropertyName(() => CancelCommand));
                editableExpander.SetBinding(EditableExpander.CancelCommandProperty, cancelBinding);
            }

            if (Expanders.Count() > 1)
            {
                editableExpander.NextCommand = new DelegateCommand <EditableExpander> (ExecuteNextCommand);
            }
        }
示例#2
0
文件: Editor.cs 项目: girish66/REM
        private void ExecuteNextCommand(EditableExpander editableExpander)
        {
            var index     = Expanders.IndexOf(editableExpander);
            var nextIndex = index + 1;

            if (nextIndex == Expanders.Count)
            {
                nextIndex = 0;
            }
            EditableExpander next;

            while ((next = Expanders[nextIndex]) != editableExpander)
            {
                if (next.CanAccess)
                {
                    next.SetAsNextCommand.Execute(null);
                    break;
                }
                nextIndex++;
                if (nextIndex == Expanders.Count)
                {
                    nextIndex = 0;
                }
            }
        }
示例#3
0
文件: Editor.cs 项目: divyang4481/REM
        private void InitializeExpander( EditableExpander editableExpander )
        {
            var accessManagerBinding = new Binding ();
            accessManagerBinding.Source = this;
            accessManagerBinding.Path = new PropertyPath ( PropertyUtil.ExtractPropertyName ( () => AccessControlManager ) );
            editableExpander.SetBinding ( SecureControl.AccessControlManagerProperty, accessManagerBinding );

            if ( SaveCommand != null )
            {
                var saveBinding = new Binding ();
                saveBinding.Source = this;
                saveBinding.Path = new PropertyPath ( PropertyUtil.ExtractPropertyName ( () => SaveCommand ) );
                editableExpander.SetBinding ( EditableExpander.SaveCommandProperty, saveBinding );
            }

            if ( CancelCommand != null )
            {
                var cancelBinding = new Binding ();
                cancelBinding.Source = this;
                cancelBinding.Path = new PropertyPath ( PropertyUtil.ExtractPropertyName ( () => CancelCommand ) );
                editableExpander.SetBinding ( EditableExpander.CancelCommandProperty, cancelBinding );
            }

            if ( Expanders.Count () > 1 )
            {
                editableExpander.NextCommand = new DelegateCommand<EditableExpander> ( ExecuteNextCommand );
            }
        }
示例#4
0
文件: Editor.cs 项目: divyang4481/REM
 private void ExecuteNextCommand( EditableExpander editableExpander )
 {
     var index = Expanders.IndexOf ( editableExpander );
     var nextIndex = index + 1;
     if ( nextIndex == Expanders.Count )
     {
         nextIndex = 0;
     }
     EditableExpander next;
     while ( ( next = Expanders[nextIndex] ) != editableExpander )
     {
         if ( next.CanAccess )
         {
             next.SetAsNextCommand.Execute ( null );
             break;
         }
         nextIndex++;
         if ( nextIndex == Expanders.Count )
         {
             nextIndex = 0;
         }
     }
 }