コード例 #1
0
ファイル: Project.aspx.cs プロジェクト: kohku/codefactory
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack && Request.QueryString["guid"] == null)
            throw new InvalidOperationException("Bad request. Gallery Unknown.");

        if (!IsPostBack)
            id = new Guid(Request.QueryString["guid"]);
        else
            id = (Guid)Session["guid"];

        Session["masterGraphic"] = false;
        Session["guid"] = id;

        _gallery = Gallery.Load(id);

        Response.Cache.SetCacheability(HttpCacheability.NoCache);
        Page.Title = (string)GetLocalResourceObject("Title");
        ProjectTitleLabel.Text = _gallery.Title;
        switch (_gallery.Status)
        {
            case GalleryStatus.Design:
                DesingCheckBox.Checked = true;
                break;
            case GalleryStatus.Changes:
                ChangesCheckBox.Checked = true;
                break;
            case GalleryStatus.Authorized:
                AuthorizedCheckBox.Checked = true;
                break;
            default:
                throw new InvalidOperationException("Bad request. Undefined status.");
        }

        ManageButton.Visible = HttpContext.Current.User.IsInRole("Administrator");
    }
コード例 #2
0
        public override void DeleteGallery(Gallery gallery)
        {
            using (TransactionContext context = TransactionContextFactory.EnterContext(TransactionAffinity.Supported))
            {
                try
                {
                    DeleteComments(gallery);

                    DeleteUsers(gallery);

                    IDataSource dataSource = DataSourceFactory.GetDataSource("DbGalleryProvider");

                    IDataCommand cmd = dataSource.GetCommand("DeleteGallery");

                    cmd.Parameters["applicationName"].Value = this.ApplicationName;
                    cmd.Parameters["id"].Value = gallery.ID;

                    int affectedRows = cmd.ExecuteNonQuery();

                    context.VoteCommit();
                }
                catch (Exception ex)
                {
                    context.VoteRollback();
                    throw ex;
                }
            }
        }
コード例 #3
0
    public UploadedFilesResult(Gallery gallery)
    {
        if (gallery == null)
            throw new ArgumentNullException("gallery");

        this._gallery = gallery;
    }
コード例 #4
0
        public override void DeleteGallery(Gallery gallery)
        {
            if (gallery == null)
                throw new ArgumentNullException("gallery");

            LinqGallery g = new LinqGallery(gallery);

            GalleryDataContext db = new GalleryDataContext(
                ConfigurationManager.ConnectionStrings[this.ConnectionStringName].ConnectionString);

            Table<LinqGallery> galleries = db.GetTable<LinqGallery>();

            galleries.Attach(g);

            galleries.DeleteOnSubmit(g);

            try
            {
                db.SubmitChanges(ConflictMode.ContinueOnConflict);
            }
            catch (ChangeConflictException ex)
            {
                Trace.TraceError(ex.Message);

                // All database values overwrite current values.
                foreach (ObjectChangeConflict occ in db.ChangeConflicts)
                    occ.Resolve(RefreshMode.OverwriteCurrentValues);
            }
            catch (DbException ex)
            {
                Trace.TraceError(ex.Message);
            }
        }
コード例 #5
0
ファイル: Program.cs プロジェクト: sadeniju/WpfExperiments
        static void Main(string[] args)
        {
            // Construct a presentation for the test output
            Presentation presentation = new Presentation("Presentation");
            presentation.AddContent(new Page("1. Page"));

            Page secondPage = new Page("2. Page");
            secondPage.AddContent(new ImageContent("2.1 Image Content"));
            secondPage.AddContent(new Page("2.2 Page"));

            Gallery gallery = new Gallery("2.3 Gallery");
            gallery.AddContent(new ImageContent("2.3.1 Galleryimage 1"));
            gallery.AddContent(new ImageContent("2.3.2 Galleryimage 2"));

            secondPage.AddContent(gallery);
            presentation.AddContent(secondPage);

            // Print information about its contents
            foreach (Page p in presentation.Contents) {
                Console.WriteLine((p.Parent as IPresentationModule).Title+" contains "+p.Title);
                PrintSubContents(p.Contents);
            }

            Console.Read();
        }
コード例 #6
0
ファイル: Finder.cs プロジェクト: CarverLab/onCore.root
		public Finder(UPnPDevice device, Gallery presenter)
		{
			Controller = new ContentDirectoryController(this);
			Model = MediaServerModel.GetInstance();
			Device = device;
			Presenter = presenter;
		}
