当前位置: 首页>>代码示例>>C#>>正文


C# Stetic类代码示例

本文整理汇总了C#中Stetic的典型用法代码示例。如果您正苦于以下问题:C# Stetic类的具体用法?C# Stetic怎么用?C# Stetic使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


Stetic类属于命名空间,在下文中一共展示了Stetic类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: CecilPropertyDescriptor

		public CecilPropertyDescriptor (CecilWidgetLibrary lib, XmlElement elem, Stetic.ItemGroup group, Stetic.ClassDescriptor klass, PropertyDefinition pinfo): base (elem, group, klass)
		{
			string tname;
			
			if (pinfo != null) {
				name = pinfo.Name;
				tname = pinfo.PropertyType.FullName;
				canWrite = pinfo.SetMethod != null;
			}
			else {
				name = elem.GetAttribute ("name");
				tname = elem.GetAttribute ("type");
				canWrite = elem.Attributes ["canWrite"] == null;
			}
			
			Load (elem);
			
			type = Stetic.Registry.GetType (tname, false);
			
			if (type == null) {
				Console.WriteLine ("Could not find type: " + tname);
				type = typeof(string);
			}
			if (type.IsValueType)
				initialValue = Activator.CreateInstance (type);
				
			// Consider all properties runtime-properties, since they have been created
			// from class properties.
			isRuntimeProperty = true;
			
			if (pinfo != null)
				SaveCecilXml (elem);
		}
开发者ID:Kalnor,项目名称:monodevelop,代码行数:33,代码来源:CecilPropertyDescriptor.cs

示例2: GuiBuilderWindow

		internal GuiBuilderWindow (GuiBuilderProject fproject, Stetic.Project gproject, Stetic.WidgetInfo rootWidget)
		{
			this.fproject = fproject;
			this.rootWidget = rootWidget;
			this.gproject = gproject;
			name = rootWidget.Name;
			gproject.ProjectReloaded += OnProjectReloaded;
			rootWidget.Changed += OnChanged;
		}
开发者ID:riverans,项目名称:monodevelop,代码行数:9,代码来源:GuiBuilderWindow.cs

示例3: CodeBinder

		public CodeBinder (Project project, ITextFileProvider textFileProvider, Stetic.Component targetObject)
		{
			this.project = project;
			this.textFileProvider = textFileProvider;

			gproject = GtkDesignInfo.FromProject (project).GuiBuilderProject;

			TargetObject = targetObject;
		}
开发者ID:Tak,项目名称:monodevelop-novell,代码行数:9,代码来源:CodeBinder.cs

示例4: EditIconFactoryDialog

		public EditIconFactoryDialog (Gtk.Window parent, Stetic.IProject project, ProjectIconFactory iconFactory)
		{
			this.iconFactory = iconFactory;
			this.parent = parent;
			this.project = project;
			
			Glade.XML xml = new Glade.XML (null, "stetic.glade", "EditIconFactoryDialog", null);
			xml.Autoconnect (this);
			
			customIconList = new ProjectIconList (project, iconFactory);
			iconListScrolledwindow.AddWithViewport (customIconList);
		}
开发者ID:Kalnor,项目名称:monodevelop,代码行数:12,代码来源:EditIconFactoryDialog.cs

