public ApplyingOptions(FormConfiguration conf)
        {
            InitializeComponent();

            if (conf.Lang == DeLauncherForm.Language.Rus)
            {
                DonwloadMessage1.Text = "Идёт применение настроек";
                DonwloadMessage2.Text = "Пожалуйста ждите";
            }
        }
Exemple #2
0
        public FormConfiguration GetFormConfig(string FormName)
        {
            FormConfiguration formConfig = null;

            if (FormName.IsNotNullOrEmpty())
            {
                formConfig          = DynamicFormRepository.GetFormConfig(FormName);
                formConfig.Controls = DynamicFormRepository.GetFormControls(FormName);
            }
            return(formConfig);
        }
        public SamsaraFormController(SamsaraForm frmSamsara)
        {
            this.frmSamsara = frmSamsara;

            FormConfigurationParameters pmtFormConfiguration = new FormConfigurationParameters();

            this.srvFormConfiguration = SamsaraAppContext.Resolve <IFormConfigurationService>();

            pmtFormConfiguration.FormName = this.frmSamsara.Name;
            this.FormConfiguration        = this.srvFormConfiguration.GetByParameters(pmtFormConfiguration);
        }
Exemple #4
0
        public static IHtmlString FormActionNoNavBar(this HtmlHelper html, FormConfiguration formConfiguration, TagBuilder container)
        {
            var dropDown = html.FormActions(formConfiguration, container);

            //var containerFluid = html.FormActionNavbarInnerHtml(dropDown, formConfiguration);

            var navBar = FormActionNavbar(formConfiguration);

            navBar.InnerHtml += dropDown;

            return(new HtmlString(navBar.ToString()));
        }
Exemple #5
0
        void ConfigureFormBuilder(FormBuilder <WineForm> builder)
        {
            FormConfiguration buildConfig = builder.Configuration;

            buildConfig.Yes = "Yes;y;sure;ok;yep;1;good".SplitList();

            TemplateAttribute tmplAttr = buildConfig.Template(TemplateUsage.EnumSelectOne);

            tmplAttr.Patterns = new[] { "What {&} would you like? {||}" };

            buildConfig.Commands[FormCommand.Quit].Help =
                "Quit: Quit the form without completing it. " +
                "Warning - this will clear your previous choices!";
        }
        private void mConfiguration_Click(object sender, EventArgs e)
        {
            foreach (Form form in Application.OpenForms)
            {
                if (form.GetType() == typeof(FormConfiguration))
                {
                    form.Activate();
                    return;
                }
            }

            FormConfiguration child = new FormConfiguration();

            child.Show();
        }
 private void 系统配置ToolStripMenuItem_Click(object sender, EventArgs e)
 {
     //using (FormInputAndAction fiaa = new FormInputAndAction(
     //    str => UserClient.Net_simplify_client.ReadFromServer(
     //        CommonHeadCode.SimplifyHeadCode.上传分厂, str).IsSuccess,
     //    JArray.FromObject(UserClient.SystemFactories).ToString(),
     //    "请按照JSON格式更新分厂信息,然后提交:"))
     //{
     //    fiaa.ShowDialog();
     //}
     using (FormConfiguration fc = new FormConfiguration())
     {
         fc.ShowDialog();
     }
 }
 private static FormFieldViewModel GetFormFieldViewModel(FormConfiguration formConfiguration,
                                                         IEnumerable <FormReferenceData> formReferenceData, Form form)
 {
     return(new FormFieldViewModel
     {
         Code = formConfiguration.FormField.Code,
         ControlType = formConfiguration.ControlType.Code,
         Id = formConfiguration.FormFieldId,
         Label = formConfiguration.FormField.Label,
         Columns = 12,
         Order = formConfiguration.Order,
         ParentForBranching = GetBranchingViewModels(formConfiguration.FormFieldId, form),
         ReferenceDataViewModels =
             GetFormFieldReferenceDataViewModels(formConfiguration.FormFieldId, formReferenceData)
     });
 }
Exemple #9
0
 public PageHelper(IViewRender viewRender, IElementHelper elementHelper, IDistributedCacheWrapper distributedCache,
                   IOptions <FormConfiguration> disallowedKeys, IWebHostEnvironment enviroment, ICache cache,
                   IOptions <DistributedCacheExpirationConfiguration> distributedCacheExpirationConfiguration,
                   IEnumerable <IPaymentProvider> paymentProviders, ISessionHelper sessionHelper, IHttpContextAccessor httpContextAccessor)
 {
     _viewRender       = viewRender;
     _elementHelper    = elementHelper;
     _distributedCache = distributedCache;
     _disallowedKeys   = disallowedKeys.Value;
     _environment      = enviroment;
     _cache            = cache;
     _distributedCacheExpirationConfiguration = distributedCacheExpirationConfiguration.Value;
     _paymentProviders    = paymentProviders;
     _sessionHelper       = sessionHelper;
     _httpContextAccessor = httpContextAccessor;
 }
        private void mConfiguration_ItemClick(object sender, ItemClickEventArgs e)
        {
            foreach (Form form in Application.OpenForms)
            {
                if (form.GetType() == typeof(FormConfiguration))
                {
                    form.Activate();
                    return;
                }
            }
            FormConfiguration child = new FormConfiguration()
            {
                Padding = new Padding(0), MdiParent = this
            };

            child.Show();
            OpenWaitForm();
        }