コード例 #7
0
 private void UpdateModel(Gallery obj, GalleryPostModel model)
 {
     var evt = (model.EventID.HasValue) ? Repo.GetById<Event>(model.EventID.Value) : null;
     obj.Update(model.Name, model.Slug, model.Date,evt);
     obj.SetDefaultImage(Repo.GetById<Image>(model.DefaultImageID));
     Repo.Save(obj);
 }
コード例 #8
0
ファイル: CommentsResult.cs プロジェクト: kohku/codefactory
    public CommentsResult(Gallery gallery)
    {
        if (gallery == null)
            throw new ArgumentNullException("gallery");

        this._gallery = gallery;
    }
コード例 #9
0
ファイル: GalleryController.cs プロジェクト: junxy/WebData
 public ActionResult New(Gallery gallery)
 {
     if (ModelState.IsValid)
     {
         return Content("ok");
     }
     return View();
 }
コード例 #10
0
		public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
		{
			var view = inflater.Inflate(Resource.Layout.TodaysVisitsView, null);
			gallery = view.FindViewById<Gallery>(Resource.Id.gallery);
			gallery.Adapter = source = new ImageAdapter(this);
			gallery.SetSpacing(30);
			return view;
		}
コード例 #11
0
        protected void UploadButton_Click(object sender, EventArgs e)
        {
            if (IsValid)
            {
                Gallery gallery = new Gallery();
                gallery.SaveImage(FileUpload.FileContent, FileUpload.FileName);
            }

            UploadSuccess.Visible = true;
        }
コード例 #12
0
		protected override void OnCreate (Bundle bundle)
		{
			base.OnCreate (bundle);

			// Set our view from the "main" layout resource
			SetContentView (Resource.Layout.Main);

            gallery = FindViewById<Gallery>(Resource.Id.gallery1);
			gallery.Adapter = new ImageAdapter (this);
            RegisterForContextMenu(gallery);
		}
コード例 #13
0
        public ActionResult Gallery(int id)
        {
            if (Session["UserId"] != null)
            {
                Gallery Model = new Gallery()
                {
                    Galleries = GenericMethods.UserGallery(id)
                };

                return View(Model);
            }
            return RedirectToAction(LoginPages.Login, LoginPages.Account, new { area = "" });
        }
コード例 #14
0
        public ActionResult Create(Gallery gallery)
        {
            if (ModelState.IsValid)
            {
                db.Galleries.Add(gallery);
                db.SaveChanges();

                TempData["Message"] = "Pomyślnie zapisano galerię.";
                return RedirectToAction("PhotosAdmin", new { id = gallery.id });
            }
            TempData["Error"] = "Coś poszło nie tak! Nie zapisano galerii.";
            return View("Edit", gallery);
        }
コード例 #15
0
        protected void ButtonUpload_Click(object sender, EventArgs e)
        {
            if (IsValid)
            {
                if (FileUpload.HasFile)
                {
                    Gallery gallery = new Gallery();
                    gallery.SaveImage(FileUpload.FileContent, FileUpload.FileName);

                    ImageHolder.ImageUrl = "Content/Images/" + FileUpload.FileName;
                    UploadSuccess.Visible = true;
                }
            }
        }
コード例 #16
0
ファイル: MainActivity.cs プロジェクト: mvdhorstclb/NGraphics
    protected override void OnCreate(Bundle bundle)
    {
      base.OnCreate(bundle);

      CreateResultsDir();

      SetContentView(Resource.Layout.Gallery);
      // Set our view from the "main" layout resource
      _textView = FindViewById<TextView>(Resource.Id.testStatusTextView);
      _gallery = FindViewById<Gallery>(Resource.Id.gallery);
      _selectedImageImageView = FindViewById<ImageView>(Resource.Id.selectedImageImageView);

      Task.Run(async () => { await RunUnitTests(); });
    }
コード例 #17
0
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate (bundle);
            SetContentView (Resource.Layout.ListImages);
            String tagService = Intent.GetStringExtra ("TagService");

            gallery = (Gallery)FindViewById <Gallery> (Resource.Id.gallery);
            images = new List<Bitmap> ();

            progressDialog = new ProgressDialog(this) { Indeterminate = true };
            progressDialog.SetTitle("Carga de Datos");
            progressDialog.SetMessage("Wait");

            searchImagesByTag (tagService);
        }
