コード例 #1
0
ファイル: ToolSide.cs プロジェクト: AfonichevDs/FileManager
        public void FillFormatBox()
        {
            FileFormats.Add(EntityClasses.FileFormats.TextFormat);
            FileFormats.Add(EntityClasses.FileFormats.XmlFormat);
            FileFormats.Add(EntityClasses.FileFormats.HtmlFormat);
            FileFormats.Add(EntityClasses.FileFormats.AnyFormat);
            FileFormatBox.ItemsSource = from f in FileFormats
                                        select f.FullName;

            FileFormatBox.SelectedItem      = FileFormatBox.Items.GetItemAt(0);
            FileFormatBox.SelectionChanged += FormatChange;
        }
コード例 #2
0
        /// <summary>
        /// Adds one of the properties to the relevant area.
        /// </summary>
        /// <param name="property"></param>
        /// <param name="operation"></param>
        public bool Add(object property, EImportAction operation)
        {
            try
            {
                switch (property)
                {
                case DexihHubVariable a:
                    HubVariables.Add(a, operation);
                    break;

                case DexihDatajob a:
                    Datajobs.Add(a, operation);
                    break;

                case DexihDatalink a:
                    Datalinks.Add(a, operation);
                    break;

                case DexihConnection a:
                    Connections.Add(a, operation);
                    break;

                case DexihTable a:
                    Tables.Add(a, operation);
                    break;

                case DexihColumnValidation a:
                    ColumnValidations.Add(a, operation);
                    break;

                case DexihCustomFunction a:
                    CustomFunctions.Add(a, operation);
                    break;

                case DexihFileFormat a:
                    FileFormats.Add(a, operation);
                    break;

                case DexihRemoteAgentHub a:
                    RemoteAgentHubs.Add(a, operation);
                    break;

                case DexihDatalinkTest a:
                    DatalinkTests.Add(a, operation);
                    break;

                case DexihView a:
                    Views.Add(a, operation);
                    break;

                case DexihApi a:
                    Apis.Add(a, operation);
                    break;

                case DexihDashboard a:
                    Dashboards.Add(a, operation);
                    break;

                case DexihListOfValues a:
                    ListOfValues.Add(a, operation);
                    break;

                case DexihTag a:
                    Tags.Add(a, operation);
                    break;

                case DexihTagObject a:
                    TagObjects.Add(a, operation);
                    break;

                default:
                    return(false);
                }

                return(true);
            } catch (Exception ex)
            {
                throw new AggregateException($"Failed to add item.  {ex.Message}", ex);
            }
        }