Exemple #11
0
 public PageHelper(IViewRender viewRender, IElementHelper elementHelper,
                   IDistributedCacheWrapper distributedCache,
                   IOptions <FormConfiguration> disallowedKeys,
                   IWebHostEnvironment enviroment,
                   IOptions <DistributedCacheExpirationConfiguration> distributedCacheExpirationConfiguration,
                   ISessionHelper sessionHelper,
                   IEnumerable <IFileStorageProvider> fileStorageProviders,
                   IConfiguration configuration)
 {
     _viewRender           = viewRender;
     _elementHelper        = elementHelper;
     _distributedCache     = distributedCache;
     _fileStorageProviders = fileStorageProviders;
     _disallowedKeys       = disallowedKeys.Value;
     _environment          = enviroment;
     _distributedCacheExpirationConfiguration = distributedCacheExpirationConfiguration.Value;
     _sessionHelper = sessionHelper;
     _configuration = configuration;
 }
 /// <summary>
 /// New method to show the configuration form
 /// </summary>
 /// <param name="sender">Sender</param>
 /// <param name="e">EventArgs</param>
 private void apptCalendar_ConfigurationButtonClicked(object sender, EventArgs e)
 {
     using (FormConfiguration cfg = new FormConfiguration())
     {
         if (cfg.ShowDialog() == DialogResult.OK)
         {
             this.NumDays                  = cfg.NumDays;
             this.MailAlertsEnabled        = cfg.MailAlertsEnabled;
             this.ShowPastAppointments     = cfg.ShowPastAppointments;
             this.Accounts                 = cfg.Accounts;
             this.ShowFriendlyGroupHeaders = cfg.ShowFriendlyGroupHeaders;
             this.ShowDayNames             = cfg.ShowDayNames;
             this.ShowWeekNumbers          = cfg.ShowWeekNumbers;
             this.ShowTasks                = cfg.ShowTasks;
             this.ShowCompletedTasks       = cfg.ShowCompletedTasks;
             this.FirstDayOfWeek           = cfg.FirstDayOfWeek;
             this.RetrieveData();
         }
     }
 }
Exemple #13
0
 /// <summary>
 /// Constructor based on <see cref="IField{T}"/>.
 /// </summary>
 /// <param name="field">Field with enumerated values.</param>
 /// <param name="configuration">Form configuration to use for choice and no preference.</param>
 public RecognizeEnumeration(IField <T> field, FormConfiguration configuration = null)
 {
     if (configuration == null)
     {
         configuration = field.Form.Configuration;
     }
     _form                = field.Form;
     _allowNumbers        = field.AllowNumbers;
     _description         = field.FieldDescription;
     _terms               = field.FieldTerms.ToArray();
     _values              = field.Values.ToArray();
     _valueDescriptions   = field.ValueDescriptions.ToArray();
     _descriptionDelegate = (value) => field.ValueDescription(value);
     _termsDelegate       = (value) => field.Terms(value);
     _helpFormat          = field.Template(field.AllowNumbers
         ? (field.AllowsMultiple ? TemplateUsage.EnumManyNumberHelp : TemplateUsage.EnumOneNumberHelp)
         : (field.AllowsMultiple ? TemplateUsage.EnumManyWordHelp : TemplateUsage.EnumOneWordHelp));
     _noPreference  = field.Optional ? configuration.NoPreference : null;
     _currentChoice = configuration.CurrentChoice.FirstOrDefault();
     BuildPerValueMatcher(configuration.CurrentChoice);
 }
Exemple #14
0
 /// <summary>
 /// Show options dialog.
 /// </summary>
 /// <remarks>
 /// Currently the <paramref name="strCurrentOptions"/> parameter will be ignored.
 /// </remarks>
 /// <param name="strCurrentOptions">Seems to be the Keepass profile name</param>
 /// <returns></returns>
 public override string GetOptions(string strCurrentOptions)
 {
     try
     {
         InitWuerfelwareFileReaderIfNecessary();
         var persistence = new ConfigurationPersistence();
         var config      = persistence.LoadFromUserFile();
         if (null == config)
         {
             config = new ConfigurationModel();
         }
         var form = new FormConfiguration(config);
         form.setData(WuerfelwareFileReader.FilePath, WuerfelwareFileReader.EntryCount);
         form.ShowDialog();
         persistence.SaveToUserFile(form.Configuration);
     }
     catch (Exception e)
     {
         MessageBox.Show("Error while loading or saving properties.\n\nError message: '" + e.Message + "'\n\nError details: " + e.ToString());
     }
     return(base.GetOptions(strCurrentOptions));
 }
Exemple #15
0
 /// <summary>
 /// Constructor using <see cref="IField{T}"/>.
 /// </summary>
 /// <param name="field">Field to build recognizer for.</param>
 /// <param name="configuration">Form configuration to use for choice and no preference.</param>
 public RecognizePrimitive(IField <T> field, FormConfiguration configuration = null)
 {
     if (configuration == null)
     {
         configuration = field.Form.Configuration;
     }
     _field          = field;
     _currentChoices = new HashSet <string>(from choice in field.Form.Configuration.CurrentChoice
                                            select choice.Trim().ToLower());
     if (field.Optional)
     {
         if (field.IsNullable)
         {
             _noPreference = new HashSet <string>(from choice in field.Form.Configuration.NoPreference
                                                  select choice.Trim().ToLower());
         }
         else
         {
             throw new ArgumentException("Primitive values must be nullable to be optional.");
         }
     }
 }
Exemple #16
0
        public Options(FormConfiguration cfg, LaunchOptions opt, ImageHandler rep)
        {
            InitializeComponent();
            configuration = cfg;
            options       = opt;
            repos         = rep;

            SetButtonsImages();

            if (configuration.Lang == DeLauncherForm.Language.Rus)
            {
                SetRus();
            }
            else
            {
                SetEng();
            }

            SetOptions();
            SetButtonsBindings();
            GetSound1();
        }