コード例 #18
0
ファイル: GalleryView.ascx.cs プロジェクト: ivladyka/Ekran
 private void LoadGallery()
 {
     Gallery g = new Gallery();
     g.Where.CategoryID.Value = CategoryID;
     if (g.Query.Load())
     {
         HtmlTableRow row = new HtmlTableRow();
         do
         {
             Image i = new Image();
             i.ImageUrl = Path.Combine(Utils.GaleryImagePath, g.PhotoName);
             gallery.Controls.Add(i);
         }
         while (g.MoveNext());
     }
 }
コード例 #19
0
ファイル: Default.aspx.cs プロジェクト: devharis/The-Forum
    protected void FileUpload_Click(object sender, EventArgs e)
    {
        if (IsValid)
        {
            Gallery file = new Gallery();

            file.SaveImage(FileUpload.PostedFile.InputStream, FileUpload.PostedFile.FileName);

            var di = new DirectoryInfo(Server.MapPath("~/Content/Files/"));
            var files = di.GetFiles();

            FileRepeater.DataSource = files;
            FileRepeater.DataBind();

            Response.Redirect("Default.aspx?Name=" + FileUpload.PostedFile.FileName);

        }
    }
コード例 #20
0
ファイル: edit.aspx.cs プロジェクト: ratnazone/ratna
        protected void Initialize()
        {
            if (!isInitialized)
            {
                lock (syncRoot)
                {
                    if (!isInitialized)
                    {

                        url = Request.QueryString[Constants.UrlIdentifier] as string;

                        if (!string.IsNullOrEmpty(url))
                        {
                            gallery = GalleryPlugin.Instance.Read(url);
                        }

                        isInitialized = true;
                    }
                }
            }
        }
コード例 #21
0
ファイル: Default.aspx.cs プロジェクト: alcesleo/Gallery
    protected void Page_Load(object sender, EventArgs e)
    {
        // TODO Caching and breakout to DAL?

        // Interpret query-string and set images
        var fileName = Request.QueryString["img"];

        // If image is found
        if (Gallery.ImageExists(fileName))
        {
            // Display that image
            MainImage.Visible = true;
            MainImage.ImageUrl = "~/Content/Images/" + fileName;

            // Display success-message if the image was just uploaded
            if (Request.QueryString["uploaded"] == "true")
            {
                DisplayAlert(String.Format("The image '{0}' was uploaded successfully!", fileName), "success");
            }
        }
        // If an upload has failed, display error message
        else if (Request.QueryString["uploaded"] == "false")
        {
            // Display success message
            DisplayAlert(String.Format("The image '{0}' was not uploaded!", fileName), "error");
        }
        // Default action
        else
        {
            // TODO Display first image?

        }

        // Set the thumbnails datasource
        var ga = new Gallery();
        var names = ga.GetImageNames();
        ThumbsListView.DataSource = names;
        ThumbsListView.DataBind();
    }
コード例 #22
0
    private static HtmlTableCell AddCategoryCellInnerHTML(int categoryID, string title)
    {
        HtmlTableCell cell = new HtmlTableCell();
        cell.Align = "center";
        Gallery g = new Gallery();
        g.Where.CategoryID.Value = categoryID;
        g.Query.Top = 1;
        if(g.Query.Load())
        {
            Image i = new Image();
            i.CssClass = "GaleryThImageStyle";
            i.ImageUrl = Path.Combine(Utils.GaleryImagePath, g.s_PhotoName.Substring(0, g.s_PhotoName.Length - 4) + ".jpg" );
            HyperLink hl = new HyperLink();
            hl.NavigateUrl = "../Default.aspx?content=GalleryTableView&CategoryID=" + categoryID;
            hl.CssClass = "GaleryImageStyle";
            hl.Controls.Add(i);
            Literal l = new Literal();
            l.Text = "<br><span class='galerytext'>" + title + "</span>";
            hl.Controls.Add(l);
            cell.Controls.Add(hl);

        }
        return cell;
    }
コード例 #23
0
 public ProjectUsersResult(Gallery gallery)
 {
     this._gallery = gallery;
 }
コード例 #24
0
ファイル: GameController.cs プロジェクト: Ryxali/Passpartout
 private IEnumerator TMP_AddPainting(Gallery g)
 {
     while (true)
     {
         g.AddNewPainting(Painting.CreateSampleTexture2D());
         yield return new WaitForSeconds(5.0f);
     }
 }