示例5: WidgetEditSession

		public WidgetEditSession (ProjectBackend sourceProject, WidgetDesignerFrontend frontend, string windowName, Stetic.ProjectBackend editingBackend, bool autoCommitChanges)
		{
			this.frontend = frontend;
			this.autoCommitChanges = autoCommitChanges;
			undoManager = new ContainerUndoRedoManager ();
			undoQueue = new UndoQueue ();
			undoManager.UndoQueue = undoQueue;
			
			sourceWidget = windowName;
			this.sourceProject = sourceProject;
			
			if (!autoCommitChanges) {
				// Reuse the action groups and icon factory of the main project
				gproject = editingBackend;
				
				// Attach will prevent the destruction of the action group list by gproject
				gproject.AttachActionGroups (sourceProject.ActionGroups);
				
				gproject.IconFactory = sourceProject.IconFactory;
				gproject.FileName = sourceProject.FileName;
				gproject.ImagesRootPath = sourceProject.ImagesRootPath;
				gproject.ResourceProvider = sourceProject.ResourceProvider;
				gproject.WidgetLibraries = (ArrayList) sourceProject.WidgetLibraries.Clone ();
				gproject.InternalWidgetLibraries = (ArrayList) sourceProject.InternalWidgetLibraries.Clone ();
				gproject.TargetGtkVersion = sourceProject.TargetGtkVersion;
				sourceProject.ComponentTypesChanged += OnSourceProjectLibsChanged;
				sourceProject.ProjectReloaded += OnSourceProjectReloaded;
				
				rootWidget = editingBackend.GetTopLevelWrapper (sourceWidget, false);
				if (rootWidget == null) {
					// Copy the widget to edit from the source project
					// When saving the file, this project will be merged with the main project.
					sourceProject.CopyWidgetToProject (windowName, gproject, windowName);
					rootWidget = gproject.GetTopLevelWrapper (windowName, true);
				}
				
				gproject.Modified = false;
			}
			else {
				rootWidget = sourceProject.GetTopLevelWrapper (windowName, true);
				gproject = sourceProject;
			}
			
			rootWidget.Select ();
			undoManager.RootObject = rootWidget;
			
			gproject.ModifiedChanged += new EventHandler (OnModifiedChanged);
			gproject.Changed += new EventHandler (OnChanged);
			gproject.ProjectReloaded += new EventHandler (OnProjectReloaded);
			gproject.ProjectReloading += new EventHandler (OnProjectReloading);
//			gproject.WidgetMemberNameChanged += new Stetic.Wrapper.WidgetNameChangedHandler (OnWidgetNameChanged);
		}
开发者ID:Kalnor,项目名称:monodevelop,代码行数:52,代码来源:WidgetEditSession.cs

示例6: FillWidgets

		void FillWidgets (Stetic.Wrapper.Widget widget, int level)
		{
			if (!widget.Unselectable) {
				TreeIter iter = store.AppendValues (widget.ClassDescriptor.Icon, widget.Wrapped.Name);
				widgets [widget.Wrapped.Name] = iter;
			}
			Gtk.Container cont = widget.Wrapped as Gtk.Container;
			if (cont != null && widget.ClassDescriptor.AllowChildren) {
				foreach (Gtk.Widget child in cont.AllChildren) {
					Stetic.Wrapper.Widget cwidget = Stetic.Wrapper.Widget.Lookup (child);
					if (cwidget != null)
						FillWidgets (cwidget, level+1);
				}
			}
		}
开发者ID:Kalnor,项目名称:monodevelop,代码行数:15,代码来源:WidgetSelector.cs

示例7: DesignerView

        public DesignerView(Stetic.Project project, ProjectItemInfo item)
        {
            this.widget = (WidgetInfo) item;

            // Widget design tab

            design = project.CreateWidgetDesigner (widget, true);

            // Actions design tab

            actionbox = design.CreateActionGroupDesigner ();

            // Designers tab

            AppendPage (design, new Gtk.Label (Catalog.GetString ("Designer")));
            AppendPage (actionbox, new Gtk.Label (Catalog.GetString ("Actions")));
            TabPos = Gtk.PositionType.Bottom;
        }
开发者ID:mono,项目名称:stetic,代码行数:18,代码来源:DesignerView.cs