Exemple #17
0
        protected override void OnInitializeLayout(InitializeLayoutEventArgs e)
        {
            base.OnInitializeLayout(e);

            e.Layout.Override.SummaryFooterCaptionVisible = DefaultableBoolean.False;

            FormConfiguration formConfiguration = null;

            if (this.DataSource != null)
            {
                IList <string> lstCustomControlNames = new List <string>();
                this.GetCustomControlsNames(this.Parent, lstCustomControlNames);
                string parentFormName = lstCustomControlNames.Last();
                lstCustomControlNames.Remove(parentFormName);
                string schemeName = null;

                if (parentFormName != null && parentFormName.Contains("Form"))
                {
                    Form form = this.GetForm(this.Parent);
                    schemeName = form.GetType().Namespace.Split('.')[1];

                    if (typeof(IConfigurableForm).IsAssignableFrom(form.GetType()))
                    {
                        IConfigurableForm configurableForm = form as IConfigurableForm;

                        formConfiguration = configurableForm.FormConfiguration;
                    }
                    else
                    {
                        FormConfigurationParameters pmtFormConfiguration = new FormConfigurationParameters();
                        pmtFormConfiguration.FormName = parentFormName;
                        formConfiguration             = srvFormConfiguration.GetByParameters(pmtFormConfiguration);
                    }
                }
                else
                {
                    return;
                }

                if (formConfiguration == null)
                {
                    SchemeParameters pmtScheme = new SchemeParameters();
                    pmtScheme.Name = schemeName;

                    Scheme scheme = this.srvScheme.GetByParameters(pmtScheme);

                    formConfiguration          = new FormConfiguration();
                    formConfiguration.FormName = parentFormName;
                    formConfiguration.Scheme   = scheme;
                    srvFormConfiguration.SaveOrUpdate(formConfiguration);
                }

                string gridName = (lstCustomControlNames.Count == 0 ? "" :
                                   string.Join(".", lstCustomControlNames.Reverse().ToArray()) + ".") + this.Name;

                FormConfigurationGrid formGrid = formConfiguration.FormConfigurationGrids
                                                 .SingleOrDefault(x => x.GridName == gridName);

                if (formGrid == null)
                {
                    FormConfigurationGridParameters pmtFormConfigurationGrid = new FormConfigurationGridParameters();
                    pmtFormConfigurationGrid.GridName            = gridName;
                    pmtFormConfigurationGrid.FormConfigurationId = formConfiguration.FormConfigurationId;
                    formGrid = srvFormConfigurationGrid.GetByParameters(pmtFormConfigurationGrid);
                }

                if (formGrid == null)
                {
                    formGrid                     = new FormConfigurationGrid();
                    formGrid.GridName            = gridName;
                    formGrid.IgnoreConfiguration = false;
                    formGrid.FormConfiguration   = formConfiguration;
                    srvFormConfigurationGrid.SaveOrUpdate(formGrid);
                }

                if (formGrid.IgnoreConfiguration)
                {
                    return;
                }

                foreach (UltraGridBand band in this.DisplayLayout.Bands)
                {
                    foreach (UltraGridColumn column in band.Columns)
                    {
                        FormConfigurationGridColumn formGridColumn = null;

                        if (formGrid.FormConfigurationGridColumns != null)
                        {
                            formGridColumn = formGrid
                                             .FormConfigurationGridColumns.SingleOrDefault(x => x.ColumnName == column.Key &&
                                                                                           (x.BandKey == null || x.BandKey == band.Key));
                        }

                        if (formGridColumn == null)
                        {
                            formGridColumn = new FormConfigurationGridColumn();
                            formGrid.FormConfigurationGridColumns.Add(formGridColumn);
                            formGridColumn.ColumnName            = column.Key;
                            formGridColumn.ColumnEndUserName     = column.Key;
                            formGridColumn.FormConfigurationGrid = formGrid;
                            formGridColumn.Visible = false;
                            formGridColumn.BandKey = band.Key;
                            srvFormConfigurationGridColumn.SaveOrUpdate(formGridColumn);
                        }
                    }
                }

                IList <string> lstOrderedColumnNames = formGrid.FormConfigurationGridColumns
                                                       .OrderBy(x => x.FormConfigurationGridColumnId).Select(x => x.ColumnName).ToList();

                foreach (UltraGridBand band in this.DisplayLayout.Bands)
                {
                    int index = 0;
                    foreach (UltraGridColumn column in band.Columns.Cast <UltraGridColumn>()
                             .OrderBy(x => lstOrderedColumnNames.IndexOf(x.Key)))
                    {
                        FormConfigurationGridColumn gridColumnConfiguration = formGrid
                                                                              .FormConfigurationGridColumns.Single(x => x.ColumnName == column.Key &&
                                                                                                                   (x.BandKey == null || x.BandKey == band.Key));

                        column.Hidden                 = !gridColumnConfiguration.Visible && !formGrid.IgnoreConfiguration;
                        column.Header.Caption         = gridColumnConfiguration.ColumnEndUserName;
                        column.Header.VisiblePosition = index++;

                        if (gridColumnConfiguration.TextFormat != null)
                        {
                            WindowsFormsUtil.SetUltraColumnFormat(column, gridColumnConfiguration.TextFormat);
                        }
                        if (gridColumnConfiguration.Width.HasValue)
                        {
                            column.Width = gridColumnConfiguration.Width.Value;
                        }
                    }

                    //band.SummaryFooterCaption = "Sumatorias";
                }
            }
        }
Exemple #18
0
 public IScoringOutcomeMethod Get(FormConfiguration formConfiguration)
 {
     return(this.defaultScoringOutcomeMethod);
 }