コード例 #25
0
ファイル: GalleryPlugin.cs プロジェクト: ratnazone/ratna
        public void Update(Gallery gallery)
        {
            if (gallery == null)
            {
                throw new ArgumentNullException("gallery");
            }

            logger.Log(LogLevel.Debug, "Saving gallery");

            PluginStore.Instance.Save(Instance, gallery);
        }
コード例 #26
0
    protected void Page_Load(object sender, EventArgs e)
    {
        Guid? id = null;

        if (!string.IsNullOrEmpty(Request.QueryString["guid"]))
            id = new Guid(Request.QueryString["guid"]);
        else if (ViewState["id"] != null)
            id = (Guid)ViewState["id"];

        if (id.HasValue)
        {
            _gallery = Gallery.Load(id.Value);
        }

        if (!IsPostBack)
        {
            if (!id.HasValue)
            {
                _gallery = new Gallery();
                _gallery.Title = "Nueva galería";
                _gallery.Description = "Breve descripción de la galería";
                _gallery.Content = "Contenido de la galería";
                _gallery.Author = User.Identity.Name;
                UploadedFile file = UploadedFile.FromStream(File.OpenRead(
                    Path.Combine(Server.MapPath(Request.ApplicationPath), "images/file.jpg")));
                file.FileName = "File";
                file.Description = "Imagen de prueba";
                file.ContentType = "image/jpeg";
                _gallery.AddFile(file);
                _gallery.AddUser(User.Identity.Name);
                _gallery.AcceptChanges();
                ViewState["id"] = _gallery.ID;
            }

            BindGallery(_gallery);
        }
    }
コード例 #27
0
    private void UploadRefundDoc2(FileUpload f1, int ImageType, int ProductId)
    {
        Gallery cp = new Gallery();

        string imagefile = null;
        bool checkDoc = true;// CheckDocRequired(f1, validFileTypes);
        bool checksize = true; // CheckForSize(f1);
        if (checkDoc == true && checksize == true)
        {
            string ext = System.IO.Path.GetExtension(f1.PostedFile.FileName);
            if (f1.HasFiles)
            {
                int res = DataService.Provider.RemoveOldPhotos(ImageType, ProductId);

                foreach (HttpPostedFile uploadedFile in f1.PostedFiles)
                {
                    imagefile = uploadedFile.FileName;

                    string file = "";
                    if (ext.ToUpper() == ".JPG")
                    {
                        uploadedFile.SaveAs(Page.MapPath("/images/Gallery/" + imagefile));
                        uploadedFile.SaveAs(Page.MapPath("/images/Gallery/thumb/" + imagefile));
                        file = Page.MapPath("/images/Gallery/thumb/" + imagefile);
                        Util.ResizeImage(file, file, 0, 0, true);
                        cp.ImageFile = imagefile;
                        cp.thumbImage = imagefile;
                    }
                    else if (ext.ToUpper() == ".PNG")
                    {
                        uploadedFile.SaveAs(Page.MapPath("/images/Gallery/" + imagefile));
                        uploadedFile.SaveAs(Page.MapPath("/images/Gallery/thumb/" + imagefile));
                        file = Page.MapPath("/images/Gallery/thumb/" + imagefile);
                        Util.ResizeImage(file, file, 0, 0, true);
                        cp.ImageFile = imagefile;
                        cp.thumbImage = imagefile;
                    }
                    else
                    {
                        msgBox1.alert("Please image can not be in other format than .jpg or .png");
                        return;
                    }

                    cp.ProductLink = txtProductLink.Text;
                    cp.ProductName = txtProductName.Text;
                    int result = DataService.Provider.SaveGallery(cp);
                    imagefile = "";
                }
            }
            else
            {
                imagefile = "no_image.jpg";
            }
        }
        else if (checkDoc == false && checksize == true)
        {
            msgBox1.alert("Kindly select an image in .jpg or .png Format, The selected file is invalid!");
            return;
        }
        else if (checkDoc == false && checksize == false)
        {
            msgBox1.alert("Bad Format and Size, Please select a Valid File!");
            return;
        }
        else if (checkDoc == true && checksize == false)
        {
            msgBox1.alert("File Limit Exceeded!");
            return;
        }
        else { return; }

    }
コード例 #28
0
 public IEnumerable<System.String> Repeater1_GetData()
 {
     Gallery gallery = new Gallery();
     return gallery.GetImageNames();
 }
