Пример #1
0
        private void clipEntryListBox_DrawItem(object sender, DrawItemEventArgs e)
        {
            e.DrawBackground();

            if ((clipEntryListBox.Items.Count > 0) && (e.Index < clipEntryListBox.Items.Count))
            {
                ClipEntry item = (ClipEntry)clipEntryListBox.Items[e.Index];

                Color textColor  = System.Drawing.SystemColors.ControlText;
                Font  headerFont = new Font(this.Font, FontStyle.Bold);

                if ((e.State & DrawItemState.Selected) == DrawItemState.Selected)
                {
                    using (Pen p = new Pen(Color.Black, -1)) {
                        e.Graphics.DrawRectangle(p, e.Bounds.X, e.Bounds.Y, e.Bounds.Width - 30, e.Bounds.Height - 1);
                        e.Graphics.DrawRectangle(p, e.Bounds.Width - 28, e.Bounds.Y, 27, e.Bounds.Height - 1);
                    }

                    textColor = SystemColors.HighlightText;
                }

                if (!IconList.Images.Empty)
                {
                    IconList.Draw(e.Graphics, e.Bounds.Left + 1, (e.Bounds.Top + e.Bounds.Height / 6), (int)item.MessageType);
                }

                using (SolidBrush textBrush = new SolidBrush(textColor)) {
                    StringFormat strFormat = new StringFormat();
                    strFormat.Trimming = StringTrimming.EllipsisCharacter;

                    string textMessage = item.MessageText.Replace("\n", " ").Replace("\t", " ").Replace("  ", "");;

                    int textHeaderHeight  = e.Graphics.MeasureString(item.MessageHeader, headerFont).ToSize().Height;
                    int textMessageHeight = e.Graphics.MeasureString(textMessage, this.Font).ToSize().Height;

                    int textIndexHeight = e.Graphics.MeasureString((e.Index + 1).ToString(), headerFont).ToSize().Height;
                    int textIndexWidth  = e.Graphics.MeasureString((e.Index + 1).ToString(), headerFont).ToSize().Width;

                    Rectangle textHeaderRect = new Rectangle(e.Bounds.Left + IconList.ImageSize.Width + 7,
                                                             e.Bounds.Top + e.Bounds.Height / 6,
                                                             e.Bounds.Width - e.Bounds.Left - IconList.ImageSize.Width - 37,
                                                             textHeaderHeight);

                    Rectangle textMessageRect = new Rectangle(e.Bounds.Left + IconList.ImageSize.Width + 15,
                                                              textHeaderRect.Y + textHeaderRect.Height + 5,
                                                              e.Bounds.Width - e.Bounds.Left - IconList.ImageSize.Width - 45,
                                                              textMessageHeight);

                    Rectangle textIndex = new Rectangle(e.Bounds.Width - (textIndexWidth / 2) - 15,
                                                        e.Bounds.Top + (e.Bounds.Height - textIndexHeight) / 2,
                                                        15 + (textIndexWidth / 2), textIndexHeight);

                    e.Graphics.DrawString(item.MessageHeader, headerFont, textBrush, textHeaderRect, strFormat);
                    e.Graphics.DrawString(textMessage, this.Font, textBrush, textMessageRect, strFormat);
                    e.Graphics.DrawString((e.Index + 1).ToString(), headerFont, textBrush, textIndex);

                    strFormat.Dispose();
                }
            }
        }
        public IconsAnimBehavior_3Box(
            IconList iconList,
            RectTransform selectingTransform,
            RectTransform selectingFrameTransform,
            RectTransform prevTransform,
            RectTransform prevFrameTransform,
            RectTransform nextTransform,
            RectTransform nextFrameTransform,
            RectTransform nonSelectingTransform)
        {
            IconList                = iconList;
            SelectingTransform      = selectingTransform;
            SelectingFrameTransform = selectingFrameTransform;
            PrevTransform           = prevTransform;
            PrevFrameTransform      = prevFrameTransform;
            NextTransform           = nextTransform;
            NextFrameTransform      = nextFrameTransform;
            NonSelectingTransform   = nonSelectingTransform;

            var iconFlexAnim = IconList.Selecting.GetComponent <IconFlexibleAnimator>();

            iconFlexAnim.OnAnimationStarted      += () => CanExecute = false;
            iconFlexAnim.OnAnimationEnded        += () => CanExecute = true;
            iconFlexAnim.OnAnimationMiddlePassed += UpdateSelecting;

            InitPos();
        }
