Exemple #1
0
 public async Task addThumbnail(string name, string link)
 {
     if (description.isDescriptionManager(Context.Guild.GetUser(Context.User.Id)))
     {
         description desc = description.get_description(name);
         if (desc != null)
         {
             desc.thumbnail = link;
             description.update_description(desc);
             if (showPreview)
             {
                 await Context.Channel.SendMessageAsync("Here is the description you made: ", false, desc.toEmbed(Context.Guild));
             }
             else
             {
                 await Context.Channel.SendMessageAsync("Image added to description");
             }
         }
         else
         {
             await ReplyAsync(Context.User.Mention + ", you have to `hs!add 'location' 'Multi word description'` before adding an image link to it.");
         }
     }
     else
     {
         //ReplyAsync(Context.User.Mention + ", you don't have access to add a description");
     }
 }
Exemple #2
0
 public Info(string nameSubject, typeControl typeOfControl, description descriptionOfSubject, int numberOfSemester)
 {
     this.nameSubject = nameSubject;
     this.typeOfControl = typeOfControl;
     this.descriptionOfSubject = descriptionOfSubject;
     this.numberOfSemester = numberOfSemester;
 }
Exemple #3
0
        public static List <description> mapdescription(String content, String lang)
        {
            List <description> ret = new List <description>();

            if (String.IsNullOrEmpty(content))
            {
                return(ret);
            }
            if (content.Length > UDDIConstants.MAX_description_length)
            {
                int offset = 0;
                while (offset < content.Length)
                {
                    description description = new description();
                    description.lang = (lang);
                    int len = UDDIConstants.MAX_description_length;
                    if (len > content.Length - offset)
                    {
                        len = content.Length - offset;
                    }

                    description.Value = (content.Substring(offset, len));
                    offset            = offset + UDDIConstants.MAX_description_length;
                    ret.Add(description);
                }
            }
            else
            {
                ret.Add(new description(content, lang));
            }
            return(ret);
        }
Exemple #4
0
        private void btnAddDescription_Click(object sender, RoutedEventArgs e)
        {
            description Description = new description()
            {
                name       = "Третьи соревнования",
                start_date = new DateTime(2016, 11, 25)
            };

            Thread th = new Thread(() =>
            {
                descriptionCollection.Add(Description);
                if (!ChangesSavedSuccessfully)
                {
                    descriptionCollection.CollectionChanged -= descriptionCollection_CollectionChanged;
                    descriptionCollection.Remove(Description);
                    descriptionCollection.CollectionChanged += descriptionCollection_CollectionChanged;
                }
            })
            {
                IsBackground = true
            };

            th.SetApartmentState(ApartmentState.STA);
            th.Start();
        }
Exemple #5
0
 public async Task setDisplayTitle(string name, string disTitle)
 {
     if (description.isDescriptionManager(Context.Guild.GetUser(Context.User.Id)))
     {
         description desc = description.get_description(name);
         if (desc != null)
         {
             desc.displayTitle = disTitle;
             description.update_description(desc);
             if (showPreview)
             {
                 await Context.Channel.SendMessageAsync("Here is the description you made: ", false, desc.toEmbed(Context.Guild));
             }
             else
             {
                 await Context.Channel.SendMessageAsync("Display Title updated on description");
             }
         }
         else
         {
             await ReplyAsync(Context.User.Mention + ", a description under the title of `" + name + "` does not exist.");
         }
     }
     else
     {
         //ReplyAsync(Context.User.Mention + ", you don't have access to add a description");
     }
 }
Exemple #6
0
 public async Task wikiDesc(string name, string wiki)
 {
     if (description.isDescriptionManager(Context.Guild.GetUser(Context.User.Id)))
     {
         description desc = description.get_description(name);
         if (desc != null)
         {
             desc.wikiLink = wiki;
             description.update_description(desc);
             if (showPreview)
             {
                 await Context.Channel.SendMessageAsync("Here is the description you made: ", false, desc.toEmbed(Context.Guild));
             }
             else
             {
                 await Context.Channel.SendMessageAsync("Wiki link added to description");
             }
         }
         else
         {
             await ReplyAsync(Context.User.Mention + ", a description under the title of '" + name + "` does not exist.");
         }
     }
     else
     {
         //ReplyAsync(Context.User.Mention + ", you don't have access to add a description");
     }
 }
