internal void __MarshalTo(ref __Native @ref)
 {
     @ref.AllowList = default(InfoQueueFilterDescription.__Native);
     if (AllowList != null)
     {
         AllowList.__MarshalTo(ref @ref.AllowList);
     }
     @ref.DenyList = default(InfoQueueFilterDescription.__Native);
     if (DenyList != null)
     {
         DenyList.__MarshalTo(ref @ref.DenyList);
     }
 }
 internal void __MarshalTo(ref __Native @ref)
 {
     @ref.AllowList = default;
     if (AllowList != null)
     {
         AllowList.__MarshalTo(ref @ref.AllowList);
     }
     @ref.DenyList = default;
     if (DenyList != null)
     {
         DenyList.__MarshalTo(ref @ref.DenyList);
     }
 }
Beispiel #3
0
        private void DisplayDataObject(String textHeader, IDataObject dataObject)
        {
            string[] formats = dataObject.GetFormats();
            normalText.Remove(0, normalText.Length);
            richText.Remove(0, richText.Length);
            xmlText.Remove(0, xmlText.Length);
            normalText.Append(textHeader);
            bool   isDataPresent;
            object data;
            string dataString;

            foreach (string format in formats)
            {
                try
                {
                    isDataPresent = dataObject.GetDataPresent(format);
                    // ???mért nem tudja konvertálni az enhanced metafile-t????
                    if (isDataPresent && !DenyList.Contains(format) && (data = dataObject.GetData(format)) != null)
                    {
                        dataString = data.ToString();
                        normalText.Append(format + ": " + dataString + "\r\n");

                        switch (dataString)
                        {
                        case "System.IO.MemoryStream":
                        {
                            System.IO.MemoryStream ms = (System.IO.MemoryStream)data;
                            int  b;
                            long position = ms.Position;
                            b           = DisplayMemory(normalText, ms);
                            ms.Position = position;
                            if (format.ToLower().Contains("xml"))
                            {
                                xmlText.Append(ms.XmlDeserialize <Feed>().ToString());
                            }
                            break;
                        }

                        case "System.String[]":
                        {
                            foreach (string s2 in (System.String[])data)
                            {
                                normalText.Append(s2 + "\r\n");
                            }
                            break;
                        }

                        default:
                        {
                            switch (format)
                            {
                            case "Rich Text Format":
                                normalText.Append(format + ": " + dataString + "\r\n");
                                richText.Append(dataString);
                                break;

                            case "Rich Text Format Without Objects":
                            case "RTF As Text":
                            case "System.String":
                            case "UnicodeText":
                            case "Text":
                                normalText.Append(format + ": " + dataString + "\r\n");
                                break;

                            default:

                                break;
                            }
                            break;
                        }
                        }
                        normalText.Append("\r\n");
                    }
                }
                catch (ExecutionEngineException ex)
                {
                    Forms.MessageBox.Show(String.Format("Cannot get format:{0}", format));
                    normalText.AppendFormat("Cannot get format:{0}", format);
                }
                catch (ExternalException ex)
                {
                    Forms.MessageBox.Show(String.Format("Cannot get format:{0}", format));
                    normalText.AppendFormat("Cannot get format:{0}", format);
                }
                catch (Exception ex)
                {
                    Forms.MessageBox.Show(String.Format("Cannot get format:{0}", format));
                    normalText.AppendFormat("Cannot get format:{0}", format);
                }
            }
            //this.textBox1.Text = "Hello World";
            //textBox1.Text = normalText.ToString();
            //richTextBox1.Rtf = richText.ToString();
            //richTextBox2.Text = xmlText.ToString();
        }
Beispiel #4
0
        private void DisplayDataObject(String textHeader, IDataObject dataObject)
        {
            string[] formats = dataObject.GetFormats();
            normalText.Remove(0, normalText.Length);
            richText.Remove(0, richText.Length);

            normalText.Append(textHeader);
            bool   isDataPresent;
            object data;
            string dataString;

            normalText.AppendLine("Formats: ");

            foreach (string format in formats)
            {
                normalText.AppendFormat(" {0}\r\n", format);
            }

            foreach (string format in formats)
            {
                try
                {
                    isDataPresent = dataObject.GetDataPresent(format);
                    // ???mért nem tudja konvertálni az enhanced metafile-t????
                    if (isDataPresent && !DenyList.Contains(format) && (data = dataObject.GetData(format)) != null)
                    {
                        dataString = data.ToString();
                        normalText.Append(format + ": " + dataString + "\r\n");

                        switch (dataString)
                        {
                        case "System.IO.MemoryStream":
                        {
                            System.IO.MemoryStream ms = (System.IO.MemoryStream)data;
                            DisplayMemory(normalText, ms);
                            break;
                        }

                        case "System.String[]":
                        {
                            foreach (string s2 in (System.String[])data)
                            {
                                normalText.Append(s2 + "\r\n");
                            }
                            break;
                        }

                        default:
                        {
                            switch (format)
                            {
                            case "Rich Text Format":
                                //normalText.Append(format + ": " + dataString + "\r\n");
                                richText.Append(dataString);
                                break;

                            case "Rich Text Format Without Objects":
                            case "RTF As Text":
                            case "System.String":
                            case "UnicodeText":
                            case "Text":
                            default:
                                break;
                            }
                            break;
                        }
                        }
                        normalText.Append("\r\n");
                    }
                    else
                    {
                        normalText.AppendFormat("Cannot get format:{0} (IsDataPresent:{1}\r\n)", format, isDataPresent);
                    }
                }
                //catch (ExecutionEngineException ex)
                //{
                //    Forms.MessageBox.Show(String.Format("Cannot get format:{0}", format));
                //    normalText.AppendFormat("Cannot get format:{0}", format);
                //}
                catch (ExternalException ex)
                {
                    //Forms.MessageBox.Show(String.Format("Cannot get format:{0}", format));
                    normalText.AppendFormat("Cannot get format:{0}\r\n", format);
                }
                catch (Exception ex)
                {
                    //Forms.MessageBox.Show(String.Format("Cannot get format:{0}", format));
                    normalText.AppendFormat("Cannot get format:{0}\r\n", format);
                }
            }
            //this.textBox1.Text = "Hello World";
            //textBox1.Text = normalText.ToString();
            //richTextBox1.Rtf = richText.ToString();
            //richTextBox2.Text = xmlText.ToString();
        }