Пример #3
0
        public Form1()
        {
            InitializeComponent();
            InitGuiComponents();
            IconList list = new IconList(CertificateStore<CodeSigningCertificate>.CurrentInstance.certMgrPath);

            PopulateTreeView();
        }
Пример #4
0
    //
    // glade signal handlers
    //

    // custom widget creation callback
    public Gtk.Widget GladeCustomWidgetHandler(Glade.XML xml, string func_name, string name, string s1, string s2, int i1, int i2)
    {
        Console.WriteLine("customWidgetHandler: widget for " + name);

        if (name == "browser_icon_list")
        {
            icon_list = new IconList();
            Scrollbar scroll = new VScrollbar(icon_list.Adjustment);
            Box       box    = new HBox(false, 0);

            box.PackStart(icon_list, true, true, 0);
            box.PackStart(scroll, false, true, 0);

            box.ShowAll();
            return(box);
        }

#if HAVE_LIBEOG
        if (name == "eog_image_view")
        {
            image_ui = new EogUiImage();
            Console.WriteLine("Handle: " + image_ui.Handle);
            image_ui.Show();
            return(image_ui);
        }
#else
        if (name == "eog_image_view")
        {
            Gtk.Widget w = new Gtk.Label("EOG support not enabled; Viewer is disabled.");
            w.Show();
            return(w);
        }
#endif

        if (name == "collections_tree_view")
        {
            collections_tree_view = new CollectionsTreeView();
            collections_tree_view.Show();
            return(collections_tree_view);
        }

        if (name == "imageinfo_tree_view")
        {
            imageinfo_tree_view = new ImageInfoTreeView();
            imageinfo_tree_view.Show();
            return(imageinfo_tree_view);
        }

        if (name == "keywords_widget")
        {
            keywords_widget = new KeywordsWidget();
            keywords_widget.Show();
            return(keywords_widget);
        }

        Console.WriteLine("Returning nil");
        return(null);
    }
Пример #5
0
        public void Should_return_the_ArrowCircleDown_icon_in_the_outline_style()
        {
            // Given / When
            var icon = IconList.Outline(IconSymbol.ArrowCircleDown);

            // Then
            icon.Path.ShouldBe("<path stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M15 13l-3 3m0 0l-3-3m3 3V8m0 13a9 9 0 110-18 9 9 0 010 18z\"/>");
            icon.ViewBox.ShouldBe("0 0 24 24");
            icon.StrokeWidth.ShouldBe("2");
        }
Пример #6
0
        public void Should_return_the_ArrowCircleDown_icon_in_the_solid_style()
        {
            // Given
            var icon = IconList.Solid(IconSymbol.ArrowCircleDown);

            // When / Then
            icon.Path.ShouldBe("<path fill-rule=\"evenodd\" d=\"M10 18a8 8 0 100-16 8 8 0 000 16zm1-11a1 1 0 10-2 0v3.586L7.707 9.293a1 1 0 00-1.414 1.414l3 3a1 1 0 001.414 0l3-3a1 1 0 00-1.414-1.414L11 10.586V7z\" clip-rule=\"evenodd\"/>");
            icon.ViewBox.ShouldBe("0 0 20 20");
            icon.StrokeWidth.ShouldBeNull();
        }
        public ActionResult AddOrEdit(int id = 0)
        {
            IconList iconList = new IconList();

            if (id != 0)
            {
                iconList = _iIconListManager.GetAnIconList(id);
            }
            return(View(iconList));
        }