示例8: BuildContextMenu

		void BuildContextMenu (Stetic.Wrapper.Widget parentWrapper, bool top, Widget context)
		{
			MenuItem item;

			item = new ImageMenuItem (Gtk.Stock.Cut, null);
			if (editable.CanCut)
				item.Activated += DoCut;
			else
				item.Sensitive = false;
			Add (item);

			item = new ImageMenuItem (Gtk.Stock.Copy, null);
			if (editable.CanCopy)
				item.Activated += DoCopy;
			else
				item.Sensitive = false;
			Add (item);

			item = new ImageMenuItem (Gtk.Stock.Paste, null);
			if (editable.CanPaste)
				item.Activated += DoPaste;
			else
				item.Sensitive = false;
			Add (item);

			if (editable.CanDelete) {
				item = new ImageMenuItem (Gtk.Stock.Delete, null);
				item.Activated += DoDelete;
				Add (item);
			}

			if (top) {
				for (; parentWrapper != null; parentWrapper = parentWrapper.ParentWrapper) {
					Add (new SeparatorMenuItem ());

					item = LabelItem (parentWrapper.Wrapped);
					item.Submenu = new ContextMenu (parentWrapper, context);
					Add (item);
				}
			}

			ShowAll ();
		}
开发者ID:Kalnor,项目名称:monodevelop,代码行数:43,代码来源:ContextMenu.cs

示例9: ConfirmWindowDeleteDialog

		public ConfirmWindowDeleteDialog (string windowName, string fileName, Stetic.ProjectItemInfo obj)
		{
			XML glade = new XML (null, "gui.glade", "ConfirmWindowDeleteDialog", null);
			glade.Autoconnect (this);
			
			if (obj is Stetic.WidgetInfo && ((Stetic.WidgetInfo)obj).IsWindow) {
				label.Text = GettextCatalog.GetString ("Are you sure you want to delete the window '{0}'?", windowName);
			} else if (obj is Stetic.WidgetInfo) {
				label.Text = GettextCatalog.GetString ("Are you sure you want to delete the widget '{0}'?", windowName);
			} else if (obj is Stetic.ActionGroupInfo) {
				label.Text = GettextCatalog.GetString ("Are you sure you want to delete the action group '{0}'?", windowName);
			} else
				label.Text = GettextCatalog.GetString ("Are you sure you want to delete '{0}'?", windowName);
			
			if (fileName != null) {
				checkbox.Label = string.Format (checkbox.Label, fileName);
				checkbox.Active = true;
			} else
				checkbox.Hide ();
		}
开发者ID:FreeBSD-DotNet,项目名称:monodevelop,代码行数:20,代码来源:ConfirmWindowDeleteDialog.cs

示例10: Load

		void Load (Stetic.Wrapper.ActionGroup group)
		{
			if (autoCommitChanges) {
				groupCopy = group;
			}
			else {
				actionCopyMap.Clear ();
					
				groupCopy = new Stetic.Wrapper.ActionGroup ();
				groupCopy.Name = group.Name;
				
				foreach (Stetic.Wrapper.Action action in group.Actions) {
					Stetic.Wrapper.Action dupaction = action.Clone ();
					groupCopy.Actions.Add (dupaction);
					actionCopyMap [dupaction] = action;
				}
				groupCopy.SignalAdded += new Stetic.SignalEventHandler (OnSignalAdded);
				groupCopy.SignalChanged += new Stetic.SignalChangedEventHandler (OnSignalChanged);
			}
		}
开发者ID:Kalnor,项目名称:monodevelop,代码行数:20,代码来源:ActionGroupEditSession.cs

示例11: WidgetActionBar

		public WidgetActionBar (WidgetDesignerFrontend frontend, Stetic.Wrapper.Widget rootWidget)
		{
			this.frontend = frontend;
			
			editors = new Hashtable ();
			wrappers = new Hashtable ();
			sensitives = new Hashtable ();
			invisibles = new Hashtable ();
			toggles = new ArrayList ();

			IconSize = IconSize.Menu;
			Orientation = Orientation.Horizontal;
			ToolbarStyle = ToolbarStyle.BothHoriz;

			combo = new WidgetTreeCombo ();
			comboItem = new ToolItem ();
			comboItem.Add (combo);
			comboItem.ShowAll ();
			Insert (comboItem, -1);
			ShowAll ();
			RootWidget = rootWidget;
		}