コード例 #29
0
 public IEnumerable<System.String> GetImages()
 {
     Gallery gallery = new Gallery();
     return  gallery.GetImageNames();
 }
コード例 #30
0
        // Generates content of glossaryDocumentPart1.
        private void GenerateGlossaryDocumentPart1Content(GlossaryDocumentPart glossaryDocumentPart1)
        {
            GlossaryDocument glossaryDocument1 = new GlossaryDocument(){ MCAttributes = new MarkupCompatibilityAttributes(){ Ignorable = "w14 w15 wp14" }  };
            glossaryDocument1.AddNamespaceDeclaration("wpc", "http://schemas.microsoft.com/office/word/2010/wordprocessingCanvas");
            glossaryDocument1.AddNamespaceDeclaration("mc", "http://schemas.openxmlformats.org/markup-compatibility/2006");
            glossaryDocument1.AddNamespaceDeclaration("o", "urn:schemas-microsoft-com:office:office");
            glossaryDocument1.AddNamespaceDeclaration("r", "http://schemas.openxmlformats.org/officeDocument/2006/relationships");
            glossaryDocument1.AddNamespaceDeclaration("m", "http://schemas.openxmlformats.org/officeDocument/2006/math");
            glossaryDocument1.AddNamespaceDeclaration("v", "urn:schemas-microsoft-com:vml");
            glossaryDocument1.AddNamespaceDeclaration("wp14", "http://schemas.microsoft.com/office/word/2010/wordprocessingDrawing");
            glossaryDocument1.AddNamespaceDeclaration("wp", "http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing");
            glossaryDocument1.AddNamespaceDeclaration("w10", "urn:schemas-microsoft-com:office:word");
            glossaryDocument1.AddNamespaceDeclaration("w", "http://schemas.openxmlformats.org/wordprocessingml/2006/main");
            glossaryDocument1.AddNamespaceDeclaration("w14", "http://schemas.microsoft.com/office/word/2010/wordml");
            glossaryDocument1.AddNamespaceDeclaration("w15", "http://schemas.microsoft.com/office/word/2010/11/wordml");
            glossaryDocument1.AddNamespaceDeclaration("wpg", "http://schemas.microsoft.com/office/word/2010/wordprocessingGroup");
            glossaryDocument1.AddNamespaceDeclaration("wpi", "http://schemas.microsoft.com/office/word/2010/wordprocessingInk");
            glossaryDocument1.AddNamespaceDeclaration("wne", "http://schemas.microsoft.com/office/word/2006/wordml");
            glossaryDocument1.AddNamespaceDeclaration("wps", "http://schemas.microsoft.com/office/word/2010/wordprocessingShape");

            DocParts docParts1 = new DocParts();

            DocPart docPart1 = new DocPart();

            DocPartProperties docPartProperties1 = new DocPartProperties();
            DocPartName docPartName1 = new DocPartName(){ Val = "DefaultPlaceholder_1081868558" };

            Category category1 = new Category();
            Name name1 = new Name(){ Val = "General" };
            Gallery gallery1 = new Gallery(){ Val = DocPartGalleryValues.Placeholder };

            category1.Append(name1);
            category1.Append(gallery1);

            DocPartTypes docPartTypes1 = new DocPartTypes();
            DocPartType docPartType1 = new DocPartType(){ Val = DocPartValues.SdtPlaceholder };

            docPartTypes1.Append(docPartType1);

            Behaviors behaviors1 = new Behaviors();
            Behavior behavior1 = new Behavior(){ Val = DocPartBehaviorValues.Content };

            behaviors1.Append(behavior1);
            DocPartId docPartId1 = new DocPartId(){ Val = "{F039DA22-FC7F-4FBD-92C2-651CCBF1B274}" };

            docPartProperties1.Append(docPartName1);
            docPartProperties1.Append(category1);
            docPartProperties1.Append(docPartTypes1);
            docPartProperties1.Append(behaviors1);
            docPartProperties1.Append(docPartId1);

            DocPartBody docPartBody1 = new DocPartBody();

            Paragraph paragraph19 = new Paragraph(){ RsidParagraphAddition = "00930812", RsidRunAdditionDefault = "00B75576" };

            Run run25 = new Run(){ RsidRunProperties = "003E0DED" };

            RunProperties runProperties43 = new RunProperties();
            RunStyle runStyle3 = new RunStyle(){ Val = "PlaceholderText" };

            runProperties43.Append(runStyle3);
            Text text25 = new Text();
            text25.Text = "Click here to enter text.";

            run25.Append(runProperties43);
            run25.Append(text25);

            paragraph19.Append(run25);

            docPartBody1.Append(paragraph19);

            docPart1.Append(docPartProperties1);
            docPart1.Append(docPartBody1);

            DocPart docPart2 = new DocPart();

            DocPartProperties docPartProperties2 = new DocPartProperties();
            DocPartName docPartName2 = new DocPartName(){ Val = "DefaultPlaceholder_1081868562" };

            Category category2 = new Category();
            Name name2 = new Name(){ Val = "General" };
            Gallery gallery2 = new Gallery(){ Val = DocPartGalleryValues.Placeholder };

            category2.Append(name2);
            category2.Append(gallery2);

            DocPartTypes docPartTypes2 = new DocPartTypes();
            DocPartType docPartType2 = new DocPartType(){ Val = DocPartValues.SdtPlaceholder };

            docPartTypes2.Append(docPartType2);

            Behaviors behaviors2 = new Behaviors();
            Behavior behavior2 = new Behavior(){ Val = DocPartBehaviorValues.Content };

            behaviors2.Append(behavior2);
            DocPartId docPartId2 = new DocPartId(){ Val = "{00F3F2EC-0290-443B-9815-66648EE1ADF9}" };

            docPartProperties2.Append(docPartName2);
            docPartProperties2.Append(category2);
            docPartProperties2.Append(docPartTypes2);
            docPartProperties2.Append(behaviors2);
            docPartProperties2.Append(docPartId2);

            DocPartBody docPartBody2 = new DocPartBody();

            Paragraph paragraph20 = new Paragraph(){ RsidParagraphAddition = "00930812", RsidRunAdditionDefault = "00B75576" };

            Run run26 = new Run(){ RsidRunProperties = "003E0DED" };

            RunProperties runProperties44 = new RunProperties();
            RunStyle runStyle4 = new RunStyle(){ Val = "PlaceholderText" };

            runProperties44.Append(runStyle4);
            Text text26 = new Text();
            text26.Text = "Enter any content that you want to repeat, including other content controls. You can also insert this control around table rows in order to repeat parts of a table.";

            run26.Append(runProperties44);
            run26.Append(text26);

            paragraph20.Append(run26);

            docPartBody2.Append(paragraph20);

            docPart2.Append(docPartProperties2);
            docPart2.Append(docPartBody2);

            DocPart docPart3 = new DocPart();

            DocPartProperties docPartProperties3 = new DocPartProperties();
            DocPartName docPartName3 = new DocPartName(){ Val = "B207B2DF6D0E4E13956E6616811860CA" };

            Category category3 = new Category();
            Name name3 = new Name(){ Val = "General" };
            Gallery gallery3 = new Gallery(){ Val = DocPartGalleryValues.Placeholder };

            category3.Append(name3);
            category3.Append(gallery3);

            DocPartTypes docPartTypes3 = new DocPartTypes();
            DocPartType docPartType3 = new DocPartType(){ Val = DocPartValues.SdtPlaceholder };

            docPartTypes3.Append(docPartType3);

            Behaviors behaviors3 = new Behaviors();
            Behavior behavior3 = new Behavior(){ Val = DocPartBehaviorValues.Content };

            behaviors3.Append(behavior3);
            DocPartId docPartId3 = new DocPartId(){ Val = "{1631777A-52D9-4CE4-A42F-C87B6FA35F21}" };

            docPartProperties3.Append(docPartName3);
            docPartProperties3.Append(category3);
            docPartProperties3.Append(docPartTypes3);
            docPartProperties3.Append(behaviors3);
            docPartProperties3.Append(docPartId3);

            DocPartBody docPartBody3 = new DocPartBody();

            Paragraph paragraph21 = new Paragraph(){ RsidParagraphAddition = "00EF189C", RsidParagraphProperties = "00930812", RsidRunAdditionDefault = "00930812" };

            ParagraphProperties paragraphProperties1 = new ParagraphProperties();
            ParagraphStyleId paragraphStyleId1 = new ParagraphStyleId(){ Val = "B207B2DF6D0E4E13956E6616811860CA" };

            paragraphProperties1.Append(paragraphStyleId1);

            Run run27 = new Run(){ RsidRunProperties = "00D27A45" };

            RunProperties runProperties45 = new RunProperties();
            RunStyle runStyle5 = new RunStyle(){ Val = "PlaceholderText" };

            runProperties45.Append(runStyle5);
            Text text27 = new Text();
            text27.Text = "Click here to enter text.";

            run27.Append(runProperties45);
            run27.Append(text27);

            paragraph21.Append(paragraphProperties1);
            paragraph21.Append(run27);

            docPartBody3.Append(paragraph21);

            docPart3.Append(docPartProperties3);
            docPart3.Append(docPartBody3);

            DocPart docPart4 = new DocPart();

            DocPartProperties docPartProperties4 = new DocPartProperties();
            DocPartName docPartName4 = new DocPartName(){ Val = "4B632797D8B1461898B8F461443A20E0" };

            Category category4 = new Category();
            Name name4 = new Name(){ Val = "General" };
            Gallery gallery4 = new Gallery(){ Val = DocPartGalleryValues.Placeholder };

            category4.Append(name4);
            category4.Append(gallery4);

            DocPartTypes docPartTypes4 = new DocPartTypes();
            DocPartType docPartType4 = new DocPartType(){ Val = DocPartValues.SdtPlaceholder };

            docPartTypes4.Append(docPartType4);

            Behaviors behaviors4 = new Behaviors();
            Behavior behavior4 = new Behavior(){ Val = DocPartBehaviorValues.Content };

            behaviors4.Append(behavior4);
            DocPartId docPartId4 = new DocPartId(){ Val = "{4829C634-4047-4182-9E1A-7F28677ACBC2}" };

            docPartProperties4.Append(docPartName4);
            docPartProperties4.Append(category4);
            docPartProperties4.Append(docPartTypes4);
            docPartProperties4.Append(behaviors4);
            docPartProperties4.Append(docPartId4);

            DocPartBody docPartBody4 = new DocPartBody();

            Paragraph paragraph22 = new Paragraph(){ RsidParagraphAddition = "00EF189C", RsidParagraphProperties = "00930812", RsidRunAdditionDefault = "00930812" };

            ParagraphProperties paragraphProperties2 = new ParagraphProperties();
            ParagraphStyleId paragraphStyleId2 = new ParagraphStyleId(){ Val = "4B632797D8B1461898B8F461443A20E0" };

            paragraphProperties2.Append(paragraphStyleId2);

            Run run28 = new Run(){ RsidRunProperties = "00D27A45" };

            RunProperties runProperties46 = new RunProperties();
            RunStyle runStyle6 = new RunStyle(){ Val = "PlaceholderText" };

            runProperties46.Append(runStyle6);
            Text text28 = new Text();
            text28.Text = "Click here to enter text.";

            run28.Append(runProperties46);
            run28.Append(text28);

            paragraph22.Append(paragraphProperties2);
            paragraph22.Append(run28);

            docPartBody4.Append(paragraph22);

            docPart4.Append(docPartProperties4);
            docPart4.Append(docPartBody4);

            docParts1.Append(docPart1);
            docParts1.Append(docPart2);
            docParts1.Append(docPart3);
            docParts1.Append(docPart4);

            glossaryDocument1.Append(docParts1);

            glossaryDocumentPart1.GlossaryDocument = glossaryDocument1;
        }
コード例 #31
0
        public virtual GalleriesCreateOrUpdateOperation StartCreateOrUpdate(string resourceGroupName, string galleryName, Gallery gallery, CancellationToken cancellationToken = default)
        {
            if (resourceGroupName == null)
            {
                throw new ArgumentNullException(nameof(resourceGroupName));
            }
            if (galleryName == null)
            {
                throw new ArgumentNullException(nameof(galleryName));
            }
            if (gallery == null)
            {
                throw new ArgumentNullException(nameof(gallery));
            }

            using var scope = _clientDiagnostics.CreateScope("GalleriesClient.StartCreateOrUpdate");
            scope.Start();
            try
            {
                var originalResponse = RestClient.CreateOrUpdate(resourceGroupName, galleryName, gallery, cancellationToken);
                return(new GalleriesCreateOrUpdateOperation(_clientDiagnostics, _pipeline, RestClient.CreateCreateOrUpdateRequest(resourceGroupName, galleryName, gallery).Request, originalResponse));
            }
            catch (Exception e)
            {
                scope.Failed(e);
                throw;
            }
        }