Exemple #19
0
        protected override void OnInitializeLayout(InitializeLayoutEventArgs e)
        {
            base.OnInitializeLayout(e);
            e.Layout.Override.SummaryFooterCaptionVisible = DefaultableBoolean.False;

            Assert.IsNotNull(this.srvFormConfiguration);
            Assert.IsNotNull(this.srvGridConfiguration);
            Assert.IsNotNull(this.srvGridColumnConfiguration);

            FormConfiguration formConfiguration = null;

            if (this.DataSource != null && this.DataSource is DataTable)
            {
                string parentFormName = this.GetParentFormName(this.Parent);

                if (parentFormName != null)
                {
                    FormConfigurationParameters pmtFormConfiguration = new FormConfigurationParameters();
                    pmtFormConfiguration.FormName = parentFormName;
                    formConfiguration             = srvFormConfiguration.GetByParameters(pmtFormConfiguration);
                }
                else
                {
                    return;
                }

                if (formConfiguration == null)
                {
                    formConfiguration          = new FormConfiguration();
                    formConfiguration.FormName = parentFormName;
                    srvFormConfiguration.SaveOrUpdate(formConfiguration);
                }

                GridConfigurationParameters pmtGridConfiguration = new GridConfigurationParameters();
                pmtGridConfiguration.GridName            = this.Name;
                pmtGridConfiguration.FormConfigurationId = formConfiguration.FormConfigurationId;
                GridConfiguration gridConfiguration = srvGridConfiguration.GetByParameters(pmtGridConfiguration);

                if (gridConfiguration == null)
                {
                    gridConfiguration                     = new GridConfiguration();
                    gridConfiguration.GridName            = this.Name;
                    gridConfiguration.IgnoreConfiguration = false;
                    gridConfiguration.FormConfiguration   = formConfiguration;
                    srvGridConfiguration.SaveOrUpdate(gridConfiguration);
                }

                if (gridConfiguration.IgnoreConfiguration)
                {
                    return;
                }

                foreach (UltraGridBand band in this.DisplayLayout.Bands)
                {
                    foreach (UltraGridColumn column in band.Columns)
                    {
                        GridColumnConfiguration gridColumnConfiguration = null;

                        if (gridConfiguration.GridColumnConfigurations != null)
                        {
                            gridColumnConfiguration = gridConfiguration
                                                      .GridColumnConfigurations.SingleOrDefault(x => x.ColumnName == column.Key &&
                                                                                                x.Band == band.Index);
                        }

                        if (gridColumnConfiguration == null)
                        {
                            gridColumnConfiguration = new GridColumnConfiguration();
                            gridConfiguration.GridColumnConfigurations.Add(gridColumnConfiguration);
                            gridColumnConfiguration.ColumnName        = column.Key;
                            gridColumnConfiguration.ColumnEndUserName = column.Key;
                            gridColumnConfiguration.GridConfiguration = gridConfiguration;
                            gridColumnConfiguration.Visible           = false;
                            gridColumnConfiguration.Band = band.Index;
                            srvGridColumnConfiguration.SaveOrUpdate(gridColumnConfiguration);
                        }
                    }
                }

                IList <string> lstOrderedColumnNames = gridConfiguration.GridColumnConfigurations
                                                       .OrderBy(x => x.GridColumnConfigurationId).Select(x => x.ColumnName).ToList();

                foreach (UltraGridBand band in this.DisplayLayout.Bands)
                {
                    int index = 0;
                    foreach (UltraGridColumn column in band.Columns.Cast <UltraGridColumn>()
                             .OrderBy(x => lstOrderedColumnNames.IndexOf(x.Key)))
                    {
                        GridColumnConfiguration gridColumnConfiguration = gridConfiguration
                                                                          .GridColumnConfigurations.Single(x => x.ColumnName == column.Key &&
                                                                                                           x.Band == band.Index);

                        column.Hidden                 = !gridColumnConfiguration.Visible && !gridConfiguration.IgnoreConfiguration;
                        column.Header.Caption         = gridColumnConfiguration.ColumnEndUserName;
                        column.Header.VisiblePosition = index++;
                    }

                    //band.SummaryFooterCaption = "Sumatorias";
                }
            }
        }
