Ejemplo n.º 1
0
        private static TSection GetSection(string aText)
        {
            TSection ret = TSection.ESectionUnsupported;
            //
            Match m = KSectionRegEx.Match(aText);

            if (m.Success)
            {
                string sectionName = m.Groups[0].Value;
                switch (sectionName)
                {
                case ".text":
                    ret = TSection.ESectionText;
                    break;

                case ".emb_text":
                    ret = TSection.ESectionEmbText;
                    break;

                case ".rodata":
                    ret = TSection.ESectionReadOnlyData;
                    break;

                default:
                    break;
                }
            }
            //
            return(ret);
        }
Ejemplo n.º 2
0
        public TSection ReadSection <TSection>() where TSection : ConfigurationSectionBase, new()
        {
            var configSectionAttribute = GetConfigurationSectionAttribute(typeof(TSection));

            var section = ConfigurationManager.GetSection(configSectionAttribute.Name) as TSection;

            if (section == null || !section.ElementInformation.IsPresent)
            {
                section = new TSection();
            }

            return(section);
        }
Ejemplo n.º 3
0
        private void Button_Click(object sender, RoutedEventArgs e)
        {
            ToggleButton btn     = sender as ToggleButton;
            StackPanel   s_panel = VisualHelper.FindParent <StackPanel>(btn);

            IFlowBalanceTI FlowBalanceTI_Frame = VisualHelper.FindParent <IFlowBalanceTI>(s_panel);

            ComboBox        cmbReturnProfile = (ComboBox)((UserControl)FlowBalanceTI_Frame).FindName("cmbReturnProfile");
            DataGridControl GridControl      = (DataGridControl)((UserControl)FlowBalanceTI_Frame).FindName("GridControl");

            TSection _SectionIntegralActs = FlowBalanceTI_Frame.GetSectionAct();

            if (s_panel != null)
            {
                ValuePair <string, TDatePeriod> title_pair = (ValuePair <string, TDatePeriod>)s_panel.DataContext;
                EnumDataSourceType?DataSourceType          = cmbReturnProfile.SelectedValue as EnumDataSourceType?;
                bool     isReadCalculatedValues            = true;
                DateTime dtStart = title_pair.Value.dtStart;

                FlowBalanceTI result = null;

                bool IsAdd = btn.IsChecked.Value;

                if (!IsAdd)
                {
                    result = new FlowBalanceTI()
                    {
                        NumbersValues = Extention.GetNumbersValuesInPeriod(enumTimeDiscreteType.DBHalfHours, dtStart, dtStart.AddMinutes(1410), Manager.Config.SelectedTimeZoneInfo)
                    };
                    ValuesToXceedGrid.UpdateFlowBalanceTIToGrid(GridControl, result, Proryv.AskueARM2.Client.Visual.Common.GlobalDictionary.TGlobalVisualDataRequestObjectsNames.GlobalVisualDataRequestObjectsNames, new ItemSelector(), title_pair, IsAdd);
                }
                else
                {
                    Manager.UI.RunAsync(delegate()
                    {
                        result = ARM_Service.SIA_GetFlowBalanceTI(_SectionIntegralActs.Section_ID, dtStart, dtStart.AddMinutes(1410),
                                                                  DataSourceType, enumTimeDiscreteType.DBHalfHours, EnumUnitDigit.None, isReadCalculatedValues, Manager.Config.TimeZone);
                    }, delegate()
                    {
                        if (result != null)
                        {
                            ValuesToXceedGrid.UpdateFlowBalanceTIToGrid(GridControl, result, Proryv.AskueARM2.Client.Visual.Common.GlobalDictionary.TGlobalVisualDataRequestObjectsNames.GlobalVisualDataRequestObjectsNames, new ItemSelector(), title_pair, IsAdd);
                        }
                    });
                }
            }
        }
Ejemplo n.º 4
0
        /// <summary>
        /// The create fields.
        /// </summary>
        /// <param name="tree">
        /// The tree.
        /// </param>
        /// <param name="section">
        /// The section.
        /// </param>
        private static void CreateFields(TTree tree, TSection section)
        {
            foreach (TField field in section)
              {
            Item item = tree.Database.GetItem(field.ID);

            if (item == null)
            {
              tree.Database.CreateItem(field.ID, field.Name, new TemplateID(TemplateIDs.TemplateField), section.ID);
            }

            item = tree.Database.GetItem(field.ID, Language.Invariant, Version.Latest);

            item.Edit(i => i.Fields[TemplateFieldIDs.Type].Value = field.Type);
            item.Edit(i => i.Fields[TemplateFieldIDs.Shared].Value = field.Shared ? "1" : "0");
            item.Edit(i => i.Fields[TemplateFieldIDs.Unversioned].Value = field.Unversioned ? "1" : "0");
              }
        }
Ejemplo n.º 5
0
        public TSection Get <TSection>() where TSection : class, new()
        {
            IConfigurationSection section = m_configuration.GetSection(typeof(TSection).Name);

            PropertyInfo[] setProperties = typeof(TSection).GetProperties();
            if (setProperties.Length == 0)
            {
                return(default(TSection));
            }

            TSection instance = new TSection();

            foreach (PropertyInfo prop in setProperties)
            {
                string val  = section[prop.Name];
                object conv = Convert.ChangeType(val, prop.PropertyType);
                prop.SetValue(instance, conv);
            }

            return(instance);
        }
