private PropertiesCollection GetProperties(string target, SvnRevision asOfRevision, bool recurse)
        {
            try
            {
                PropertiesCollection result = new PropertiesCollection();
                Collection <SvnPropertyListEventArgs> output;
                SvnPropertyListArgs args = new SvnPropertyListArgs();
                args.Revision = asOfRevision;
                args.Depth    = recurse ? SvnDepth.Infinity : SvnDepth.Children;

                client.GetPropertyList(new Uri(target), args, out output);

                foreach (SvnPropertyListEventArgs eventArgs in output)
                {
                    Dictionary <string, string> properties = new Dictionary <string, string>(eventArgs.Properties.Count);
                    foreach (SvnPropertyValue value in eventArgs.Properties)
                    {
                        properties.Add(value.Key, value.StringValue);
                    }
                    result.Add(eventArgs.Path, properties);
                }

                return(result);
            }
            catch (Exception ex)
            {
                OnError(ex);
            }

            return(null);
        }
Example #2
0
        private void btnGetProp_Click(object sender, EventArgs e)
        {
            if (tbFileURI.Text.Length == 0)
            {
                MessageBox.Show("geçerli bir URI girin");
                return;
            }

            lvProps.Items.Clear();                                //liste görüntüsünü temizliyor

            SvnTarget tgt = SvnTarget.FromString(tbFileURI.Text); // Bu, özellikleri aldığımız hedef dosya olacak

            System.Collections.ObjectModel.Collection <SvnPropertyListEventArgs> proplist;
            SvnPropertyListArgs args = new SvnPropertyListArgs();//argmanlar koyabilecegimiz yer

            if (cbRecurse.Checked == true)
            {
                args.Depth = SvnDepth.Infinity;
            }
            using (SharpSvn.SvnClient client = new SharpSvn.SvnClient())
            {
                try
                {
                    client.GetPropertyList(tgt, args, out proplist);
                    foreach (SvnPropertyListEventArgs node in proplist)
                    {
                        foreach (SvnPropertyValue propVal in node.Properties)
                        {
                            ListViewItem entry = new ListViewItem(node.Path);
                            entry.SubItems.Add(propVal.Key);
                            entry.SubItems.Add(propVal.StringValue);
                            lvProps.Items.Add(entry);
                        }
                    }
                    for (int i = 0; i < 3; i++)
                    {
                        lvProps.Columns[i].Width = -2;
                    }
                }
                catch (SvnException se)
                {
                    MessageBox.Show(se.Message + Environment.NewLine +
                                    "Error:" + se.SvnErrorCode,
                                    "svn proplist error",
                                    MessageBoxButtons.OK,
                                    MessageBoxIcon.Error);
                }
            }
        }
        private PropertiesCollection GetProperties(string target, SvnRevision asOfRevision, bool recurse)
        {
            try
            {
                PropertiesCollection result = new PropertiesCollection();
                Collection<SvnPropertyListEventArgs> output;
                SvnPropertyListArgs args = new SvnPropertyListArgs();
                args.Revision = asOfRevision;
                args.Depth = recurse ? SvnDepth.Infinity : SvnDepth.Children;

                client.GetPropertyList(new Uri(target), args, out output);

                foreach (SvnPropertyListEventArgs eventArgs in output) {
                    Dictionary<string, string> properties = new Dictionary<string, string>(eventArgs.Properties.Count);
                    foreach (SvnPropertyValue value in eventArgs.Properties) {
                        properties.Add(value.Key, value.StringValue);
                    }
                    result.Add(eventArgs.Path, properties);
                }

                return result;
            }
            catch(Exception ex)
            {
                OnError(ex);
            }

            return null;
        }
Example #4
0
        SvnPropertyCollection GetAllProperties(string path)
        {
            // Subversion -1.5 loads all properties in memory at once; loading them
            // all at once is always faster than loading a few
            // We must change this algorithm if Subversions implementation changes
            SvnPropertyCollection pc = null;
            using (SvnClient client = GetService<ISvnClientPool>().GetNoUIClient())
            {
                SvnPropertyListArgs pl = new SvnPropertyListArgs();
                pl.ThrowOnError = false;
                client.PropertyList(path, pl,
                    delegate(object sender, SvnPropertyListEventArgs e)
                    {
                        e.Detach();
                        pc = e.Properties;
                    });
            }

            return pc;
        }