Exemple #20
0
        private static void ArgumnentsAhead(string[] args)
        {
            LogAttrbute.log.Info("There are top level argument has been caught to read it");
            switch (args[0])
            {
                case "-h":
                    LogAttrbute.log.Info("top level argument for help, showing help");
                    Console.WriteLine(
            @"Top level Arguments:-
             -h                              Show help
             -s                              Settings
             -c                              Check for updates
             -v                              Version
             -l                              License

            Settings:-
             --r                             Release directory setting

              ---add[directory name]         Add release directory location
              ---remove [directory name]     Remove exist directory form release directory list
              ---show                        Show All release directories from the list
              ---clear                       Clear all release directories list

             --e                             Exclude list settings:-

              ---add[filename]               Add file to be excluded from packaging
              ---remove [filename]           Remove exist exclude from the database to be included to the list
              ---show                        Show All exclude files list
              ---clear                       Clear all exclude file list

             --g                             Show GUI setting

             --log [true|false]              Enable Logging

             --clear	                     Clear all settings

            License arguments
              --g   Show graphical user interface window"
            );
                    break;

                case "-v":
                    LogAttrbute.log.Info("Top level argument for getting version, getting version");
                    Console.WriteLine("Packager v" + typeof(Program).Assembly.GetName().Version.ToString());
                    break;

                case "-l":
                    LogAttrbute.log.Info("Top level argument for getting license of the project");
                    if (args.Length < 2)
                    {
                        LogAttrbute.log.Info("License getting from LICENSE file");
                        FileInfo lic = new FileInfo("LICENSE");
                        LogAttrbute.log.Info("Checking if the license file is available or not");
                        if (!lic.Exists)
                        {
                            LogAttrbute.log.Info("License file not found, showing warning message");
                            Console.WriteLine("Warning :License not found, you can view it at http://www.gnu.org/licenses/gpl-3.0.en.html");
                            LogAttrbute.log.Info("Exit application with file not found existing for LICENSE file");
                            return;
                        }
                        LogAttrbute.log.Info("File founded and now using read only stream file");
                        StreamReader strmreader = new StreamReader(lic.OpenRead());
                        LogAttrbute.log.Info("Writing a little bit big output for LICENSE file");
                        Console.WriteLine(strmreader.ReadToEnd());
                        LogAttrbute.log.Info("Writing output completed");
                        LogAttrbute.log.Info("Exit application");

                        return;
                    }

                    LogAttrbute.log.Info("Second level argument for checking argument");
                    switch (args[1])
                    {
                        case "--g":
                            LogAttrbute.log.Info("Argument is getting gui window for showing license");
                            var s = new Packager.License();
                            LogAttrbute.log.Info("Showing license window..");
                            s.ShowDialog();
                            LogAttrbute.log.Info("The user closed the window");
                            break;

                        default:
                            LogAttrbute.log.Info("The input arg is invalid , showing Error message");
                            Console.Error.WriteLine("Argument unknown, please type -h for argument list");
                            break;
                    }
                    break;

                case "-c":
                    LogAttrbute.log.Info("Top level arg for checking for update on the GitHub repo");
                    LogAttrbute.log.Info("Calling managed code...");
                    if (!CheckNet())
                    {
                        LogAttrbute.log.Info("No connection to the Internet, or Internet is unavailable, because CheckNet() call  InternetGetConnectedState(out desc, 0); for if there is Internet and returned that there are no Internet access");
                        Console.Error.WriteLine("Please check your Internet connection in order to check the update. Or Go to https://github.com/AlkindiX/packager/releases");

                        return;
                    }
                    LogAttrbute.log.Info("There are an Internet connection, processing to the update checker...");
                    LogAttrbute.log.Info("Preparing GitHubClient from OctaKit using GitHub API");
                    GitHubClient clinet = new GitHubClient(new ProductHeaderValue("packager"));
                    LogAttrbute.log.Info("Preparing to invoke for all releases from GitHub release from project packager repo by the creator of the progrma AlkindiX ");
                    var release = clinet.Release.GetAll("AlkindiX", "packager");
                    Release re = null;
                    LogAttrbute.log.Info("The release checking is invoked, now waiting for result form GitHub...");
                    Console.WriteLine("Checking for update...");
                    release.Wait();
                    LogAttrbute.log.Info("Result getting successfully");
                    foreach (var item in release.Result)
                    {
                        LogAttrbute.log.Info("Getting the latest release at the top of the list and break the loop");
                        re = item;
                        break;
                    }
                    Console.WriteLine("The current release of packager is {0} released at {1}, you can download it at \n{2}", re.TagName, re.PublishedAt.ToString(), re.HtmlUrl);
                    Console.WriteLine("Change log:- \n{0}", re.Body);
                    LogAttrbute.log.Info("Invoking GetAllRelease for getting files inside the release");
                    var ass = clinet.Release.GetAllAssets("AlkindiX", "packager", re.Id);
                    Console.WriteLine("Reading files on the current update...");
                    ass.Wait();
                    LogAttrbute.log.Info("Checking if dir updates is exist");
                    DirectoryInfo updatedir = new DirectoryInfo("updates");
                    if (!updatedir.Exists)
                    {
                        LogAttrbute.log.Info("Creating update dir");
                        updatedir.Create();
                    }
                    LogAttrbute.log.Info("Create version file");
                    DirectoryInfo tagdir = new DirectoryInfo(Path.Combine(updatedir.FullName, re.TagName));
                    if (!tagdir.Exists)
                    {
                        tagdir.Create();
                    }
                    LogAttrbute.log.Info("Begin perform download operation");
                    int x = 0;
                    foreach (var item in ass.Result)
                    {
                        x++;
                        Console.WriteLine("{0} {1}", x.ToString(), item.Name);
                        Console.WriteLine("Downloading {0}", item.Name);
                        WebClient clin = new WebClient();
                        var file_full_path = Path.Combine(tagdir.FullName, item.Name);
                        if (File.Exists(file_full_path))
                        {
                            Console.WriteLine("Warning: The release is already exist {0}", file_full_path);
                            File.Delete(file_full_path);
                        }
                        clin.DownloadFile(item.BrowserDownloadUrl, file_full_path);
                        Console.WriteLine("Downloading complete at {0}", file_full_path);
                    }
                    LogAttrbute.log.Info("End download operation");

                    break;

                case "-s":
                    if (args.Length < 2)
                    {
                        Console.Error.WriteLine("Arguments are missing, type -h for argument list");

                        return;
                    }
                    switch (args[1])
                    {
                        case "--log":
                            LogAttrbute.log.Info("Second level for setting the logging value");
                            if (args.Length < 3)
                            {
                                LogAttrbute.log.LogFast(Common.Logging.Logging.LogFastInfo.Error, "Missing argument for logging value");
                                Console.Error.WriteLine("Missing argument for enable logging");
                                return;
                            }
                            try
                            {
                                switch (bool.Parse(args[2]))
                                {
                                    case true:
                                        LogAttrbute.log.Info("Logging is enabled");
                                        Settings.Default.EnableLog = true;
                                        Console.WriteLine("Logging is enabled");
                                        break;

                                    case false:
                                        LogAttrbute.log.Info("Logging is disabled");
                                        Settings.Default.EnableLog = false;
                                        Console.WriteLine("Logging is disabled");
                                        break;
                                }
                            }
                            catch (FormatException fx)
                            {
                                LogAttrbute.log.LogFast(Common.Logging.Logging.LogFastInfo.Exception, fx.ToString());
                                Console.Error.WriteLine("The format given is invalid");
                            }
                            break;

                        case "--clear":
                            Console.WriteLine("Reseting data...");
                            Settings.Default.Reset();
                            Console.WriteLine("All data cleared");
                            break;

                        case "--g":
                            System.Windows.Forms.Application.EnableVisualStyles();
                            FormConfiguration config = new FormConfiguration();
                            config.ShowDialog();
                            break;

                        case "--r":
                            if (args.Length < 3)
                            {
                                Console.WriteLine("Missing arguments, please type -h for more information");

                                return;
                            }
                            switch (args[2])
                            {
                                case "---add":
                                    if (args.Length < 4)
                                    {
                                        Console.Error.WriteLine("Missing argument, please enter the directory name to be added");
                                    }
                                    try
                                    {
                                        DirectoryInfo info = new DirectoryInfo(args[3]);
                                        if (!info.Exists)
                                        {
                                            Console.Error.WriteLine("The directory is not founded");

                                            return;
                                        }
                                        if (Settings.Default.ReleaseLocation.Contains(info.FullName))
                                        {
                                            Console.Error.WriteLine("The directory is already added to the release location list");

                                            return;
                                        }
                                        Settings.Default.ReleaseLocation.Add(info.FullName);
                                        Console.WriteLine("The directory name \"" + info.FullName + "has been added to the release location list");
                                    }
                                    catch (Exception ex)
                                    {
                                        Console.Error.WriteLine(ex.Message);
                                    }
                                    break;

                                case "---rm":
                                    if (args.Length < 4)
                                    {
                                        Console.Error.WriteLine("Missing argument, please enter the directory name to be removed");

                                        return;
                                    }
                                    try
                                    {
                                        DirectoryInfo info = new DirectoryInfo(args[3]);
                                        if (!Settings.Default.ReleaseLocation.Contains(info.FullName))
                                        {
                                            Console.Error.WriteLine("The directory you have entered is not on the release directory database");

                                            return;
                                        }
                                        Settings.Default.ReleaseLocation.Remove(info.FullName);
                                        Console.WriteLine("The directory name \"" + info.FullName + "has been removed from the release location list");
                                    }
                                    catch (Exception ex)
                                    {
                                        Console.Error.WriteLine(ex.Message);
                                    }
                                    break;

                                case "---show":
                                    foreach (var item in Settings.Default.ReleaseLocation)
                                    {
                                        Console.WriteLine(item);
                                    }
                                    break;

                                case "---clear":
                                    Settings.Default.ReleaseLocation.Clear();
                                    break;

                                default:
                                    Console.WriteLine("Missing arguments, please enter -h for argument list");
                                    break;
                            }
                            break;

                        case "--e":
                            if (args.Length < 3)
                            {
                                Console.WriteLine("Missing arguments, type -h for argument list");

                                return;
                            }
                            switch (args[2])
                            {
                                case "---add":
                                    if (args.Length < 4)
                                    {
                                        Console.WriteLine("You didn't write the file to be exclude");
                                    }
                                    else
                                    {
                                        if (!Settings.Default.ExcludeFileList.Contains(args[3]))
                                        {
                                            Settings.Default.ExcludeFileList.Add(args[3]);
                                            Console.WriteLine("The filename: \"" + args[3] + "\" Added to the exclude list");
                                        }
                                        else
                                        {
                                            Console.WriteLine("The filename: \"" + args[3] + "\" is already included in the exclude list");
                                        }
                                    }
                                    break;

                                case "---rm":
                                    if (args.Length < 4)
                                    {
                                        Console.WriteLine("You didn't write the file to be include");
                                    }
                                    else
                                    {
                                        if (!Settings.Default.ExcludeFileList.Contains(args[3]))
                                        {
                                            Console.Error.WriteLine("File is not found in the list");
                                        }
                                        else
                                        {
                                            Settings.Default.ExcludeFileList.Remove(args[3]);
                                            Console.WriteLine("The filename: \"" + args[3] + "\" removed from the exclude list");
                                        }
                                    }
                                    break;

                                case "---show":
                                    if (Settings.Default.ExcludeFileList.Count == 0)
                                    {
                                        Console.WriteLine("The list is empty");
                                    }
                                    foreach (var item in Settings.Default.ExcludeFileList)
                                    {
                                        Console.WriteLine(item);
                                    }
                                    break;

                                case "---clear":

                                    if (Settings.Default.ExcludeFileList.Count == 0)
                                    {
                                        Console.WriteLine("The list is empty and nothing to be cleared");
                                    }
                                    Settings.Default.ExcludeFileList.Clear();
                                    break;

                                default:
                                    Console.Error.WriteLine("Unknown arguments, -h for argument list");
                                    break;
                            }
                            break;

                        default:
                            Console.WriteLine("Unknown argument, type -h for argument list");
                            break;
                    }
                    break;

                default:
                    Console.Error.WriteLine("Argument is invalid, type -h for more informations");
                    break;
            }
        }