Exemple #7
0
        public async Task addDesc(params string[] inputs)
        {
            if (description.isDescriptionManager(Context.Guild.GetUser(Context.User.Id)))
            {
                if (inputs.Length < 2)
                {
                    await ReplyAsync("Not enough inputs");

                    return;
                }
                description desc = description.get_description(inputs[0]);
                if (desc != null)
                {
                    List <string> str = inputs.ToList();
                    foreach (string s in str)
                    {
                        if (s.Equals("[b]"))
                        {
                            desc.descr += System.Environment.NewLine;
                        }
                        else
                        {
                            desc.descr += s + " ";
                        }
                    }
                    description.update_description(desc);
                }
                else
                {
                    desc       = new description();
                    desc.title = inputs[0];
                    List <string> str = inputs.ToList();
                    str.RemoveAt(0);
                    foreach (string s in str)
                    {
                        if (s.Equals("[b]"))
                        {
                            desc.descr += System.Environment.NewLine;
                        }
                        else
                        {
                            desc.descr += s + " ";
                        }
                    }
                    description.insert_description(desc);
                }
                if (showPreview)
                {
                    await Context.Channel.SendMessageAsync("Here is the description you made: ", false, desc.toEmbed(Context.Guild));
                }
                else
                {
                    await Context.Channel.SendMessageAsync("Description either updated or created.");
                }
            }
            else
            {
                //ReplyAsync(Context.User.Mention + ", you don't have access to add a description");
            }
        }
        //The massive description lists need to be put somewhere
        void addplaces()
        {
            description d1 = new description();

            d1.descript = "It's a forest.";
            d1.tags.Add("forest");
            d1.tags.Add("trees");
            places.Add(d1);
            //And so on
        }
Exemple #9
0
        private void btnDelDescription_Click(object sender, RoutedEventArgs e)
        {
            description Description = descriptionViewSource.View.CurrentItem as description;

            descriptionCollection.Remove(Description);
            if (!ChangesSavedSuccessfully)
            {
                descriptionCollection.CollectionChanged -= descriptionCollection_CollectionChanged;
                descriptionCollection.Add(Description);
                descriptionCollection.CollectionChanged += descriptionCollection_CollectionChanged;
            }
        }
Exemple #10
0
        public async Task showDesc(string name)
        {
            description desc = description.get_description(name);

            if (desc != null)
            {
                await Context.Channel.SendMessageAsync("", false, desc.toEmbed(Context.Guild));
            }
            else
            {
                await ReplyAsync(Context.User.Mention + ", a description under the title of '" + name + "` does not exist.");
            }
        }
        public void xr_overviewDoc()
        {
            Console.Out.WriteLine("serialization xr_overviewDoc");
            overviewDoc r  = new overviewDoc();
            description d  = new description("v", "en");
            overviewURL ol = new overviewURL("http://url", "website");

            r.overviewURLs = new overviewURL[] { ol };
            r.descriptions = new description[] { d };
            XmlSerializer xr = new XmlSerializer(typeof(overviewDoc));
            StringWriter  sw = new StringWriter();

            xr.Serialize(sw, r);
            System.Console.Out.WriteLine(sw.ToString());
        }
Exemple #12
0
        public async Task colorDesc(string name, int red, int green, int blue)
        {
            if (description.isDescriptionManager(Context.Guild.GetUser(Context.User.Id)))
            {
                description desc = description.get_description(name);
                if (desc != null)
                {
                    if (0 > red || red > 255)
                    {
                        await ReplyAsync(Context.User.Mention + ", the red paramater needs to be between 0 and 255.");

                        return;
                    }
                    else if (0 > green || green > 255)
                    {
                        await ReplyAsync(Context.User.Mention + ", the green paramater needs to be between 0 and 255.");

                        return;
                    }
                    else if (0 > blue || blue > 255)
                    {
                        await ReplyAsync(Context.User.Mention + ", the blue paramater needs to be between 0 and 255.");

                        return;
                    }
                    desc.rgb[0] = red;
                    desc.rgb[1] = green;
                    desc.rgb[2] = blue;
                    description.update_description(desc);
                    if (showPreview)
                    {
                        await Context.Channel.SendMessageAsync("Here is the description you made: ", false, desc.toEmbed(Context.Guild));
                    }
                    else
                    {
                        await Context.Channel.SendMessageAsync("Color changed on the description");
                    }
                }
                else
                {
                    await ReplyAsync(Context.User.Mention + ", a description under the title of '" + name + "` does not exist.");
                }
            }
            else
            {
                //ReplyAsync(Context.User.Mention + ", you don't have access to add a description");
            }
        }
Exemple #13
0
 public async Task deleteDesc(string name)
 {
     if (description.isDescriptionManager(Context.Guild.GetUser(Context.User.Id)))
     {
         description desc = description.get_description(name);
         if (desc != null)
         {
             description.delete_description(desc);
             await ReplyAsync(Context.User.Mention + ", description deleted");
         }
         else
         {
             await ReplyAsync(Context.User.Mention + ", a description under the title of '" + name + "` does not exist.");
         }
     }
     else
     {
         //ReplyAsync(Context.User.Mention + ", you don't have access to add a description");
     }
 }
