private void TestAndAddRule(RelativeLayout.LayoutParams lp, bool?value, LayoutRules layoutRule)
 {
     if (value.HasValue && value.Value)
     {
         lp.AddRule(layoutRule);
     }
 }
Exemplo n.º 2
0
 public static void SetRelativeLayoutRule(this View view, Context context, LayoutRules rule, int anchor)
 {
     RelativeLayout.LayoutParams parameters = new RelativeLayout.LayoutParams((RelativeLayout.LayoutParams)view.LayoutParameters);
     parameters.AddRule(rule, anchor);
     view.LayoutParameters = parameters;
     view.RequestLayout();
 }
Exemplo n.º 3
0
        /// <summary>
        /// The execute transaction inner.
        /// </summary>
        /// <param name="solution">
        /// The solution.
        /// </param>
        /// <param name="textControl">
        /// The text control.
        /// </param>
        public override void ExecuteTransactionInner(ISolution solution, ITextControl textControl)
        {
            ITreeNode element         = Utils.GetElementAtCaret(solution, textControl);
            IBlock    containingBlock = element.GetContainingNode <IBlock>(true);

            if (containingBlock != null)
            {
                //// CSharpFormatterHelper.FormatterInstance.Format(containingBlock);
                ICSharpCodeFormatter codeFormatter = (ICSharpCodeFormatter)CSharpLanguage.Instance.LanguageService().CodeFormatter;
                codeFormatter.Format(containingBlock);

                LayoutRules.CurlyBracketsForMultiLineStatementsMustNotShareLine(containingBlock);
            }
            else
            {
                IFieldDeclaration fieldDeclarationNode = element.GetContainingNode <IFieldDeclaration>(true);
                if (fieldDeclarationNode != null)
                {
                    //// CSharpFormatterHelper.FormatterInstance.Format(fieldDeclarationNode);
                    ICSharpCodeFormatter codeFormatter = (ICSharpCodeFormatter)CSharpLanguage.Instance.LanguageService().CodeFormatter;
                    codeFormatter.Format(fieldDeclarationNode);

                    LayoutRules.CurlyBracketsForMultiLineStatementsMustNotShareLine(fieldDeclarationNode);
                }
            }
        }
 private void TestAndAddRule(RelativeLayout.LayoutParams lp, int?anchor, LayoutRules layoutRule)
 {
     if (anchor.HasValue)
     {
         lp.AddRule(layoutRule, anchor.Value);
     }
 }
Exemplo n.º 5
0
 public LayoutController(LayoutRules rules, MerlinReadContext readContext, LayoutService service, MerlinReadStore readStore, LayoutRepository layoutRepository)
 {
     this.rules            = rules;
     this.service          = service;
     this.readContext      = readContext;
     this.readStore        = readStore;
     this.layoutRepository = layoutRepository;
 }
        /// <summary>
        /// Initializes a new instance of the <see cref="LayoutSettingsPage"/>
        /// class.
        /// </summary>
        /// <param name="analyzer">The analyzer.</param>
        /// <exception cref="ArgumentNullException">Thrown if <paramref
        /// name="analyzer"/> is <c>null</c>.</exception>
        public LayoutSettingsPage(LayoutRules analyzer)
        {
            Param.RequireNotNull(analyzer, "analyzer");

            this.InitializeComponent();

            this.dirty = true;
            this.analyzer = analyzer;
        }
Exemplo n.º 7
0
        /// <summary>
        /// Processes all the cleanup.
        /// </summary>
        /// <param name="projectFile">
        /// The project file to clean.
        /// </param>
        /// <param name="file">
        /// The PSI file to clean.
        /// </param>
        /// <param name="fixXmlDocViolations">
        /// Flag to indicate if XML doc stubs should be created
        /// </param>
        private void InternalProcess(IProjectFile projectFile, ICSharpFile file, bool fixXmlDocViolations)
        {
            // Process the file for all the different Code Cleanups we have here
            // we do them in a very specific order. Do not change it.
            Lifetimes.Using(
                lifetime =>
            {
                StyleCopApiPool apiPool = projectFile.GetSolution().GetComponent <StyleCopApiPool>();
                Settings settings       = apiPool.GetInstance(lifetime).Settings.GetSettings(projectFile);

                ReadabilityRules.ExecuteAll(file, settings);
                MaintainabilityRules.ExecuteAll(file, settings);

                if (fixXmlDocViolations)
                {
                    DocumentationRules.ExecuteAll(file, settings);
                }

                LayoutRules.ExecuteAll(file, settings);
                SpacingRules.ExecuteAll(file, settings);
                OrderingRules.ExecuteAll(file, settings);
            });
        }
Exemplo n.º 8
0
 public LayoutRule(LayoutRules verb, int?subject = default)
 {
     Verb    = verb;
     Subject = subject;
 }
 private void TestAndAddRule(RelativeLayout.LayoutParams lp, bool? value, LayoutRules layoutRule)
 {
     if (value.HasValue && value.Value) lp.AddRule(layoutRule);
 }
Exemplo n.º 10
0
 private void TestAndAddRule(RelativeLayout.LayoutParams lp, int? anchor, LayoutRules layoutRule)
 {
     if (anchor.HasValue) lp.AddRule(layoutRule, anchor.Value);
 }
Exemplo n.º 11
0
        public GUILayerItem(Point origin, Size dimensions)
        {
            enabled = true;
            visible = true;
            this.origin = origin;
            this.dimensions = dimensions;
            layoutRules = new LayoutRules();
            layoutRules.XAxisPositionRule = LayoutRules.Positioning.Absolute;
            layoutRules.XAxisPositionValueType = LayoutRules.ValueType.Pixel;
            layoutRules.XAxisPositionValue = origin.X;
            layoutRules.YAxisPositionRule = LayoutRules.Positioning.Absolute;
            layoutRules.YAxisPositionValueType = LayoutRules.ValueType.Pixel;
            layoutRules.YAxisPositionValue = origin.Y;

            int xDist = dimensions.Width / 2;
            int yDist = dimensions.Height / 2;
            center = new Point(origin.X + xDist, origin.Y + yDist);
            radius = (int)Math.Sqrt((xDist * xDist) + (yDist * yDist));
        }