Exemplo n.º 1
0
 private void assetTypeComboBox_SelectedIndexChanged(object sender, EventArgs e)
 {
     if (!inhibit)
     {
         setAssetType(AssetTypeDesc.AssetTypeEnumFromName(assetTypeComboBox.Text));
     }
 }
Exemplo n.º 2
0
        private void encacheAssetDefinition(out List <string> filesToCopy, out List <string> fileDestinations)
        {
            assetDefinition             = new AssetDefinition();
            assetDefinition.Name        = assetNameTextBox.Text;
            assetDefinition.Description = descriptionTextBox.Text;
            assetDefinition.TypeEnum    = AssetTypeDesc.AssetTypeEnumFromName(assetTypeComboBox.Text);
            assetDefinition.Category    = categoryComboBox.Text;
            assetDefinition.Properties  = savedProperties;
            int fileNumber = 0;

            filesToCopy      = new List <string>();
            fileDestinations = new List <string>();
            foreach (FileDescControls desc in allControls)
            {
                AssetTypeFileDesc d = desc.desc;
                if (desc.useTextBox)
                {
                    if (desc.textBox.Text.Length > 0)
                    {
                        string    s          = desc.textBox.Text.ToString();
                        string    targetFile = MakeDestinationFile(assetDefinition.TypeEnum, s, d.FileTypeEnum, fileNumber);
                        AssetFile file       = new AssetFile(targetFile, d.FileTypeEnum);
                        if (copyFromSource(s))
                        {
                            filesToCopy.Add(s);
                            fileDestinations.Add(file.TargetFile);
                        }
                        assetDefinition.Files.Add(file);
                        fileNumber++;
                    }
                }
                else
                {
                    for (int i = 0; i < desc.listBox.Items.Count; i++)
                    {
                        AssetFile file = new AssetFile();
                        file.FileTypeEnum = d.FileTypeEnum;
                        string s          = desc.listBox.Items[i].ToString();
                        string targetFile = MakeDestinationFile(assetDefinition.TypeEnum, s, d.FileTypeEnum, fileNumber);
                        file.TargetFile = targetFile;
                        if (copyFromSource(s))
                        {
                            filesToCopy.Add(s);
                            fileDestinations.Add(file.TargetFile);
                        }
                        assetDefinition.Files.Add(file);
                        fileNumber++;
                    }
                }
            }
            assetDefinition.ComputeStatus();
        }