Exemple #14
0
        public ActionResult AddProduct(group_products prd, description dsc, product pct, HttpPostedFileBase file, image img)
        {
            if (file == null)
            {
                Session["uploaderror"] = "your must select your file";
                return(RedirectToAction("add"));
            }
            if (file.ContentType != "image/png" && file.ContentType != "image/jpeg" && file.ContentType != "image/gif")
            {
                Session["uploaderror"] = "your file must be jpg,png or gif";
                return(RedirectToAction("add"));
            }
            if ((file.ContentLength / 1024) > 1024)
            {
                Session["uploaderror"] = "your file size must be max 1mb";
                return(RedirectToAction("add"));
            }
            string filename = DateTime.Now.ToString("ddmmyyyyhhmmssffff") + file.FileName;
            string path     = Path.Combine(Server.MapPath("~/Upload"), filename);

            file.SaveAs(path);
            //about.photo = filename;

            img.name = filename;
            db.images.Add(img);
            db.descriptions.Add(dsc);

            // var x = db.group_products.FirstOrDefault(p => p.name == prd.name);
            product prdc = new product
            {
                description_id = dsc.id,
                name           = prd.name,
                image_id       = img.id
            };

            db.products.Add(prdc);
            db.SaveChanges();
            //return Content(usr.id.ToString());
            return(RedirectToAction("add"));
        }
Exemple #15
0
        public async Task addfooter(params string[] inputs)
        {
            if (description.isDescriptionManager(Context.Guild.GetUser(Context.User.Id)))
            {
                if (inputs.Length < 2)
                {
                    await ReplyAsync("Not enough inputs");

                    return;
                }
                string      name = inputs[0];
                description desc = description.get_description(inputs[0]);
                if (desc != null)
                {
                    List <string> str = inputs.ToList();
                    str.RemoveAt(0);
                    desc.footer = String.Join(" ", inputs);
                    description.update_description(desc);
                    if (showPreview)
                    {
                        await Context.Channel.SendMessageAsync("Here is the description you made: ", false, desc.toEmbed(Context.Guild));
                    }
                    else
                    {
                        await Context.Channel.SendMessageAsync("Footer information updated on description");
                    }
                }
                else
                {
                    await ReplyAsync(Context.User.Mention + ", a description under the title of `" + name + "` does not exist.");
                }
            }
            else
            {
                //ReplyAsync(Context.User.Mention + ", you don't have access to add a description");
            }
        }
Exemple #16
0
 CreateCommandQueue1(description, creatorID, typeof(T).GUID, out IntPtr nativePtr).CheckError();
Exemple #17
0
 var(description, data) = await CreateJobAsync(@event, (TAction)action);