Exemple #21
0
 /// <summary>
 /// Construct a date/time recognizer.
 /// </summary>
 /// <param name="field">DateTime field.</param>
 /// <param name="culture">Culture to use for parsing.</param>
 /// <param name="configuration">Form configuration to use for choice and no preference.</param>
 public RecognizeDateTime(IField <T> field, CultureInfo culture, FormConfiguration configuration = null)
     : base(field, configuration)
 {
     _culture = culture;
     // _parser = new Chronic.Parser();
 }
Exemple #22
0
 /// <summary>
 /// Construct a double or float recognizer for a field.
 /// </summary>
 /// <param name="field">Float or double field.</param>
 /// <param name="culture">Culture to use for parsing.</param>
 /// <param name="configuration">Form configuration to use for choice and no preference.</param>
 public RecognizeDouble(IField <T> field, CultureInfo culture, FormConfiguration configuration = null)
     : base(field, configuration)
 {
     _culture    = culture;
     _showLimits = field.Limits(out _min, out _max);
 }
Exemple #23
0
 /// <summary>
 /// Construct a string recognizer for a field.
 /// </summary>
 /// <param name="field">String field.</param>
 /// <param name="configuration">Form configuration to use for choice and no preference.</param>
 public RecognizeString(IField <T> field, FormConfiguration configuration = null)
     : base(field, configuration)
 {
 }