开发者ID:Kalnor,项目名称:monodevelop,代码行数:22,代码来源:WidgetActionBar.cs

示例12: AddFault

        public static void AddFault(Stetic.Wrapper.Widget owner, object faultId,
					     Gtk.Orientation orientation,
					     int x, int y, int width, int height)
        {
            Gtk.Widget widget = owner.Wrapped;
            if (!widget.IsRealized)
                return;

            Gdk.Window win = NewWindow (widget, Gdk.WindowClass.InputOnly);
            win.MoveResize (x, y, width, height);

            Hashtable widgetFaults = faultGroups[widget] as Hashtable;
            if (widgetFaults == null) {
                faultGroups[widget] = widgetFaults = new Hashtable ();
                widget.Destroyed += FaultWidgetDestroyed;
                widget.DragMotion += FaultDragMotion;
                widget.DragLeave += FaultDragLeave;
                widget.DragDrop += FaultDragDrop;
                widget.DragDataReceived += FaultDragDataReceived;
                DND.DestSet (widget, false);
            }
            widgetFaults[win] = new Fault (owner, faultId, orientation, win);
        }
开发者ID:mono,项目名称:stetic,代码行数:23,代码来源:DND.cs

示例13: ContextMenu

		public ContextMenu (Stetic.Wrapper.Widget wrapper, Gtk.Widget context)
		{
			MenuItem item;

			editable = wrapper;
			widget = wrapper.Wrapped;

			if (widget == context) {
				item = LabelItem (widget);
				item.Sensitive = false;
				Add (item);
			}

			item = new MenuItem (Catalog.GetString ("_Select"));
			item.Activated += DoSelect;
			Add (item);

			ClassDescriptor klass = wrapper.ClassDescriptor;
			if (klass != null) {
				foreach (ItemDescriptor id in klass.ContextMenu) {
					CommandDescriptor cmd = (CommandDescriptor)id;
					if (!cmd.VisibleFor (widget))
						continue;
					item = new MenuItem (cmd.Label);
					if (cmd.Enabled (widget, context)) {
						Gtk.Widget wdup = widget, cdup = context; // FIXME bxc 75689
						item.Activated += delegate (object o, EventArgs args) {
							cmd.Run (wdup, cdup);
						};
					} else
						item.Sensitive = false;
					Add (item);
				}
			}

			BuildContextMenu (wrapper.ParentWrapper, widget == context, context);
		}
开发者ID:Kalnor,项目名称:monodevelop,代码行数:37,代码来源:ContextMenu.cs

示例14: SelectIconDialog

        public SelectIconDialog(Gtk.Window parent, Stetic.IProject project)
        {
            this.parent = parent;
            this.project = project;

            Glade.XML xml = new Glade.XML (null, "stetic.glade", "SelectIconDialog", null);
            xml.Autoconnect (this);

            // Stock icon list

            iconList = new StockIconList ();
            iconList.SelectionChanged += new EventHandler (OnIconSelectionChanged);
            iconScrolledwindow.AddWithViewport (iconList);

            // Custom icon list

            customIconList = new ProjectIconList (project, project.IconFactory);
            customIconList.SelectionChanged += new EventHandler (OnCustomIconSelectionChanged);
            customIconScrolledwindow.AddWithViewport (customIconList);
            dialog.ShowAll ();

            UpdateIconSelection ();
            UpdateButtons ();
        }
开发者ID:mono,项目名称:stetic,代码行数:24,代码来源:SelectIconDialog.cs

示例15: RemoveActionGroup

		public void RemoveActionGroup (Stetic.Wrapper.ActionGroup group)
		{
			ActionGroups.Remove (group);
		}
开发者ID:Kalnor,项目名称:monodevelop,代码行数:4,代码来源:ProjectBackend.cs


注:本文中的Stetic类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。