Пример #8
0
    static public List <Resource> Load()
    {
        XmlDocument     xmlDoc       = new XmlDocument();
        List <Resource> resourceList = new List <Resource>();

        GameObject obj      = Resources.Load("IconList", typeof(GameObject)) as GameObject;
        IconList   iconList = obj.GetComponent <IconList>();

        TextAsset rscTextAsset = Resources.Load("Resource", typeof(TextAsset)) as TextAsset;

        if (rscTextAsset != null)
        {
            xmlDoc.Load(new MemoryStream(rscTextAsset.bytes));
            XmlNode rootNode = xmlDoc.FirstChild;
            if (rootNode.Name == "something")
            {
                int rscCount = rootNode.ChildNodes.Count;
                resourceList = new List <Resource>();
                for (int n = 0; n < rscCount; n++)
                {
                    resourceList.Add(new Resource());

                    for (int m = 0; m < rootNode.ChildNodes[n].Attributes.Count; m++)
                    {
                        XmlAttribute attr = rootNode.ChildNodes[n].Attributes[m];
                        if (attr.Name == "name")
                        {
                            resourceList[n].name = attr.Value;
                        }
                        else if (attr.Name == "icon")
                        {
                            int ID = int.Parse(attr.Value);
                            if (iconList.rscIconList.Count > ID)
                            {
                                resourceList[n].icon = iconList.rscIconList[ID];
                            }
                        }
                    }

                    /*
                     * resourceList.Add(new Resource());
                     * resourceList[n].name=rootNode.ChildNodes[n].Attributes[0].Value;
                     *
                     * string icon=rootNode.ChildNodes[n].Attributes[1].Value;
                     * resourceList[n].icon=Resources.Load("RscIcons/"+icon, typeof(Texture)) as Texture;
                     * //string icon=rootNode.ChildNodes[n].Attributes[1].Value;
                     * //resourceList[n].icon=Resources.Load(icon, typeof(Texture)) as Texture;
                     */
                }
            }
        }

        return(resourceList);
    }
Пример #9
0
 protected void SearchIcon()
 {
     if (string.IsNullOrEmpty(keywords))
     {
         DisplayIconList = IconList.ToList();
     }
     else
     {
         DisplayIconList = IconList.Where(icon => icon.Contains(keywords)).ToList();
     }
 }
Пример #10
0
        public IconView()
        {
            iconList = new IconList (100, null, 0);
            iconList.IconSelected += new IconSelectedHandler (HandleIconSelected);
            iconList.KeyPressEvent += new KeyPressEventHandler (HandleKeyPressed);

            this.Add (iconList);
            this.WidthRequest = 350;
            this.HeightRequest = 200;
            this.ShadowType = Gtk.ShadowType.In;
        }
Пример #11
0
        public void AddClient(Client c)
        {
            Logger.Info($"add {c.Title}");
            ClientList.Add(c);
            Task.Run(() =>
            {
                Icon item = Win32dll.GetAppIcon(c.Hwnd);
                IconList.Add(item);

                //Logger.Warn( $"all Client {ClientTitles.ToJson( ) }" );
            });
        }
Пример #12
0
 // 隠しているとアイコンを自動開放するらしい タイル化ごとに再取得
 public void ResetIcon()
 {
     foreach (var icon in IconList)
     {
         icon.Dispose( );
     }
     IconList.Clear( );
     foreach (var c in ClientList)
     {
         Icon item = Win32dll.GetAppIcon(c.Hwnd);
         IconList.Add(item);
     }
 }
Пример #13
0
	public CollectionIconListAdapter (IImageCollection coll)
	{
		icon_list = null;
		collection = coll;
		image_ids = new ArrayList ();
		image_id_to_index = new Hashtable ();

		if (coll != null) {
			repo = coll.Repo;

			UpdateFromCollection ();
			coll.OnCollectionChange += new CollectionChangeHandler (CollectionChanged);
		}
	}
