예제 #1
0
        public PortableRuntimeSelectorDialog(TargetFramework initialTarget)
        {
            this.Title = GettextCatalog.GetString("Change Targets");

            this.AddActionWidget(new Button(Stock.Cancel), ResponseType.Cancel);
            this.AddActionWidget(new Button(Stock.Ok), ResponseType.Ok);
            this.ActionArea.ShowAll();

            this.TargetFramework = initialTarget;

            // Aggregate all SupportedFrameworks from .NETPortable TargetFrameworks
            targetFrameworks = GetPortableTargetFrameworks().ToList();
            targetFrameworks.Sort(CompareFrameworks);
            supportedFrameworks = new SortedDictionary <string, List <SupportedFramework> > ();

            if (!targetFrameworks.Contains(TargetFramework))
            {
                missingFramework = TargetFramework;
                targetFrameworks.Insert(0, TargetFramework);
            }

            foreach (var fx in targetFrameworks)
            {
                foreach (var sfx in fx.SupportedFrameworks)
                {
                    List <SupportedFramework> list;

                    if (!supportedFrameworks.TryGetValue(sfx.DisplayName, out list))
                    {
                        list = new List <SupportedFramework> ();
                        supportedFrameworks.Add(sfx.DisplayName, list);
                    }

                    list.Add(sfx);
                }
            }

            // Now create a list of config options from our supported frameworks
            options = new List <OptionCombo> ();
            foreach (var fx in supportedFrameworks)
            {
                var combo = new OptionCombo(fx.Key);

                var dict = new SortedDictionary <string, OptionComboItem> ();
                foreach (var sfx in fx.Value)
                {
                    var label = GetDisplayName(sfx);

                    OptionComboItem item;
                    if (!dict.TryGetValue(label, out item))
                    {
                        item = new OptionComboItem(label, sfx);
                        dict.Add(label, item);
                    }
                }

                combo.Items = dict.Values.ToList();

                options.Add(combo);
            }

            CreateUI();

            CurrentProfileChanged(TargetFramework);
        }
		public PortableRuntimeOptionsPanelWidget (DotNetProject project, IEnumerable<ItemConfiguration> configurations)
		{
			this.target = project.TargetFramework;
			this.project = project;
			this.Build ();

			// Aggregate all SupportedFrameworks from .NETPortable TargetFrameworks
			targetFrameworks = GetPortableTargetFrameworks ().ToList ();
			targetFrameworks.Sort (CompareFrameworks);
			supportedFrameworks = new SortedDictionary<string, List<SupportedFramework>> ();

			if (!targetFrameworks.Contains (project.TargetFramework)) {
				missingFramework = project.TargetFramework;
				targetFrameworks.Insert (0, project.TargetFramework);
			}

			foreach (var fx in targetFrameworks) {
				foreach (var sfx in fx.SupportedFrameworks) {
					List<SupportedFramework> list;
					
					if (!supportedFrameworks.TryGetValue (sfx.DisplayName, out list)) {
						list = new List<SupportedFramework> ();
						supportedFrameworks.Add (sfx.DisplayName, list);
					}
					
					list.Add (sfx);
				}
			}

			// Now create a list of config options from our supported frameworks
			options = new List<OptionCombo> ();
			foreach (var fx in supportedFrameworks) {
				var combo = new OptionCombo (fx.Key);

				var dict = new SortedDictionary<string, OptionComboItem> ();
				foreach (var sfx in fx.Value) {
					var label = GetDisplayName (sfx);

					OptionComboItem item;
					if (!dict.TryGetValue (label, out item)) {
						item = new OptionComboItem (label, sfx);
						dict.Add (label, item);
					}

					item.Targets.Add (sfx.TargetFramework);
				}

				combo.Items = dict.Values.ToList ();

				options.Add (combo);
			}

			CreateUI ();

			CurrentProfileChanged (project.TargetFramework);
		}