Exemple #24
0
        public static TagBuilder FormActions(this HtmlHelper html, FormConfiguration formConfiguration, TagBuilder container)
        {
            var deleteActionLink                       = formConfiguration.DeleteActionLink;
            var closeCaseActionLink                    = formConfiguration.CloseIncidentActionLink;
            var resolveCaseActionLink                  = formConfiguration.ResolveCaseActionLink;
            var reopenCaseActionLink                   = formConfiguration.ReopenCaseActionLink;
            var cancelCaseActionLink                   = formConfiguration.CancelCaseActionLink;
            var qualifyLeadActionLink                  = formConfiguration.QualifyLeadActionLink;
            var convertQuoteActionLink                 = formConfiguration.ConvertQuoteToOrderActionLink;
            var convertOrderActionLink                 = formConfiguration.ConvertOrderToInvoiceActionLink;
            var calculateOpportunityActionLink         = formConfiguration.CalculateOpportunityActionLink;
            var deactivateActionLink                   = formConfiguration.DeactivateActionLink;
            var activateActionLink                     = formConfiguration.ActivateActionLink;
            var activateQuoteActionLink                = formConfiguration.ActivateQuoteActionLink;
            var opportunityOnHoldActionLink            = formConfiguration.SetOpportunityOnHoldActionLink;
            var reopenOpportunityActionLink            = formConfiguration.ReopenOpportunityActionLink;
            var winOpportunityActionLink               = formConfiguration.WinOpportunityActionLink;
            var loseOpportunityActionLink              = formConfiguration.LoseOpportunityActionLink;
            var generateQuoteFromOpportunityActionLink = formConfiguration.GenerateQuoteFromOpportunityActionLink;
            var updatePipelinePhaseAction              = formConfiguration.UpdatePipelinePhaseActionLink;
            var createRelatedRecordAction              = formConfiguration.CreateRelatedRecordActionLink;

            DisassociateActionLink disassociateAction = null;
            WorkflowActionLink     firstWorkflow      = null;


            List <string> actionLinks = new List <string> {
            };

            foreach (var action in formConfiguration.TopFormActionLinks)
            {
                if (action is DeleteActionLink && deleteActionLink.Enabled)
                {
                    var deleteHtml = html.FormActionLinkListItem(deleteActionLink, formConfiguration.ActionButtonStyle ?? ActionButtonStyle.DropDown);
                    actionLinks.Add(deleteHtml.ToString());
                }

                if (action is CloseIncidentActionLink && closeCaseActionLink.Enabled)
                {
                    var closeCaseHtml = html.FormActionLinkListItem(closeCaseActionLink, formConfiguration.ActionButtonStyle ?? ActionButtonStyle.DropDown);
                    actionLinks.Add(closeCaseHtml.ToString());
                }

                if (action is ResolveCaseActionLink && resolveCaseActionLink.Enabled)
                {
                    var resolveCaseHtml = html.FormActionLinkListItem(resolveCaseActionLink, formConfiguration.ActionButtonStyle ?? ActionButtonStyle.DropDown);
                    actionLinks.Add(resolveCaseHtml.ToString());
                }

                if (action is ReopenCaseActionLink && reopenCaseActionLink.Enabled)
                {
                    var reopenCaseHtml = html.FormActionLinkListItem(reopenCaseActionLink, formConfiguration.ActionButtonStyle ?? ActionButtonStyle.DropDown);
                    actionLinks.Add(reopenCaseHtml.ToString());
                }

                if (action is CancelCaseActionLink && cancelCaseActionLink.Enabled)
                {
                    var cancelCaseHtml = html.FormActionLinkListItem(cancelCaseActionLink, formConfiguration.ActionButtonStyle ?? ActionButtonStyle.DropDown);
                    actionLinks.Add(cancelCaseHtml.ToString());
                }

                if (action is QualifyLeadActionLink && qualifyLeadActionLink.Enabled)
                {
                    var qualifyLeadHtml = html.FormActionLinkListItem(qualifyLeadActionLink, formConfiguration.ActionButtonStyle ?? ActionButtonStyle.DropDown);
                    actionLinks.Add(qualifyLeadHtml.ToString());
                }

                if (action is ConvertQuoteToOrderActionLink && convertQuoteActionLink.Enabled)
                {
                    var convertQuoteActionHtml = html.FormActionLinkListItem(convertQuoteActionLink, formConfiguration.ActionButtonStyle ?? ActionButtonStyle.DropDown);
                    actionLinks.Add(convertQuoteActionHtml.ToString());
                }

                if (action is ConvertOrderToInvoiceActionLink && convertOrderActionLink.Enabled)
                {
                    var convertOrderHtml = html.FormActionLinkListItem(convertOrderActionLink, formConfiguration.ActionButtonStyle ?? ActionButtonStyle.DropDown);
                    actionLinks.Add(convertOrderHtml.ToString());
                }

                if (action is CalculateOpportunityActionLink && calculateOpportunityActionLink.Enabled)
                {
                    var calculateOpportunityHtml = html.FormActionLinkListItem(calculateOpportunityActionLink, formConfiguration.ActionButtonStyle ?? ActionButtonStyle.DropDown);
                    actionLinks.Add(calculateOpportunityHtml.ToString());
                }

                if (action is DeactivateActionLink && deactivateActionLink.Enabled)
                {
                    var deactivateHtml = html.FormActionLinkListItem(deactivateActionLink, formConfiguration.ActionButtonStyle ?? ActionButtonStyle.DropDown);
                    actionLinks.Add(deactivateHtml.ToString());
                }

                if (action is ActivateActionLink && activateActionLink.Enabled)
                {
                    var activateHtml = html.FormActionLinkListItem(activateActionLink, formConfiguration.ActionButtonStyle ?? ActionButtonStyle.DropDown);
                    actionLinks.Add(activateHtml.ToString());
                }

                if (action is ActivateQuoteActionLink && activateQuoteActionLink.Enabled)
                {
                    var activateQuoteHtml = html.FormActionLinkListItem(activateQuoteActionLink, formConfiguration.ActionButtonStyle ?? ActionButtonStyle.DropDown);
                    actionLinks.Add(activateQuoteHtml.ToString());
                }

                if (action is SetOpportunityOnHoldActionLink && opportunityOnHoldActionLink.Enabled)
                {
                    var setOpportunityOnHoldHtml = html.FormActionLinkListItem(opportunityOnHoldActionLink, formConfiguration.ActionButtonStyle ?? ActionButtonStyle.DropDown);
                    actionLinks.Add(setOpportunityOnHoldHtml.ToString());
                }

                if (action is ReopenOpportunityActionLink && reopenOpportunityActionLink.Enabled)
                {
                    var reopenOpportunityHtml = html.FormActionLinkListItem(reopenOpportunityActionLink, formConfiguration.ActionButtonStyle ?? ActionButtonStyle.DropDown);
                    actionLinks.Add(reopenOpportunityHtml.ToString());
                }

                if (action is WinOpportunityActionLink && winOpportunityActionLink.Enabled)
                {
                    var winOpportunityHtml = html.FormActionLinkListItem(winOpportunityActionLink, formConfiguration.ActionButtonStyle ?? ActionButtonStyle.DropDown);
                    actionLinks.Add(winOpportunityHtml.ToString());
                }

                if (action is LoseOpportunityActionLink && loseOpportunityActionLink.Enabled)
                {
                    var resolveCaseHtml = html.FormActionLinkListItem(loseOpportunityActionLink, formConfiguration.ActionButtonStyle ?? ActionButtonStyle.DropDown);
                    actionLinks.Add(resolveCaseHtml.ToString());
                }

                if (action is GenerateQuoteFromOpportunityActionLink && generateQuoteFromOpportunityActionLink.Enabled)
                {
                    var generateQuoteFromOpportunityHtml = html.FormActionLinkListItem(generateQuoteFromOpportunityActionLink, formConfiguration.ActionButtonStyle ?? ActionButtonStyle.DropDown);
                    actionLinks.Add(generateQuoteFromOpportunityHtml.ToString());
                }

                if (action is UpdatePipelinePhaseActionLink && updatePipelinePhaseAction.Enabled)
                {
                    var updatePipelinePhaseHtml = html.FormActionLinkListItem(updatePipelinePhaseAction, formConfiguration.ActionButtonStyle ?? ActionButtonStyle.DropDown);
                    actionLinks.Add(updatePipelinePhaseHtml.ToString());
                }

                if (action is WorkflowActionLink && action.Enabled)
                {
                    var workflowHtml = html.FormActionLinkListItem(action as WorkflowActionLink, formConfiguration.ActionButtonStyle ?? ActionButtonStyle.DropDown);
                    actionLinks.Add(workflowHtml.ToString());

                    firstWorkflow = action as WorkflowActionLink;
                }

                if (action is DisassociateActionLink && action.Enabled)
                {
                    disassociateAction = action as DisassociateActionLink;
                    var disassociateHtml = html.FormActionLinkListItem(disassociateAction,
                                                                       formConfiguration.ActionButtonStyle ?? ActionButtonStyle.DropDown);
                    actionLinks.Add(disassociateHtml.ToString());
                }

                if (action is CreateRelatedRecordActionLink && action.Enabled)
                {
                    var createRelatedRecordHtml = html.FormActionLinkListItem(createRelatedRecordAction,
                                                                              formConfiguration.ActionButtonStyle ?? ActionButtonStyle.DropDown);
                    actionLinks.Add(createRelatedRecordHtml.ToString());
                }
            }

            if (formConfiguration.ActionButtonStyle == ActionButtonStyle.ButtonGroup)
            {
                foreach (var link in actionLinks)
                {
                    container.InnerHtml += link;
                }
            }
            else             //if (formConfiguration.ActionButtonStyle == ActionButtonStyle.DropDown)
            {
                //Create the links  as a dropdownmenu
                var dropDownMenu = html.FormActionDropDownMenu();

                foreach (var link in actionLinks)
                {
                    dropDownMenu.InnerHtml += link;
                }

                //the meat of the dropdown
                var dropDown = html.FormActionDropDown(formConfiguration);

                //add the items to the dropdown
                dropDown.InnerHtml += dropDownMenu.ToString();

                //add the dropdown to the container
                container.InnerHtml += dropDown;
            }

            html.ActionModalWindows(container, deleteActionLink, qualifyLeadActionLink, closeCaseActionLink, resolveCaseActionLink, reopenCaseActionLink,
                                    cancelCaseActionLink, convertQuoteActionLink, convertOrderActionLink, calculateOpportunityActionLink, deactivateActionLink,
                                    activateActionLink, activateQuoteActionLink, opportunityOnHoldActionLink, reopenOpportunityActionLink, winOpportunityActionLink,
                                    loseOpportunityActionLink, generateQuoteFromOpportunityActionLink, updatePipelinePhaseAction, firstWorkflow, disassociateAction, createRelatedRecordAction);

            return(container);
        }