Пример #14
0
        IconList CreateList()
        {
            IconList icons = new IconList(64, null, 0);

            foreach (DemoEntry entry in entries)
            {
                icons.Append("pixmaps" + Path.DirectorySeparatorChar + entry.icon,
                             entry.desc);
            }

            icons.IconSelected += new Gnome.IconSelectedHandler(icon_selected_cb);

            return(icons);
        }
		IconList CreateList ()
		{
			IconList icons = new IconList (64, null, 0);

			foreach (DemoEntry entry in entries)
			{
				icons.Append ("pixmaps" + Path.DirectorySeparatorChar + entry.icon,
							     entry.desc);
			}

			icons.IconSelected += new Gnome.IconSelectedHandler (icon_selected_cb);

			return icons;
		}
Пример #16
0
 //private Assembly IconAssembly;
 /// <summary>
 /// 加载图标
 /// </summary>
 protected void InitializeImage()
 {
     try
     {
         //FirstImage();
         //这句没有任何意义,只是为了让程序加载这个dll
         IconList   ic        = new IconList();
         Assembly[] assemblys = AppDomain.CurrentDomain.GetAssemblies();
         foreach (Assembly IconAssembly in assemblys)
         {
             AssemblyName aName = IconAssembly.GetName();
             if (aName.Name == "MyRapid.Images")
             {
                 DataTable dt = BaseService.Open("SystemMenu_Icon", null);
                 //List<string> names = ImageCollectionUtils.GetImageResourceNames(IconAssembly);
                 if (dt == null)
                 {
                     return;
                 }
                 foreach (DataRow dr in dt.Rows)
                 {
                     string name = dr[0].ToStringEx();
                     Image  img  = ImageCollectionUtils.GetImage(IconAssembly, name + "_32x32.png");
                     if (img == null)
                     {
                         img = ImageHelper.DrawIcon(32, Color.SkyBlue, "空", new Font("楷体", 16), Color.Black);
                     }
                     LargeIconList.Images.Add(img, name);
                     Image img2 = ImageCollectionUtils.GetImage(IconAssembly, name + "_16x16.png");
                     if (img2 == null)
                     {
                         img2 = ImageHelper.DrawIcon(16, Color.SkyBlue, "空", new Font("楷体", 8), Color.Black);
                     }
                     SmallIconList.Images.Add(img2, name);
                 }
                 Provider.Set("SmallIconList", SmallIconList);
                 Provider.Set("LargeIconList", LargeIconList);
             }
         }
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Пример #17
0
        public IPacket ReadPacket(IMinecraftDataReader reader)
        {
            ItemDamage = reader.ReadVarInt();
            Scale = reader.ReadSByte();
            IconList = IconList.FromReader(reader);
            Columns = reader.ReadSByte();

            if (Columns > 0)
            {
                Rows = reader.ReadSByte();
                X = reader.ReadSByte();
                Y = reader.ReadSByte();
                var dataLength = reader.ReadShort();
                Data = reader.ReadByteArray(dataLength);
            }

            return this;
        }
Пример #18
0
 public SelectProjectDialog(Gtk.Window parent)
     : base(GettextCatalog.GetString ("Select project"), parent, Gtk.DialogFlags.DestroyWithParent)
 {
     Modal = true;
     _iconlistOptions = new IconList (78, new Adjustment (1, 1, 1, 1, 1, 1) , 0);
     ScrolledWindow scroll = new ScrolledWindow ();
     scroll.Add (_iconlistOptions);
     VBox.PackStart (scroll, true, true, 1);
     _buttonCancel = (Gtk.Button) AddButton (Gtk.Stock.Cancel , Gtk.ResponseType.Cancel);
     _buttonCancel.Clicked += OnButtonSelectProjectCancel;
     _buttonOK = (Gtk.Button) AddButton (Gtk.Stock.Ok , ResponseType.Ok);
     _buttonOK.Clicked += OnButtonSelectProjectOK;
     BuildIcons ();
     ShowAll ();
     WidthRequest = 350;
     HeightRequest = 160;
     WindowPosition = Gtk.WindowPosition.CenterAlways;
 }
Пример #19
0
    public static int Main(string[] args)
    {
//		Window topwin;
        IconList         icon_list;
        IImageCollection collection;
        IIconListAdapter adapter;

        if (args.Length == 0)
        {
            Console.WriteLine("Usage: GtkMphoto /path/to/files");
            return(0);
        }

        Application.Init();

        Window topwin = new Window("GtkMphoto");

        topwin.DefaultSize  = new Size(600, 400);
        topwin.DeleteEvent += new DeleteEventHandler(Window_Delete);

        icon_list = new IconList();
        Scrollbar vsb = new VScrollbar(icon_list.Adjustment);
        Box       box = new HBox(false, 0);

        box.PackStart(icon_list, true, true, 0);
        box.PackStart(vsb, false, true, 0);

        box.ShowAll();
        topwin.Add(box);

        IImageRepository repo = new DirImageRepository(args);

        string[] collIds  = repo.GetCollectionIDs();
        string   firstcid = collIds [0];

        collection = repo.GetCollection(firstcid);

        icon_list.Adapter = new CollectionIconListAdapter(collection);

        topwin.Show();
        Application.Run();
        return(0);
    }
Пример #20
0
 private void LoadImages()
 {
     this._openShortcut.Image        = IconList.LoadIcon(IconList.ICON_OPEN);
     this._newConnection.Image       = IconList.LoadIcon(IconList.ICON_NEWCONNECTION);
     this._newSerialConnection.Image = IconList.LoadIcon(IconList.ICON_SERIAL);
     this._newCygwinConnection.Image = IconList.LoadIcon(IconList.ICON_CYGWIN);
     this._newSFUConnection.Image    = IconList.LoadIcon(IconList.ICON_SFU);
     this._saveShortcut.Image        = IconList.LoadIcon(IconList.ICON_SAVE);
     this._singleStyle.Image         = IconList.LoadIcon(IconList.ICON_SINGLE);
     this._divHorizontalStyle.Image  = IconList.LoadIcon(IconList.ICON_DIVHORIZONTAL);
     this._divVerticalStyle.Image    = IconList.LoadIcon(IconList.ICON_DIVVERTICAL);
     this._divHorizontal3Style.Image = IconList.LoadIcon(IconList.ICON_DIVHORIZONTAL3);
     this._divVertical3Style.Image   = IconList.LoadIcon(IconList.ICON_DIVVERTICAL3);
     this._localEcho.Image           = IconList.LoadIcon(IconList.ICON_LOCALECHO);
     this._lineFeedRule.Image        = IconList.LoadIcon(IconList.ICON_LINEFEED);
     this._logSuspend.Image          = IconList.LoadIcon(IconList.ICON_SUSPENDLOG);
     this._commentLog.Image          = IconList.LoadIcon(IconList.ICON_COMMENTLOG);
     this._serverInfo.Image          = IconList.LoadIcon(IconList.ICON_INFO);
 }
        public int AddOrEdit(IconList iconList)
        {
            if (iconList.IconId == 0)
            {
                iconList.CreatedDate = DateTime.Now;
                iconList.UpdatedDate = DateTime.Now;
                iconList.CreatedBy   = 1;
                iconList.UpdatedBy   = 1;
                _dbContext.IconLists.Add(iconList);
            }
            else
            {
                iconList.UpdatedBy               = 1;
                iconList.UpdatedDate             = DateTime.Now;
                _dbContext.Entry(iconList).State = EntityState.Modified;
            }

            return(_dbContext.SaveChanges());
        }
Пример #22
0
        private void CreatRes()
        {
            string path = System.Environment.CurrentDirectory;
            string url  = EncryptsHelper.Decrypt(ConfigurationManager.ConnectionStrings["GamesURL"].ToString());

            if (!Directory.Exists(path + @"\res"))//如果不存在就创建res文件夹
            {
                Directory.CreateDirectory(path + @"\res");
            }
            var allGame = Game.FindAll();

            for (int i = 0; i < allGame.Count; i++)
            {
                IconList iconList = new IconList();
                iconList.GameName = allGame[i].Name;
                iconList.gameCode = allGame[i].SerialCode;
                panel.Controls.Add(iconList);
            }
            //加载图片放入线程池中
            ThreadPool.QueueUserWorkItem(new WaitCallback(AddGameIcon));
        }
Пример #23
0
	public static int Main (string[] args) {
//		Window topwin;
		IconList icon_list;
		IImageCollection collection;
		IIconListAdapter adapter;

		if (args.Length == 0) {
			Console.WriteLine ("Usage: GtkMphoto /path/to/files");
			return 0;
		}

		Application.Init ();

		Window topwin = new Window ("GtkMphoto");
		topwin.DefaultSize = new Size (600, 400);
		topwin.DeleteEvent += new DeleteEventHandler (Window_Delete);

		icon_list = new IconList ();
		Scrollbar vsb = new VScrollbar (icon_list.Adjustment);
		Box box = new HBox (false, 0);
		box.PackStart (icon_list, true, true, 0);
		box.PackStart (vsb, false, true, 0);

		box.ShowAll ();
		topwin.Add (box);

		IImageRepository repo = new DirImageRepository (args);

		string[] collIds = repo.GetCollectionIDs();
		string firstcid = collIds [0];
		collection = repo.GetCollection (firstcid);

		icon_list.Adapter = new CollectionIconListAdapter (collection);

		topwin.Show ();
		Application.Run ();
		return 0;
	}
Пример #24
0
		public PopupContextMenu (IconList l, int pos)
		{
			icon_list = l;
			item = pos;
		}
Пример #25
0
	public IconListPopup (IconList il, int item_clicked)
	{
		this.item_clicked = item_clicked;
		IconList = il;
	}
Пример #26
0
	public KeywordsWidget (IconList icon_list)
		: this ()
	{
		store.IconList = icon_list;
	}
Пример #27
0
	public ImageInfoTreeView (IconList icon_list)
		: this ()
	{
		store.IconList = icon_list;
	}
Пример #28
0
	//
	// glade signal handlers
	//

	// custom widget creation callback
	public Gtk.Widget GladeCustomWidgetHandler (Glade.XML xml, string func_name, string name, string s1, string s2, int i1, int i2)
	{
		Console.WriteLine ("customWidgetHandler: widget for " + name);

		if (name == "browser_icon_list") {
			icon_list = new IconList ();
			Scrollbar scroll = new VScrollbar (icon_list.Adjustment);
			Box box = new HBox (false, 0);

			box.PackStart (icon_list, true, true, 0);
			box.PackStart (scroll, false, true, 0);

			box.ShowAll ();
			return box;
		}

#if HAVE_LIBEOG
		if (name == "eog_image_view") {
			image_ui = new EogUiImage ();
			Console.WriteLine ("Handle: " + image_ui.Handle);
			image_ui.Show ();
			return image_ui;
		}
#else
		if (name == "eog_image_view") {
			Gtk.Widget w = new Gtk.Label ("EOG support not enabled; Viewer is disabled.");
			w.Show ();
			return w;
		}
#endif

		if (name == "collections_tree_view") {
			collections_tree_view = new CollectionsTreeView ();
			collections_tree_view.Show ();
			return collections_tree_view;
		}

		if (name == "imageinfo_tree_view") {
			imageinfo_tree_view = new ImageInfoTreeView ();
			imageinfo_tree_view.Show ();
			return imageinfo_tree_view;
		}

		if (name == "keywords_widget") {
			keywords_widget = new KeywordsWidget ();
			keywords_widget.Show ();
			return keywords_widget;
		}

		Console.WriteLine ("Returning nil");
		return null;
	}