示例#1
0
 private void SetValue(ResourceFile file)
 {
     if (file != null && file.IsValid)
     {
         if (file != null)
         {
             string text = this.CheckNest(file);
             if (!string.IsNullOrEmpty(text))
             {
                 LogConfig.Output.Error(text, null);
                 return;
             }
             using (CompositeTask.Run(this._propertyItem.DiaplayName))
             {
                 this._propertyItem.SetValue(this._propertyItem.Instance, file, null);
             }
             IPlayControl playControl = this._propertyItem.Instance as IPlayControl;
             if (playControl != null)
             {
                 playControl.Start();
             }
         }
         this.ScenceSetValue();
     }
 }
 private void linkLabel_LeftClicked(object sender, LabelClickedEventArgs e)
 {
     foreach (PropertyDescriptor propertyDescriptor in PropertyGridUtilities.GetPropertyDescriptors(this._propertyItem.Instance))
     {
         if (propertyDescriptor.Name == this._displayName)
         {
             using (CompositeTask.Run(this._propertyItem.DiaplayName))
                 propertyDescriptor.ResetValue(this._propertyItem.Instance);
             this.ScenceSetValue();
             IPlayControl instance = this._propertyItem.Instance as IPlayControl;
             if (instance == null)
             {
                 break;
             }
             instance.Start();
             break;
         }
     }
 }
示例#3
0
        private void fileButton_Clicked(object sender, EventArgs e)
        {
            ResourceFolder rootFolder = Services.ProjectOperations.CurrentResourceGroup.RootFolder;

            string[] array = new string[this._propertyItem.ResourceFilterDescriptor.FileFilter.Length];
            for (int i = 0; i < this._propertyItem.ResourceFilterDescriptor.FileFilter.Length; i++)
            {
                array[i] = "*." + this._propertyItem.ResourceFilterDescriptor.FileFilter[i];
            }
            string[] fileNames = FileChooserDialogModel.GetOpenFilePath(array, LanguageInfo.MessageBox_Content96, false, rootFolder.FullPath).FileNames;
            if (fileNames != null && fileNames.Count <string>() != 0)
            {
                List <ResourceItem> source = Services.ProjectOperations.MessgeDialogImprotResource(rootFolder, fileNames);
                ResourceFile        value  = source.FirstOrDefault <ResourceItem>() as ResourceFile;
                this.SetValue(value);
                IPlayControl playControl = this._propertyItem.Instance as IPlayControl;
                if (playControl != null)
                {
                    playControl.Start();
                }
            }
        }
示例#4
0
        private void linkLabel_LeftClicked(object sender, LabelClickedEventArgs e)
        {
            PropertyDescriptorCollection propertyDescriptors = PropertyGridUtilities.GetPropertyDescriptors(this._propertyItem.Instance);

            foreach (PropertyDescriptor propertyDescriptor in propertyDescriptors)
            {
                if (propertyDescriptor.Name == this._displayName)
                {
                    using (CompositeTask.Run(this._propertyItem.DiaplayName))
                    {
                        propertyDescriptor.ResetValue(this._propertyItem.Instance);
                    }
                    this.ScenceSetValue();
                    IPlayControl playControl = this._propertyItem.Instance as IPlayControl;
                    if (playControl != null)
                    {
                        playControl.Start();
                    }
                    break;
                }
            }
        }
        private void fileButton_Clicked(object sender, EventArgs e)
        {
            ResourceFolder rootFolder = Services.ProjectOperations.CurrentResourceGroup.RootFolder;

            string[] fileTypes = new string[this._propertyItem.ResourceFilterDescriptor.FileFilter.Length];
            for (int index = 0; index < this._propertyItem.ResourceFilterDescriptor.FileFilter.Length; ++index)
            {
                fileTypes[index] = "*." + this._propertyItem.ResourceFilterDescriptor.FileFilter[index];
            }
            string[] fileNames = FileChooserDialogModel.GetOpenFilePath(fileTypes, LanguageInfo.MessageBox_Content96, false, rootFolder.FullPath).FileNames;
            if (fileNames == null || ((IEnumerable <string>)fileNames).Count <string>() == 0)
            {
                return;
            }
            this.SetValue(Services.ProjectOperations.MessgeDialogImprotResource(rootFolder, (IEnumerable <string>)fileNames).FirstOrDefault <ResourceItem>() as ResourceFile);
            IPlayControl instance = this._propertyItem.Instance as IPlayControl;

            if (instance == null)
            {
                return;
            }
            instance.Start();
        }
 private void SetValue(ResourceFile file)
 {
     if (file == null || !file.IsValid)
     {
         return;
     }
     if (file != null)
     {
         string str = this.CheckNest(file);
         if (!string.IsNullOrEmpty(str))
         {
             LogConfig.Output.Error((object)str, (Exception)null);
             return;
         }
         using (CompositeTask.Run(this._propertyItem.DiaplayName))
             this._propertyItem.SetValue(this._propertyItem.Instance, (object)file, (object[])null);
         IPlayControl instance = this._propertyItem.Instance as IPlayControl;
         if (instance != null)
         {
             instance.Start();
         }
     }
     this.ScenceSetValue();
 }