예제 #3
0
        public PortableRuntimeOptionsPanelWidget(DotNetProject project, IEnumerable <ItemConfiguration> configurations)
        {
            this.target  = project.TargetFramework;
            this.project = project;
            this.Build();

            // Aggregate all SupportedFrameworks from .NETPortable TargetFrameworks
            targetFrameworks = GetPortableTargetFrameworks().ToList();
            targetFrameworks.Sort(CompareFrameworks);
            supportedFrameworks = new SortedDictionary <string, List <SupportedFramework> > ();

            if (!targetFrameworks.Contains(project.TargetFramework))
            {
                missingFramework = project.TargetFramework;
                targetFrameworks.Insert(0, project.TargetFramework);
            }

            foreach (var fx in targetFrameworks)
            {
                foreach (var sfx in fx.SupportedFrameworks)
                {
                    List <SupportedFramework> list;

                    if (!supportedFrameworks.TryGetValue(sfx.DisplayName, out list))
                    {
                        list = new List <SupportedFramework> ();
                        supportedFrameworks.Add(sfx.DisplayName, list);
                    }

                    list.Add(sfx);
                }
            }

            // Now create a list of config options from our supported frameworks
            options = new List <OptionCombo> ();
            foreach (var fx in supportedFrameworks)
            {
                var combo = new OptionCombo(fx.Key);

                var dict = new SortedDictionary <string, OptionComboItem> ();
                foreach (var sfx in fx.Value)
                {
                    var label = GetDisplayName(sfx);

                    OptionComboItem item;
                    if (!dict.TryGetValue(label, out item))
                    {
                        item = new OptionComboItem(label, sfx);
                        dict.Add(label, item);
                    }

                    item.Targets.Add(sfx.TargetFramework);
                }

                combo.Items = dict.Values.ToList();

                options.Add(combo);
            }

            CreateUI();

            CurrentProfileChanged(project.TargetFramework);
        }
		public PortableRuntimeSelectorDialog (TargetFramework initialTarget)
		{
			this.Title = GettextCatalog.GetString ("Change Targets");

			this.AddActionWidget (new Button (Stock.Cancel), ResponseType.Cancel);
			this.AddActionWidget (new Button (Stock.Ok), ResponseType.Ok);
			this.ActionArea.ShowAll ();

			this.TargetFramework = initialTarget;

			// Aggregate all SupportedFrameworks from .NETPortable TargetFrameworks
			targetFrameworks = GetPortableTargetFrameworks ().ToList ();
			targetFrameworks.Sort (CompareFrameworks);
			supportedFrameworks = new SortedDictionary<string, List<SupportedFramework>> ();

			if (!targetFrameworks.Contains (TargetFramework)) {
				missingFramework = TargetFramework;
				targetFrameworks.Insert (0, TargetFramework);
			}

			foreach (var fx in targetFrameworks) {
				foreach (var sfx in fx.SupportedFrameworks) {
					List<SupportedFramework> list;

					if (!supportedFrameworks.TryGetValue (sfx.DisplayName, out list)) {
						list = new List<SupportedFramework> ();
						supportedFrameworks.Add (sfx.DisplayName, list);
					}

					list.Add (sfx);
				}
			}

			// Now create a list of config options from our supported frameworks
			options = new List<OptionCombo> ();
			foreach (var fx in supportedFrameworks) {
				var combo = new OptionCombo (fx.Key);

				var dict = new SortedDictionary<string, OptionComboItem> ();
				foreach (var sfx in fx.Value) {
					var label = GetDisplayName (sfx);

					OptionComboItem item;
					if (!dict.TryGetValue (label, out item)) {
						item = new OptionComboItem (label, sfx);
						dict.Add (label, item);
					}

					item.Targets.Add (sfx.TargetFramework);
				}

				combo.Items = dict.Values.ToList ();

				options.Add (combo);
			}

			CreateUI ();

			CurrentProfileChanged (TargetFramework);
		}