Ejemplo n.º 6
0
        public void populateList(string result)
        {
            Dictionary <string, List <string> > dictionary = FormatFunctions.createValuePairs(FormatFunctions.SplitToPairs(result));

            for (int i = 0; i < dictionary["FName"].Count; i++)
            {
                string text = dictionary["FName"][i] ?? "";
                Label  item = new Label
                {
                    Text              = (text ?? ""),
                    VerticalOptions   = LayoutOptions.CenterAndExpand,
                    HorizontalOptions = LayoutOptions.StartAndExpand
                };
                DataSwitch item2 = new DataSwitch(int.Parse(dictionary["IDKey"][i]))
                {
                    VerticalOptions   = LayoutOptions.CenterAndExpand,
                    HorizontalOptions = LayoutOptions.EndAndExpand
                };
                DataSwitch item3 = new DataSwitch(int.Parse(dictionary["IDKey"][i]))
                {
                    VerticalOptions   = LayoutOptions.CenterAndExpand,
                    HorizontalOptions = LayoutOptions.CenterAndExpand
                };
                ViewCell    viewCell    = new ViewCell();
                StackLayout stackLayout = new StackLayout
                {
                    Orientation = StackOrientation.Horizontal
                };
                stackLayout.Children.Add(item);
                stackLayout.Children.Add(item2);
                stackLayout.Children.Add(item3);
                viewCell.View = stackLayout;
                TSection.Add(viewCell);
                Favorites.Add(item2);
                Group.Add(item3);
            }
        }
Ejemplo n.º 7
0
 public List <TRow> GetRows(TSection section)
 {
     return(sectionRows [section]);
 }
Ejemplo n.º 8
0
        public void populateAssessment(string result)
        {
            Dictionary <string, List <string> > dictionary = FormatFunctions.createValuePairs(FormatFunctions.SplitToPairs(result));
            ViewCell vc = new ViewCell();

            StackLayout sl = new StackLayout()
            {
                Orientation = StackOrientation.Vertical
            };
            int Stage = int.Parse(dictionary["Stage"][0]);

            if (Stage < 2)
            {
                SecurityButton l = new SecurityButton(2, new string[] { "Employee" })
                {
                    HorizontalOptions = LayoutOptions.StartAndExpand, Text = "Booking"
                };
                l.Clicked += onClicked;
                sl.Children.Add(l);
                Buttons.Add(l);
            }
            if (Stage < 3)
            {
                SecurityButton l = new SecurityButton(3, new string[] { "Employee" })
                {
                    HorizontalOptions = LayoutOptions.StartAndExpand, Text = "Quote"
                };
                l.Clicked += onClicked;
                sl.Children.Add(l);
                Buttons.Add(l);
            }
            if (Stage < 4)
            {
                SecurityButton l = new SecurityButton(4, new string[] { "Employee" })
                {
                    HorizontalOptions = LayoutOptions.StartAndExpand, Text = "Sale"
                };
                l.Clicked += onClicked;
                sl.Children.Add(l);
                Buttons.Add(l);
                List <string> options = new List <string>()
                {
                    "1", "2", "3", "4", "5"
                };
                QuotePicker.ItemsSource = options;
            }
            if (Stage < 5)
            {
                SecurityButton l = new SecurityButton(5, new string[] { "Employee" })
                {
                    HorizontalOptions = LayoutOptions.StartAndExpand, Text = "Install"
                };
                l.Clicked += onClicked;
                sl.Children.Add(l);
                Buttons.Add(l);
            }
            if (Stage < 6)
            {
                SecurityButton l = new SecurityButton(6, new string[] { "Employee" })
                {
                    HorizontalOptions = LayoutOptions.StartAndExpand, Text = "Installing"
                };
                l.Clicked += onClicked;
                sl.Children.Add(l);
                Buttons.Add(l);
            }
            if (Stage < 7)
            {
                SecurityButton l = new SecurityButton(7, new string[] { "Employee" })
                {
                    HorizontalOptions = LayoutOptions.StartAndExpand, Text = "Quality Assurance"
                };
                l.Clicked += onClicked;
                sl.Children.Add(l);
                Buttons.Add(l);
            }
            if (Stage < 8)
            {
                SecurityButton l = new SecurityButton(8, new string[] { "Employee" })
                {
                    HorizontalOptions = LayoutOptions.StartAndExpand, Text = "Clients"
                };
                l.Clicked += onClicked;
                sl.Children.Add(l);
                Buttons.Add(l);
            }
            if (Stage < 9)
            {
                SecurityButton l = new SecurityButton(9, new string[] { "Employee" })
                {
                    HorizontalOptions = LayoutOptions.StartAndExpand, Text = "Archive"
                };
                l.Clicked += onClicked;
                sl.Children.Add(l);
                Buttons.Add(l);
            }
            vc.View = sl;
            TSection.Add(vc);
        }