Exemple #18
0
 (errorCode, description) => throw new GLFWException(description, errorCode);
 CreateBuffer(description, initialData, out ID3D11Buffer buffer).CheckError();
 return(new SchemaDefinition(
            description,
            definition.Directives,
Exemple #21
0
 return(NewPort <CreateTenantCmd, ICreateTenantResult>(new CreateTenantCmd(organisationId, tenantName, description, adminEmail, adminName, userId)));
Exemple #22
0
 IsNotNull(description, nameof(description)),
 return(new EnumDefinition(
            description,
            definition.Name,
Exemple #24
0
 return(new DirectiveDefinition(
            description,
            definition.Name,
 return(new UnionDefinition(
            description,
            definition.Name,
 return(new FieldDefinition(
            description,
            definition.Name,
 return(new InputObjectDefinition(
            description,
            definition.Name,
Exemple #28
0
        public static DataTable GetTableInfo()
        {
            DataTable table = new DataTable("Info");
            DataColumn column; //столбцы
            DataRow row; //строки

            column = new DataColumn();
            column.DataType = typeof(string);
            column.ColumnName = "nameSubject";
            table.Columns.Add(column);

            column = new DataColumn();
            column.DataType = typeof(string);
            column.ColumnName = "typeOfControl";
            table.Columns.Add(column);

            column = new DataColumn();
            column.DataType = typeof(string);
            column.ColumnName = "description";
            table.Columns.Add(column);

            column = new DataColumn();
            column.DataType = typeof(System.Int32);
            column.ColumnName = "numberOfSemester";
            table.Columns.Add(column);

            typeControl typeOfControl = typeControl.differentialOffset;
            description descriptionOfSubject = description.informatics;
            int numberOfSemester = 2;
            string nameSubject = "Практикум на ЭВМ";

            Info info1 = new Info(nameSubject, typeOfControl, descriptionOfSubject, numberOfSemester);

            typeOfControl = typeControl.exam;
            descriptionOfSubject = description.maths;
            numberOfSemester = 2;
            nameSubject = "Математический анализ";

            Info info2 = new Info(nameSubject, typeOfControl, descriptionOfSubject, numberOfSemester);

            List<Info> info = new List<Info>() { info1, info2 };

            for (int i = 0; i < info.Count; i++)
            {
                row = table.NewRow();
                row["nameSubject"] = info[i].nameSubject.ToString();
                row["typeOfControl"] = info[i].typeOfControl.ToString();
                row["description"] = info[i].descriptionOfSubject.ToString();
                row["numberOfSemester"] = info[i].numberOfSemester;
                table.Rows.Add(row);
            }
            return table;
        }
Exemple #29
0
 return(new EnumValueDefinition(
            description,
            definition.Value,
Exemple #30
0
 select(type, name, description, extension);
Exemple #31
0
        /**
         * Creates a UDDI Business Service.
         *
         * @param serviceQName This must be specified to identify the namespace of
         * the service, which is used to set the service uddi key
         * @param waldDefinition
         * @return
         */
        public businessService createBusinessService(QName serviceQName, application wadlDefinition)
        {
            log.debug("Constructing Service UDDI Information for " + serviceQName);
            businessService service = new businessService();

            // BusinessKey
            service.businessKey = (businessKey);
            // ServiceKey
            service.serviceKey = (UDDIKeyConvention.getServiceKey(properties, serviceQName.getLocalPart()));
            // Description
            String serviceDescription = properties.getProperty(Property.SERVICE_DESCRIPTION, Property.DEFAULT_SERVICE_DESCRIPTION);
            // Override with the service description from the WSDL if present
            bool lengthwarn       = false;
            List <description> ds = new List <description>();

            if (wadlDefinition.doc != null)
            {
                for (int i = 0; i < wadlDefinition.doc.Length; i++)
                {
                    String      locallang   = lang;
                    description description = new description();
                    if (wadlDefinition.doc[i].lang != null)
                    {
                        locallang = (wadlDefinition.doc[i].lang);
                    }


                    if (locallang.Length > UDDIConstants.MAX_xml_lang_length)
                    {
                        lengthwarn = true;
                        locallang  = (locallang.Substring(0, UDDIConstants.MAX_xml_lang_length - 1));
                    }

                    StringBuilder sb = new StringBuilder();
                    sb.Append(wadlDefinition.doc[i].title).Append(" ");
                    sb.Append(ContentToString(wadlDefinition.doc[i].Any));

                    ds.AddRange(Common2UDDI.mapdescription(sb.ToString(), locallang));
                }
            }
            else
            {
                ds.AddRange(Common2UDDI.mapdescription(serviceDescription, lang));
            }
            service.description = ds.ToArray();


            // Service name
            name sName = new name();

            sName.lang = (lang);
            if (wadlDefinition.doc != null && wadlDefinition.doc.Length > 0)
            {
                sName.Value = (wadlDefinition.doc[0].title);
            }
            if (sName.Value == null)
            {
                sName.Value = (serviceQName.getLocalPart());
            }
            service.name = new name[] { sName };

            categoryBag           cb  = new categoryBag();
            List <keyedReference> krs = new List <keyedReference>();
            String ns = serviceQName.getNamespaceURI();

            if (ns != null && ns != "")
            {
                keyedReference namespaceReference = new keyedReference(
                    "uddi:uddi.org:xml:namespace", "uddi-org:xml:namespace", ns);
                krs.Add(namespaceReference);
            }

            keyedReference serviceReference = new keyedReference(
                "uddi:uddi.org:wadl:types", "uddi-org:wadl:types", "service");

            krs.Add(serviceReference);

            keyedReference localNameReference = new keyedReference(
                "uddi:uddi.org:xml:localname", "uddi-org:xml:localName", serviceQName.getLocalPart());

            krs.Add(localNameReference);
            cb.Items            = krs.ToArray();
            service.categoryBag = (cb);
            if (wadlDefinition.resources != null)
            {
                for (int i = 0; i < wadlDefinition.resources.Length; i++)
                {
                    bindingTemplate bindingTemplate = createWADLBinding(serviceQName, getDocTitle(wadlDefinition.resources[i].doc),
                                                                        new Uri(wadlDefinition.resources[i].@base), wadlDefinition.resources[i]);
                    service.bindingTemplates = new bindingTemplate[] { bindingTemplate };
                }
            }


            if (lengthwarn)
            {
                log.warn("Some object descriptions are longer than the maximum allowed by UDDI and have been truncated.");
            }
            return(service);
        }
Exemple #32
0
 Add(value, new EnumValue(description, directives, deprecationReason));